From 31aa765f1e81e0f629328fc47f7ff28944e2820c Mon Sep 17 00:00:00 2001 From: Marcos Date: Mon, 25 Oct 2021 08:48:28 -0300 Subject: [PATCH 1/4] Slack OAuthFlow --- .../airbyte/oauth/flows/SlackOAuthFlow.java | 49 +++++++++++++ .../SlackOAuthFlowIntegrationTest.java | 70 +++++++++++++++++++ .../oauth/flows/OAuthFlowIntegrationTest.java | 5 ++ 3 files changed, 124 insertions(+) create mode 100644 airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java create mode 100644 airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java new file mode 100644 index 000000000000..904f4198fdd2 --- /dev/null +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java @@ -0,0 +1,49 @@ +package io.airbyte.oauth.flows; + +import io.airbyte.config.persistence.ConfigRepository; +import io.airbyte.oauth.BaseOAuthFlow; +import org.apache.http.client.utils.URIBuilder; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.util.UUID; + +public class SlackOAuthFlow extends BaseOAuthFlow { + + final String SLACK_CONSENT_URL_BASE = "https://slack.com/oauth/authorize"; + final String SLACK_TOKEN_URL = "https://slack.com/api/oauth.access"; + public SlackOAuthFlow(ConfigRepository configRepository) { + super(configRepository); + } + + /** + * Depending on the OAuth flow implementation, the URL to grant user's consent may differ, + * especially in the query parameters to be provided. This function should generate such consent URL + * accordingly. + * + * @param definitionId + * @param clientId + * @param redirectUrl + */ + @Override + protected String formatConsentUrl(UUID definitionId, String clientId, String redirectUrl) throws IOException { + try { + return new URIBuilder(SLACK_CONSENT_URL_BASE) + .addParameter("client_id", clientId) + .addParameter("redirect_uri", redirectUrl) + .addParameter("state", getState()) + .addParameter("scope", "read") + .build().toString(); + } catch (URISyntaxException e) { + throw new IOException("Failed to format Consent URL for OAuth flow", e); + } + } + + /** + * Returns the URL where to retrieve the access token from. + */ + @Override + protected String getAccessTokenUrl() { + return SLACK_TOKEN_URL; + } +} diff --git a/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java new file mode 100644 index 000000000000..aeed382a5897 --- /dev/null +++ b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java @@ -0,0 +1,70 @@ +package io.airbyte.oauth.flows; + +import com.fasterxml.jackson.databind.JsonNode; +import com.google.common.collect.ImmutableMap; +import io.airbyte.commons.json.Jsons; +import io.airbyte.config.SourceOAuthParameter; +import io.airbyte.config.persistence.ConfigNotFoundException; +import io.airbyte.config.persistence.ConfigRepository; +import io.airbyte.oauth.OAuthFlowImplementation; +import io.airbyte.validation.json.JsonValidationException; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.when; + +public class SlackOAuthFlowIntegrationTest extends OAuthFlowIntegrationTest{ + @Override + protected Path get_credentials_path() { + return Path.of("secrets/slack.json"); + } + + @Override + protected OAuthFlowImplementation getFlowObject(ConfigRepository configRepository) { + return new SlackOAuthFlow(configRepository); + } + + @Override + protected String getRedirectUrl() { + return "https://27b0-2804-14d-2a76-9a9a-fdbb-adee-9e5d-6c.ngrok.io/auth_flow"; + } + + @Test + public void testFullSlackOAuthFlow() throws InterruptedException, ConfigNotFoundException, IOException, JsonValidationException { + int limit = 20; + final UUID workspaceId = UUID.randomUUID(); + final UUID definitionId = UUID.randomUUID(); + final String fullConfigAsString = new String(Files.readAllBytes(get_credentials_path())); + final JsonNode credentialsJson = Jsons.deserialize(fullConfigAsString).get("credentials"); + when(configRepository.listSourceOAuthParam()).thenReturn(List.of(new SourceOAuthParameter() + .withOauthParameterId(UUID.randomUUID()) + .withSourceDefinitionId(definitionId) + .withWorkspaceId(workspaceId) + .withConfiguration(Jsons.jsonNode(ImmutableMap.builder() + .put("client_id", credentialsJson.get("client_id").asText()) + .put("client_secret", credentialsJson.get("client_secret").asText()) + .build())))); + final String url = flow.getSourceConsentUrl(workspaceId, definitionId, getRedirectUrl()); + LOGGER.info("Waiting for user consent at: {}", url); + // TODO: To automate, start a selenium job to navigate to the Consent URL and click on allowing + // access... + while (!serverHandler.isSucceeded() && limit > 0) { + Thread.sleep(1000); + limit -= 1; + } + assertTrue(serverHandler.isSucceeded(), "Failed to get User consent on time"); + final Map params = flow.completeSourceOAuth(workspaceId, definitionId, + Map.of("code", serverHandler.getParamValue()), getRedirectUrl()); + LOGGER.info("Response from completing OAuth Flow is: {}", params.toString()); + assertTrue(params.containsKey("credentials")); + assertTrue(((Map)params.get("credentials")).containsKey("access_token")); + assertTrue(((Map)params.get("credentials")).get("access_token").toString().length() > 0); + } +} diff --git a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java index 138604ab074f..79651e58a119 100644 --- a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java @@ -40,6 +40,11 @@ public abstract class OAuthFlowIntegrationTest { protected abstract Path get_credentials_path(); + + protected String getRedirectUrl() { + return REDIRECT_URL; + } + protected abstract OAuthFlowImplementation getFlowObject(ConfigRepository configRepository); @BeforeEach From 150d3cbdc46228e10df286e1849e29405b2b7709 Mon Sep 17 00:00:00 2001 From: Marcos Date: Thu, 28 Oct 2021 07:28:51 -0300 Subject: [PATCH 2/4] Slack OAuth Unit and Integration Tests --- .../oauth/OAuthImplementationFactory.java | 7 +--- .../airbyte/oauth/flows/SlackOAuthFlow.java | 27 ++++++++++---- .../SlackOAuthFlowIntegrationTest.java | 37 +++++++++++-------- .../oauth/flows/OAuthFlowIntegrationTest.java | 1 - 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java index 2c195d0c8d25..c5874a880a4e 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java @@ -6,11 +6,7 @@ import com.google.common.collect.ImmutableMap; import io.airbyte.config.persistence.ConfigRepository; -import io.airbyte.oauth.flows.AsanaOAuthFlow; -import io.airbyte.oauth.flows.FacebookMarketingOAuthFlow; -import io.airbyte.oauth.flows.GithubOAuthFlow; -import io.airbyte.oauth.flows.SalesforceOAuthFlow; -import io.airbyte.oauth.flows.TrelloOAuthFlow; +import io.airbyte.oauth.flows.*; import io.airbyte.oauth.flows.google.GoogleAdsOAuthFlow; import io.airbyte.oauth.flows.google.GoogleAnalyticsOAuthFlow; import io.airbyte.oauth.flows.google.GoogleSearchConsoleOAuthFlow; @@ -33,6 +29,7 @@ public OAuthImplementationFactory(final ConfigRepository configRepository) { .put("airbyte/source-google-sheets", new GoogleSheetsOAuthFlow(configRepository)) .put("airbyte/source-salesforce", new SalesforceOAuthFlow(configRepository)) .put("airbyte/source-trello", new TrelloOAuthFlow(configRepository)) + .put("airbyte/source-slack", new SlackOAuthFlow(configRepository)) .build(); } diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java index 904f4198fdd2..e5f4d13fbf35 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java @@ -1,21 +1,33 @@ +/* + * Copyright (c) 2021 Airbyte, Inc., all rights reserved. + */ + package io.airbyte.oauth.flows; +import com.google.common.annotations.VisibleForTesting; import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.oauth.BaseOAuthFlow; -import org.apache.http.client.utils.URIBuilder; - import java.io.IOException; import java.net.URISyntaxException; +import java.net.http.HttpClient; import java.util.UUID; +import java.util.function.Supplier; +import org.apache.http.client.utils.URIBuilder; public class SlackOAuthFlow extends BaseOAuthFlow { final String SLACK_CONSENT_URL_BASE = "https://slack.com/oauth/authorize"; final String SLACK_TOKEN_URL = "https://slack.com/api/oauth.access"; + public SlackOAuthFlow(ConfigRepository configRepository) { super(configRepository); } + @VisibleForTesting + public SlackOAuthFlow(final ConfigRepository configRepository, final HttpClient httpClient, final Supplier stateSupplier) { + super(configRepository, httpClient, stateSupplier); + } + /** * Depending on the OAuth flow implementation, the URL to grant user's consent may differ, * especially in the query parameters to be provided. This function should generate such consent URL @@ -29,11 +41,11 @@ public SlackOAuthFlow(ConfigRepository configRepository) { protected String formatConsentUrl(UUID definitionId, String clientId, String redirectUrl) throws IOException { try { return new URIBuilder(SLACK_CONSENT_URL_BASE) - .addParameter("client_id", clientId) - .addParameter("redirect_uri", redirectUrl) - .addParameter("state", getState()) - .addParameter("scope", "read") - .build().toString(); + .addParameter("client_id", clientId) + .addParameter("redirect_uri", redirectUrl) + .addParameter("state", getState()) + .addParameter("scope", "read") + .build().toString(); } catch (URISyntaxException e) { throw new IOException("Failed to format Consent URL for OAuth flow", e); } @@ -46,4 +58,5 @@ protected String formatConsentUrl(UUID definitionId, String clientId, String red protected String getAccessTokenUrl() { return SLACK_TOKEN_URL; } + } diff --git a/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java index aeed382a5897..26ec1d2c1e86 100644 --- a/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2021 Airbyte, Inc., all rights reserved. + */ + package io.airbyte.oauth.flows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.when; + import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableMap; import io.airbyte.commons.json.Jsons; @@ -8,19 +15,16 @@ import io.airbyte.config.persistence.ConfigRepository; import io.airbyte.oauth.OAuthFlowImplementation; import io.airbyte.validation.json.JsonValidationException; -import org.junit.jupiter.api.Test; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; import java.util.Map; import java.util.UUID; +import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.when; +public class SlackOAuthFlowIntegrationTest extends OAuthFlowIntegrationTest { -public class SlackOAuthFlowIntegrationTest extends OAuthFlowIntegrationTest{ @Override protected Path get_credentials_path() { return Path.of("secrets/slack.json"); @@ -28,7 +32,7 @@ protected Path get_credentials_path() { @Override protected OAuthFlowImplementation getFlowObject(ConfigRepository configRepository) { - return new SlackOAuthFlow(configRepository); + return new SlackOAuthFlow(configRepository); } @Override @@ -44,13 +48,13 @@ public void testFullSlackOAuthFlow() throws InterruptedException, ConfigNotFound final String fullConfigAsString = new String(Files.readAllBytes(get_credentials_path())); final JsonNode credentialsJson = Jsons.deserialize(fullConfigAsString).get("credentials"); when(configRepository.listSourceOAuthParam()).thenReturn(List.of(new SourceOAuthParameter() - .withOauthParameterId(UUID.randomUUID()) - .withSourceDefinitionId(definitionId) - .withWorkspaceId(workspaceId) - .withConfiguration(Jsons.jsonNode(ImmutableMap.builder() - .put("client_id", credentialsJson.get("client_id").asText()) - .put("client_secret", credentialsJson.get("client_secret").asText()) - .build())))); + .withOauthParameterId(UUID.randomUUID()) + .withSourceDefinitionId(definitionId) + .withWorkspaceId(workspaceId) + .withConfiguration(Jsons.jsonNode(ImmutableMap.builder() + .put("client_id", credentialsJson.get("client_id").asText()) + .put("client_secret", credentialsJson.get("client_secret").asText()) + .build())))); final String url = flow.getSourceConsentUrl(workspaceId, definitionId, getRedirectUrl()); LOGGER.info("Waiting for user consent at: {}", url); // TODO: To automate, start a selenium job to navigate to the Consent URL and click on allowing @@ -61,10 +65,11 @@ public void testFullSlackOAuthFlow() throws InterruptedException, ConfigNotFound } assertTrue(serverHandler.isSucceeded(), "Failed to get User consent on time"); final Map params = flow.completeSourceOAuth(workspaceId, definitionId, - Map.of("code", serverHandler.getParamValue()), getRedirectUrl()); + Map.of("code", serverHandler.getParamValue()), getRedirectUrl()); LOGGER.info("Response from completing OAuth Flow is: {}", params.toString()); assertTrue(params.containsKey("credentials")); - assertTrue(((Map)params.get("credentials")).containsKey("access_token")); - assertTrue(((Map)params.get("credentials")).get("access_token").toString().length() > 0); + assertTrue(((Map) params.get("credentials")).containsKey("access_token")); + assertTrue(((Map) params.get("credentials")).get("access_token").toString().length() > 0); } + } diff --git a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java index 79651e58a119..e89edca6f825 100644 --- a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java @@ -40,7 +40,6 @@ public abstract class OAuthFlowIntegrationTest { protected abstract Path get_credentials_path(); - protected String getRedirectUrl() { return REDIRECT_URL; } From 2bcd30b5b8f4e1be79512a015f87cc6b53b068f2 Mon Sep 17 00:00:00 2001 From: Marcos Eliziario Santos Date: Wed, 3 Nov 2021 10:03:35 -0300 Subject: [PATCH 3/4] Update airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java Co-authored-by: Christophe Duong --- .../java/io/airbyte/oauth/OAuthImplementationFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java index c5874a880a4e..c6c28a7e528a 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java @@ -28,8 +28,8 @@ public OAuthImplementationFactory(final ConfigRepository configRepository) { .put("airbyte/source-google-search-console", new GoogleSearchConsoleOAuthFlow(configRepository)) .put("airbyte/source-google-sheets", new GoogleSheetsOAuthFlow(configRepository)) .put("airbyte/source-salesforce", new SalesforceOAuthFlow(configRepository)) - .put("airbyte/source-trello", new TrelloOAuthFlow(configRepository)) - .put("airbyte/source-slack", new SlackOAuthFlow(configRepository)) + .put("airbyte/source-slack", new SlackOAuthFlow(configRepository)) + .put("airbyte/source-trello", new TrelloOAuthFlow(configRepository)) .build(); } From 96b41c6f3606b347d51aa6cc32e614aaab022cca Mon Sep 17 00:00:00 2001 From: Marcos Date: Sun, 7 Nov 2021 21:11:53 -0300 Subject: [PATCH 4/4] Fixes after merge for Slack OAuthFlow --- .../airbyte/oauth/OAuthImplementationFactory.java | 2 +- .../io/airbyte/oauth/flows/SlackOAuthFlow.java | 4 ++-- .../SlackOAuthFlowIntegrationTest.java | 15 ++++++++------- .../flows/HubspotOAuthFlowIntegrationTest.java | 4 ++++ .../oauth/flows/OAuthFlowIntegrationTest.java | 4 ---- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java index e9fca987eb6e..c2cca548c3a4 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java @@ -34,7 +34,7 @@ public OAuthImplementationFactory(final ConfigRepository configRepository, final .put("airbyte/source-google-sheets", new GoogleSheetsOAuthFlow(configRepository, httpClient)) .put("airbyte/source-instagram", new InstagramOAuthFlow(configRepository, httpClient)) .put("airbyte/source-salesforce", new SalesforceOAuthFlow(configRepository, httpClient)) - .put("airbyte/source-slack", new SlackOAuthFlow(configRepository)) + .put("airbyte/source-slack", new SlackOAuthFlow(configRepository, httpClient)) .put("airbyte/source-surveymonkey", new SurveymonkeyOAuthFlow(configRepository, httpClient)) .put("airbyte/source-trello", new TrelloOAuthFlow(configRepository, httpClient)) .put("airbyte/source-hubspot", new HubspotOAuthFlow(configRepository, httpClient)) diff --git a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java index e5f4d13fbf35..d2d84a21042c 100644 --- a/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java +++ b/airbyte-oauth/src/main/java/io/airbyte/oauth/flows/SlackOAuthFlow.java @@ -19,8 +19,8 @@ public class SlackOAuthFlow extends BaseOAuthFlow { final String SLACK_CONSENT_URL_BASE = "https://slack.com/oauth/authorize"; final String SLACK_TOKEN_URL = "https://slack.com/api/oauth.access"; - public SlackOAuthFlow(ConfigRepository configRepository) { - super(configRepository); + public SlackOAuthFlow(final ConfigRepository configRepository, HttpClient httpClient) { + super(configRepository, httpClient); } @VisibleForTesting diff --git a/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java index 26ec1d2c1e86..10903cb7b8ef 100644 --- a/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io.airbyte.oauth.flows/SlackOAuthFlowIntegrationTest.java @@ -16,6 +16,7 @@ import io.airbyte.oauth.OAuthFlowImplementation; import io.airbyte.validation.json.JsonValidationException; import java.io.IOException; +import java.net.http.HttpClient; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; @@ -26,18 +27,18 @@ public class SlackOAuthFlowIntegrationTest extends OAuthFlowIntegrationTest { @Override - protected Path get_credentials_path() { + protected Path getCredentialsPath() { return Path.of("secrets/slack.json"); } @Override - protected OAuthFlowImplementation getFlowObject(ConfigRepository configRepository) { - return new SlackOAuthFlow(configRepository); + protected String getRedirectUrl() { + return "https://27b0-2804-14d-2a76-9a9a-fdbb-adee-9e5d-6c.ngrok.io/auth_flow"; } @Override - protected String getRedirectUrl() { - return "https://27b0-2804-14d-2a76-9a9a-fdbb-adee-9e5d-6c.ngrok.io/auth_flow"; + protected OAuthFlowImplementation getFlowImplementation(ConfigRepository configRepository, HttpClient httpClient) { + return new SlackOAuthFlow(configRepository, httpClient); } @Test @@ -45,7 +46,7 @@ public void testFullSlackOAuthFlow() throws InterruptedException, ConfigNotFound int limit = 20; final UUID workspaceId = UUID.randomUUID(); final UUID definitionId = UUID.randomUUID(); - final String fullConfigAsString = new String(Files.readAllBytes(get_credentials_path())); + final String fullConfigAsString = new String(Files.readAllBytes(getCredentialsPath())); final JsonNode credentialsJson = Jsons.deserialize(fullConfigAsString).get("credentials"); when(configRepository.listSourceOAuthParam()).thenReturn(List.of(new SourceOAuthParameter() .withOauthParameterId(UUID.randomUUID()) @@ -55,7 +56,7 @@ public void testFullSlackOAuthFlow() throws InterruptedException, ConfigNotFound .put("client_id", credentialsJson.get("client_id").asText()) .put("client_secret", credentialsJson.get("client_secret").asText()) .build())))); - final String url = flow.getSourceConsentUrl(workspaceId, definitionId, getRedirectUrl()); + final String url = getFlowImplementation(configRepository, httpClient).getSourceConsentUrl(workspaceId, definitionId, getRedirectUrl()); LOGGER.info("Waiting for user consent at: {}", url); // TODO: To automate, start a selenium job to navigate to the Consent URL and click on allowing // access... diff --git a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/HubspotOAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/HubspotOAuthFlowIntegrationTest.java index 234f31454dfb..2346a6061a08 100644 --- a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/HubspotOAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/HubspotOAuthFlowIntegrationTest.java @@ -31,6 +31,10 @@ protected Path getCredentialsPath() { return Path.of("secrets/hubspot.json"); } + protected OAuthFlowImplementation getFlowObject(ConfigRepository configRepository) { + return new HubspotOAuthFlow(configRepository, httpClient); + } + @Override protected OAuthFlowImplementation getFlowImplementation(ConfigRepository configRepository, HttpClient httpClient) { return new HubspotOAuthFlow(configRepository, httpClient); diff --git a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java index 73b454621bee..ff0d81ea514a 100644 --- a/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java +++ b/airbyte-oauth/src/test-integration/java/io/airbyte/oauth/flows/OAuthFlowIntegrationTest.java @@ -44,16 +44,12 @@ protected Path getCredentialsPath() { return Path.of("secrets/config.json"); }; - protected String getRedirectUrl() { return REDIRECT_URL; } - protected abstract OAuthFlowImplementation getFlowObject(ConfigRepository configRepository); - protected abstract OAuthFlowImplementation getFlowImplementation(ConfigRepository configRepository, HttpClient httpClient); - @BeforeEach public void setup() throws IOException { if (!Files.exists(getCredentialsPath())) {