From f0d95015157bc76e5ef88ac8634c18a4384f308d Mon Sep 17 00:00:00 2001 From: John Michael Mizerany Date: Tue, 27 Feb 2024 13:41:05 -0600 Subject: [PATCH] switch to use api_key --- .github/workflows/test.yml | 2 +- README.md | 2 +- meltano.yml | 2 +- tap_fleetio/client.py | 2 +- tap_fleetio/tap.py | 4 ++-- tests/test_core.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2a47790..1588d4b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ name: Test tap-fleetio on: [push] env: - TAP_FLEETIO_API_TOKEN: ${{ secrets.TAP_FLEETIO_API_TOKEN }} + TAP_FLEETIO_API_KEY: ${{ secrets.TAP_FLEETIO_API_KEY }} TAP_FLEETIO_ACCOUNT_TOKEN: ${{ secrets.TAP_FLEETIO_ACCOUNT_TOKEN }} jobs: diff --git a/README.md b/README.md index 05747ac..5051870 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ pipx install git+https://github.com/fleetio/tap-fleetio.git@main | Setting | Required | Default | Description | |:--------------------|:--------:|:-------:|:------------| -| api_token | True | None | The token to authenticate against the Fleetio API | +| api_key | True | None | The token to authenticate against the Fleetio API | | account_token | True | None | Account Token | | api_url | False | https://secure.fleetio.com/api | Fleetio API base url | | stream_maps | False | None | Config object for stream maps capability. For more information check out [Stream Maps](https://sdk.meltano.com/en/latest/stream_maps.html). | diff --git a/meltano.yml b/meltano.yml index c2ef3ca..665f41a 100644 --- a/meltano.yml +++ b/meltano.yml @@ -16,7 +16,7 @@ plugins: - about - stream-maps settings: - - name: api_token + - name: api_key kind: password - name: account_token kind: password diff --git a/tap_fleetio/client.py b/tap_fleetio/client.py index 67343da..e95dc29 100644 --- a/tap_fleetio/client.py +++ b/tap_fleetio/client.py @@ -52,7 +52,7 @@ def http_headers(self) -> dict: headers = {} if "user_agent" in self.config: headers["User-Agent"] = self.config.get("user_agent") - headers["Authorization"] = f"Token {self.config.get('api_token')}" + headers["Authorization"] = f"Token {self.config.get('api_key')}" headers["Account-Token"] = self.config.get('account_token') headers["X-Client-Name"] = "data_connector" headers["X-Client-Platform"] = "fleetio_singer_tap" diff --git a/tap_fleetio/tap.py b/tap_fleetio/tap.py index 308a583..83a72be 100644 --- a/tap_fleetio/tap.py +++ b/tap_fleetio/tap.py @@ -15,11 +15,11 @@ class Tapfleetio(Tap): config_jsonschema = th.PropertiesList( th.Property( - "api_token", + "api_key", th.StringType, required=True, secret=True, # Flag config as protected. - description="The token to authenticate against the Fleetio API", + description="The key to authenticate against the Fleetio API", ), th.Property( "account_token", diff --git a/tests/test_core.py b/tests/test_core.py index 6fd3378..2086cc3 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -8,7 +8,7 @@ from tap_fleetio.tap import Tapfleetio SAMPLE_CONFIG = { - "api_token": os.environ.get("TAP_FLEETIO_API_TOKEN"), + "api_key": os.environ.get("TAP_FLEETIO_API_KEY"), "account_token": os.environ.get("TAP_FLEETIO_ACCOUNT_TOKEN") }