From bcbb3856889237c8fb7d4c9ae92fa138b84ef9ce Mon Sep 17 00:00:00 2001 From: Oleksandr Bazarnov Date: Mon, 22 Nov 2021 13:52:30 +0200 Subject: [PATCH] updated flow --- .../src/main/resources/seed/source_specs.yaml | 82 +++++++++++++++++-- .../airbyte/oauth/flows/DriftOAuthFlow.java | 2 +- 2 files changed, 74 insertions(+), 10 deletions(-) diff --git a/airbyte-config/init/src/main/resources/seed/source_specs.yaml b/airbyte-config/init/src/main/resources/seed/source_specs.yaml index 4f0063d8e2c7..d93b4b1e2b8a 100644 --- a/airbyte-config/init/src/main/resources/seed/source_specs.yaml +++ b/airbyte-config/init/src/main/resources/seed/source_specs.yaml @@ -1112,25 +1112,89 @@ supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] -- dockerImage: "airbyte/source-drift:0.2.3" +- dockerImage: "airbyte/source-drift:0.2.4" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/drift" connectionSpecification: $schema: "http://json-schema.org/draft-07/schema#" title: "Drift Spec" type: "object" - required: - - "access_token" - additionalProperties: false + required: [] + additionalProperties: true properties: - access_token: - type: "string" - description: "Drift Access Token. See the docs for more information on how to generate this key." - airbyte_secret: true + credentials: + title: "Authorization Method" + type: "object" + oneOf: + - type: "object" + title: "OAuth2.0" + required: + - "client_id" + - "client_secret" + - "access_token" + - "refresh_token" + properties: + credentials: + type: "string" + const: "oauth2.0" + enum: + - "oauth2.0" + default: "oauth2.0" + order: 0 + client_id: + type: "string" + title: "Client ID" + description: "The Client ID of your Drift developer application." + airbyte_secret: true + client_secret: + type: "string" + title: "Client Secret" + description: "The Client Secret of your Drift developer application." + airbyte_secret: true + access_token: + type: "string" + title: "Access Token" + description: "Access Token for making authenticated requests." + airbyte_secret: true + refresh_token: + type: "string" + title: "Refresh Token" + description: "Refresh Token to renew the expired access_token." + default: "" + airbyte_secret: true + - title: "Access Token" + type: "object" + required: + - "access_token" + properties: + credentials: + type: "string" + const: "access_token" + enum: + - "access_token" + default: "access_token" + order: 0 + access_token: + type: "string" + title: "Access Token" + description: "Drift Access Token. See the docs for more information on how to generate this key." + airbyte_secret: true supportsNormalization: false supportsDBT: false supported_destination_sync_modes: [] + authSpecification: + auth_type: "oauth2.0" + oauth2Specification: + rootObject: + - "credentials" + - "0" + oauthFlowInitParameters: + - - "client_id" + - - "client_secret" + oauthFlowOutputParameters: + - - "access_token" + - - "refresh_token" - dockerImage: "airbyte/source-exchange-rates:0.2.5" spec: documentationUrl: "https://docs.airbyte.io/integrations/sources/exchangeratesapi" diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/DriftOAuthFlow.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/DriftOAuthFlow.java index e77e59a7ad0c..5d7c175187d0 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/DriftOAuthFlow.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/DriftOAuthFlow.java @@ -37,7 +37,7 @@ public DriftOAuthFlow(final ConfigRepository configRepository, final HttpClient } @Override - protected String formatConsentUrl(UUID definitionId, String clientId, String redirectUrl) throws IOException { + protected String formatConsentUrl(UUID definitionId, String clientId, String redirectUrl, JsonNode inputOAuthConfiguration) throws IOException { final URIBuilder builder = new URIBuilder() .setScheme("https") .setHost("dev.drift.com")