Skip to content

Commit

Permalink
🎉 Source Airtable: implement OAuth (#20934)
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov authored Jan 26, 2023
1 parent e414595 commit 229d1c9
Show file tree
Hide file tree
Showing 13 changed files with 542 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: Airtable
sourceDefinitionId: 14c6e7ea-97ed-4f5e-a7b5-25e9a80b8212
dockerRepository: airbyte/source-airtable
dockerImageTag: 1.0.1
dockerImageTag: 1.0.2
documentationUrl: https://docs.airbyte.com/integrations/sources/airtable
icon: airtable.svg
sourceType: api
Expand Down
114 changes: 102 additions & 12 deletions airbyte-config/init/src/main/resources/seed/source_specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,118 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-airtable:1.0.1"
- dockerImage: "airbyte/source-airtable:1.0.2"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/airtable"
connectionSpecification:
$schema: "http://json-schema.org/draft-07/schema#"
title: "Airtable Source Spec"
type: "object"
required:
- "api_key"
additionalProperties: true
properties:
api_key:
type: "string"
description: "The API Key or PAT for the Airtable account. See the <a href=\"\
https://airtable.com/developers/web/guides/personal-access-tokens\">Support\
\ Guide</a> for more information on how to obtain this key."
title: "API Key"
airbyte_secret: true
examples:
- "key1234567890"
credentials:
title: "Authentication"
type: "object"
oneOf:
- type: "object"
title: "OAuth2.0"
required:
- "client_id"
- "client_secret"
- "refresh_token"
properties:
auth_method:
type: "string"
const: "oauth2.0"
client_id:
type: "string"
title: "Client ID"
description: "The client ID of the Airtable developer application."
airbyte_secret: true
client_secret:
type: "string"
title: "Client secret"
description: "The client secret the Airtable developer application."
airbyte_secret: true
access_token:
type: "string"
description: "Access Token for making authenticated requests."
airbyte_secret: true
token_expiry_date:
type: "string"
description: "The date-time when the access token should be refreshed."
format: "date-time"
refresh_token:
type: "string"
title: "Refresh token"
description: "The key to refresh the expired access token."
airbyte_secret: true
- title: "API Key"
type: "object"
required:
- "api_key"
properties:
auth_method:
type: "string"
const: "api_key"
api_key:
type: "string"
description: "The API Key or PAT for the Airtable account. See the\
\ <a href=\"https://airtable.com/developers/web/guides/personal-access-tokens\"\
>Support Guide</a> for more information on how to obtain this key."
title: "API Key"
airbyte_secret: true
examples:
- "key1234567890"
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
advanced_auth:
auth_flow_type: "oauth2.0"
predicate_key:
- "credentials"
- "auth_method"
predicate_value: "oauth2.0"
oauth_config_specification:
complete_oauth_output_specification:
type: "object"
properties:
access_token:
type: "string"
path_in_connector_config:
- "credentials"
- "access_token"
refresh_token:
type: "string"
path_in_connector_config:
- "credentials"
- "refresh_token"
token_expiry_date:
type: "string"
format: "date-time"
path_in_connector_config:
- "credentials"
- "token_expiry_date"
complete_oauth_server_input_specification:
type: "object"
properties:
client_id:
type: "string"
client_secret:
type: "string"
complete_oauth_server_output_specification:
type: "object"
properties:
client_id:
type: "string"
path_in_connector_config:
- "credentials"
- "client_id"
client_secret:
type: "string"
path_in_connector_config:
- "credentials"
- "client_secret"
- dockerImage: "airbyte/source-aha:0.1.0"
spec:
documentationUrl: "https://docs.airbyte.com/integrations/sources/aha"
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-airtable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_airtable ./source_airtable
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=1.0.1
LABEL io.airbyte.version=1.0.2
LABEL io.airbyte.name=airbyte/source-airtable
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# See [Source Acceptance Tests](https://docs.airbyte.com/connector-development/testing-connectors/source-acceptance-tests-reference)
# for more information about how to configure these tests
connector_image: airbyte/source-airtable:dev
test_strictness_level: high
acceptance_tests:
spec:
tests:
Expand All @@ -11,18 +12,30 @@ acceptance_tests:
status: "succeed"
- config_path: "integration_tests/invalid_config.json"
status: "failed"
- config_path: "secrets/config_oauth.json"
status: "succeed"
- config_path: "integration_tests/invalid_config_oauth.json"
status: "failed"
discovery:
tests:
- config_path: "secrets/config.json"
# bypassed this check, because discovery mechanism was changed
backward_compatibility_tests_config:
disable_for_version: "0.1.3"
basic_read:
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
empty_streams: []
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: true
exact_order: true
extra_records: false
- config_path: "secrets/config_oauth.json"
expect_records:
path: "integration_tests/expected_records.jsonl"
extra_fields: true
exact_order: true
extra_records: false
full_refresh:
tests:
- config_path: "secrets/config.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
incremental:
bypass_reason: "Incremental syncs are not supported on this connector."
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "users/table_6",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {}
},
"supported_sync_modes": ["full_refresh"],
"supported_destination_sync_modes": ["overwrite", "append_dedup"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "users/field_type_test",
Expand Down
Loading

0 comments on commit 229d1c9

Please sign in to comment.