From 9fae9ea86517290f47c4dae42019a38b71673e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Thu, 5 Sep 2024 20:22:03 -0600 Subject: [PATCH] feat: Accept an app key + refresh token for Dropbox --- .github/workflows/ci_workflow.yml | 1 - README.md | 27 +++++++++++++-------------- meltano.yml | 11 ++++++++--- tap_csv/filesystem_config.py | 11 +++++++++-- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci_workflow.yml b/.github/workflows/ci_workflow.yml index f84b18a..ef49a62 100644 --- a/.github/workflows/ci_workflow.yml +++ b/.github/workflows/ci_workflow.yml @@ -14,7 +14,6 @@ on: - pyproject.toml - tox.ini pull_request: - branches: [main] paths: - .github/workflows/ci_workflow.yml - .github/workflows/constraints.txt diff --git a/README.md b/README.md index 67f1040..dc11729 100644 --- a/README.md +++ b/README.md @@ -93,20 +93,18 @@ Optionally, the files definition can be provided by an external json file: #### FTP -| Setting | Required | Default | Description | -| :----------- | :------- | :------ | :---------------------- | -| ftp | False | None | FTP connection settings | -| ftp.host | True | None | FTP server host | -| ftp.port | False | 21 | FTP server port | -| ftp.username | False | None | FTP username | -| ftp.password | False | None | FTP password | -| ftp.encoding | False | utf-8 | FTP server encoding | +| Setting | Required | Default | Description | +| :----------- | :------- | :------ | :------------------ | +| ftp.host | True | None | FTP server host | +| ftp.port | False | 21 | FTP server port | +| ftp.username | False | None | FTP username | +| ftp.password | False | None | FTP password | +| ftp.encoding | False | utf-8 | FTP server encoding | #### GitHub | Setting | Required | Default | Description | | :-------------- | :------- | :------ | :---------------------------------------------------------- | -| github | False | None | GitHub connection settings | | github.org | True | None | GitHub organization or user where the repository is located | | github.repo | True | None | GitHub repository | | github.username | False | None | GitHub username | @@ -141,10 +139,10 @@ Optionally, the files definition can be provided by an external json file: #### Dropbox -| Setting | Required | Default | Description | -| :------------ | :------- | :------ | :-------------------------- | -| dropbox | False | None | Dropbox connection settings | -| dropbox.token | True | None | Dropbox token | +| Setting | Required | Default | Description | +| :-------------------- | :------- | :------ | :-------------------- | +| dropbox.app_key | True | None | Dropbox App key | +| dropbox.refresh_token | True | None | Dropbox refresh token | The token needs the `files.content.read` scope: @@ -158,7 +156,8 @@ The token needs the `files.content.read` scope: "add_metadata_columns": true, "filesystem": "dropbox", "dropbox": { - "token": "...." + "app_key": "your_app_key", + "refresh_token": "your_refresh_token" }, "files": [ { diff --git a/meltano.yml b/meltano.yml index c18b189..66c7ca1 100644 --- a/meltano.yml +++ b/meltano.yml @@ -75,9 +75,14 @@ plugins: sensitive: true # Dropbox settings - - name: dropbox.token - label: Dropbox Token - description: Token for Dropbox + - name: dropbox.app_key + label: Dropbox App Key + description: OAuth2 app key for Dropbox + kind: string + sensitive: true + - name: dropbox.refresh_token + label: Dropbox Refresh Token + description: OAuth2 refresh Token for Dropbox kind: password sensitive: true diff --git a/tap_csv/filesystem_config.py b/tap_csv/filesystem_config.py index c522b86..7589c22 100644 --- a/tap_csv/filesystem_config.py +++ b/tap_csv/filesystem_config.py @@ -76,11 +76,18 @@ "dropbox", th.ObjectType( th.Property( - "token", + "app_key", + th.StringType, + secret=True, + required=True, + description="Dropbox App key", + ), + th.Property( + "refresh_token", th.StringType, secret=True, required=True, - description="Dropbox token", + description="Dropbox refresh token", ), ), description="Dropbox connection settings",