- Notifications
You must be signed in to change notification settings - Fork 4.9k
Bmoric/add fetch source schema in oauth #19392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits Select commit Hold shift + click to select a range
b05453c Update inputs
benmoriceau 06d6c4d PR comments and autogen files
benmoriceau 0e49686 Fix oAuth retry
benmoriceau 7dff0bf Handle null
benmoriceau ec199d0 Merge branch 'master' of github.com:airbytehq/airbyte into bmoric/add…
benmoriceau 3d29990 Add missing ;
benmoriceau 796c3ec PR comments
benmoriceau ddac0ec use advanced oAuth
benmoriceau 35f500a PR comments
benmoriceau 1788b34 More PR comments
benmoriceau fce3c2b Format
benmoriceau cdd5837 Merge branch 'master' into bmoric/add-fetch-source-schema-in-oauth
benmoriceau 2dc776a Avoid conflict in json extract
benmoriceau 46f0054 Format
benmoriceau a416ff6 Merge branch 'master' into bmoric/add-fetch-source-schema-in-oauth
benmoriceau ca32646 Merge branch 'master' into bmoric/add-fetch-source-schema-in-oauth
benmoriceau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions 40 airbyte-server/src/main/java/io/airbyte/server/handlers/helpers/OAuthPathExtractor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* | ||
| * Copyright (c) 2022 Airbyte, Inc., all rights reserved. | ||
| */ | ||
| | ||
| package io.airbyte.server.handlers.helpers; | ||
| | ||
| import com.fasterxml.jackson.databind.JsonNode; | ||
| import java.util.ArrayList; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| | ||
| public class OAuthPathExtractor { | ||
| | ||
| private static final String PROPERTIES = "properties"; | ||
| private static final String PATH_IN_CONNECTOR_CONFIG = "path_in_connector_config"; | ||
| | ||
| public static Map<String, List<String>> extractOauthConfigurationPaths(final JsonNode configuration) { | ||
| | ||
| if (configuration.has(PROPERTIES) && configuration.get(PROPERTIES).isObject()) { | ||
| final Map<String, List<String>> result = new HashMap<>(); | ||
| | ||
| configuration.get(PROPERTIES).fields().forEachRemaining(entry -> { | ||
gosusnp marked this conversation as resolved. Show resolved Hide resolved | ||
| final JsonNode value = entry.getValue(); | ||
| if (value.isObject() && value.has(PATH_IN_CONNECTOR_CONFIG) && value.get(PATH_IN_CONNECTOR_CONFIG).isArray()) { | ||
| final List<String> path = new ArrayList<>(); | ||
| for (final JsonNode pathPart : value.get(PATH_IN_CONNECTOR_CONFIG)) { | ||
| path.add(pathPart.textValue()); | ||
| } | ||
| result.put(entry.getKey(), path); | ||
| } | ||
| }); | ||
| | ||
| return result; | ||
| } else { | ||
| return new HashMap<>(); | ||
| } | ||
| } | ||
| | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.