diff --git a/airbyte-api/build.gradle b/airbyte-api/build.gradle index 7be1fd48720b..c083974052be 100644 --- a/airbyte-api/build.gradle +++ b/airbyte-api/build.gradle @@ -22,6 +22,7 @@ task generateApiServer(type: GenerateTask) { modelPackage = "io.airbyte.api.model" importMappings = [ + 'OAuthConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceDefinitionSpecification' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'DestinationDefinitionSpecification': 'com.fasterxml.jackson.databind.JsonNode', @@ -55,6 +56,7 @@ task generateApiClient(type: GenerateTask) { modelPackage = "io.airbyte.api.client.model" importMappings = [ + 'OAuthConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceDefinitionSpecification' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'DestinationDefinitionSpecification': 'com.fasterxml.jackson.databind.JsonNode', @@ -87,6 +89,7 @@ task generateApiDocs(type: GenerateTask) { modelPackage = "io.airbyte.api.client.model" importMappings = [ + 'OAuthConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceDefinitionSpecification' : 'com.fasterxml.jackson.databind.JsonNode', 'SourceConfiguration' : 'com.fasterxml.jackson.databind.JsonNode', 'DestinationDefinitionSpecification': 'com.fasterxml.jackson.databind.JsonNode', diff --git a/airbyte-api/src/main/openapi/config.yaml b/airbyte-api/src/main/openapi/config.yaml index ef75e61ba952..78ff0c3d7476 100644 --- a/airbyte-api/src/main/openapi/config.yaml +++ b/airbyte-api/src/main/openapi/config.yaml @@ -1311,7 +1311,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CompleteOauthResponse" + $ref: "#/components/schemas/CompleteOAuthResponse" "404": $ref: "#/components/responses/NotFoundResponse" "422": @@ -1357,7 +1357,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CompleteOauthResponse" + $ref: "#/components/schemas/CompleteOAuthResponse" "404": $ref: "#/components/responses/NotFoundResponse" "422": @@ -2066,6 +2066,8 @@ components: $ref: "#/components/schemas/SourceDefinitionSpecification" authSpecification: $ref: "#/components/schemas/SourceAuthSpecification" + advancedAuth: + $ref: "#/components/schemas/AdvancedAuth" jobInfo: $ref: "#/components/schemas/SynchronousJobRead" # SOURCE @@ -2268,6 +2270,8 @@ components: $ref: "#/components/schemas/DestinationDefinitionSpecification" authSpecification: $ref: "#/components/schemas/DestinationAuthSpecification" + advancedAuth: + $ref: "#/components/schemas/AdvancedAuth" jobInfo: $ref: "#/components/schemas/SynchronousJobRead" supportedDestinationSyncModes: @@ -3227,6 +3231,115 @@ components: items: $ref: "#/components/schemas/DbMigrationRead" # OAuth + OAuthConfiguration: + description: OAuth specific blob. + OAuthInputConfiguration: + description: The values required to configure OAuth flows. + The schema for this must match the `OAuthConfigSpecification.oauthUserInputFromConnectorConfigSpecification` schema. + $ref: "#/components/schemas/OAuthConfiguration" + AdvancedAuth: + type: object + properties: + authFlowType: + type: string + enum: ["oauth2.0", "oauth1.0"] + predicateKey: + description: Json Path to a field in the connectorSpecification that should exist for the advanced auth to be applicable. + type: array + items: + type: string + predicateValue: + description: Value of the predicate_key fields for the advanced auth to be applicable. + type: string + oauthConfigSpecification: + "$ref": "#/components/schemas/OAuthConfigSpecification" + OAuthConfigSpecification: + type: object + properties: + oauthUserInputFromConnectorConfigSpecification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth. + Must be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification + using special annotation 'path_in_connector_config'. + These are input values the user is entering through the UI to authenticate to the connector, that might also shared + as inputs for syncing data via the connector. + + Examples: + + if no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[] + if connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow, + oauth_user_input_from_connector_config_specification={ + app_id: { + type: string + path_in_connector_config: ['app_id'] + } + } + if connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow, + oauth_user_input_from_connector_config_specification={ + app_id: { + type: string + path_in_connector_config: ['info', 'app_id'] + } + } + $ref: "#/components/schemas/OAuthConfiguration" + completeOAuthOutputSpecification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations produced by the OAuth flows as they are + returned by the distant OAuth APIs. + Must be a valid JSON describing the fields to merge back to `ConnectorSpecification.connectionSpecification`. + For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it, + + Examples: + + complete_oauth_output_specification={ + refresh_token: { + type: string, + path_in_connector_config: ['credentials', 'refresh_token'] + } + } + $ref: "#/components/schemas/OAuthConfiguration" + completeOAuthServerInputSpecification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations. + Must be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the + server when completing an OAuth flow (typically exchanging an auth code for refresh token). + + Examples: + + complete_oauth_server_input_specification={ + client_id: { + type: string + }, + client_secret: { + type: string + } + } + $ref: "#/components/schemas/OAuthConfiguration" + completeOAuthServerOutputSpecification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations that + also need to be merged back into the connector configuration at runtime. + This is a subset configuration of `complete_oauth_server_input_specification` that filters fields out to retain only the ones that + are necessary for the connector to function with OAuth. (some fields could be used during oauth flows but not needed afterwards, therefore + they would be listed in the `complete_oauth_server_input_specification` but not `complete_oauth_server_output_specification`) + Must be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the + connector when using OAuth flow APIs. + These fields are to be merged back to `ConnectorSpecification.connectionSpecification`. + For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it, + + Examples: + + complete_oauth_server_output_specification={ + client_id: { + type: string, + path_in_connector_config: ['credentials', 'client_id'] + }, + client_secret: { + type: string, + path_in_connector_config: ['credentials', 'client_secret'] + } + } + $ref: "#/components/schemas/OAuthConfiguration" SourceOauthConsentRequest: type: object required: @@ -3241,6 +3354,8 @@ components: redirectUrl: description: The url to redirect to after getting the user consent type: string + oAuthInputConfiguration: + $ref: "#/components/schemas/OAuthInputConfiguration" DestinationOauthConsentRequest: type: object required: @@ -3255,6 +3370,8 @@ components: redirectUrl: description: The url to redirect to after getting the user consent type: string + oAuthInputConfiguration: + $ref: "#/components/schemas/OAuthInputConfiguration" OAuthConsentRead: type: object required: @@ -3279,6 +3396,8 @@ components: description: The query parameters present in the redirect URL after a user granted consent e.g auth code type: object additionalProperties: true # Oauth parameters like code, state, etc.. will be different per API so we don't specify them in advance + oAuthInputConfiguration: + $ref: "#/components/schemas/OAuthInputConfiguration" CompleteDestinationOAuthRequest: type: object required: @@ -3296,7 +3415,9 @@ components: description: The query parameters present in the redirect URL after a user granted consent e.g auth code type: object additionalProperties: true # Oauth parameters like code, state, etc.. will be different per API so we don't specify them in advance - CompleteOauthResponse: + oAuthInputConfiguration: + $ref: "#/components/schemas/OAuthInputConfiguration" + CompleteOAuthResponse: type: object additionalProperties: true # Oauth parameters like refresh/access token etc.. will be different per API so we don't specify them in advance SetInstancewideSourceOauthParamsRequestBody: diff --git a/airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py b/airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py index 0e7477a838ff..0de561d5478d 100644 --- a/airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py +++ b/airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py @@ -113,23 +113,28 @@ class AuthSpecification(BaseModel): ) -class ConnectorSpecification(BaseModel): - class Config: - extra = Extra.allow +class AuthFlowType(Enum): + oauth1_0 = "oauth1.0" + oauth2_0 = "oauth2.0" - documentationUrl: Optional[AnyUrl] = None - changelogUrl: Optional[AnyUrl] = None - connectionSpecification: Dict[str, Any] = Field( - ..., - description="ConnectorDefinition specific blob. Must be a valid JSON string.", + +class OAuthConfigSpecification(BaseModel): + oauth_user_input_from_connector_config_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth.\nMust be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification\nusing special annotation 'path_in_connector_config'.\nThese are input values the user is entering through the UI to authenticate to the connector, that might also shared\nas inputs for syncing data via the connector.\n\nExamples:\n\nif no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[]\nif connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['app_id']\n }\n }\nif connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['info', 'app_id']\n }\n }", ) - supportsIncremental: Optional[bool] = Field(None, description="If the connector supports incremental mode or not.") - supportsNormalization: Optional[bool] = Field(False, description="If the connector supports normalization or not.") - supportsDBT: Optional[bool] = Field(False, description="If the connector supports DBT or not.") - supported_destination_sync_modes: Optional[List[DestinationSyncMode]] = Field( - None, description="List of destination sync modes supported by the connector" + complete_oauth_output_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations produced by the OAuth flows as they are\nreturned by the distant OAuth APIs.\nMust be a valid JSON describing the fields to merge back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\n\nExamples:\n\n complete_oauth_output_specification={\n refresh_token: {\n type: string,\n path_in_connector_config: ['credentials', 'refresh_token']\n }\n }", + ) + complete_oauth_server_input_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations.\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nserver when completing an OAuth flow (typically exchanging an auth code for refresh token).\n\nExamples:\n\n complete_oauth_server_input_specification={\n client_id: {\n type: string\n },\n client_secret: {\n type: string\n }\n }", + ) + complete_oauth_server_output_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations that\nalso need to be merged back into the connector configuration at runtime.\nThis is a subset configuration of `complete_oauth_server_input_specification` that filters fields out to retain only the ones that\nare necessary for the connector to function with OAuth. (some fields could be used during oauth flows but not needed afterwards, therefore\nthey would be listed in the `complete_oauth_server_input_specification` but not `complete_oauth_server_output_specification`)\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nconnector when using OAuth flow APIs.\nThese fields are to be merged back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\n\nExamples:\n\n complete_oauth_server_output_specification={\n client_id: {\n type: string,\n path_in_connector_config: ['credentials', 'client_id']\n },\n client_secret: {\n type: string,\n path_in_connector_config: ['credentials', 'client_secret']\n }\n }", ) - authSpecification: Optional[AuthSpecification] = None class AirbyteStream(BaseModel): @@ -174,6 +179,42 @@ class Config: ) +class AdvancedAuth(BaseModel): + auth_flow_type: Optional[AuthFlowType] = None + predicate_key: Optional[List[str]] = Field( + None, + description="Json Path to a field in the connectorSpecification that should exist for the advanced auth to be applicable.", + ) + predicate_value: Optional[str] = Field( + None, + description="Value of the predicate_key fields for the advanced auth to be applicable.", + ) + oauth_config_specification: Optional[OAuthConfigSpecification] = None + + +class ConnectorSpecification(BaseModel): + class Config: + extra = Extra.allow + + documentationUrl: Optional[AnyUrl] = None + changelogUrl: Optional[AnyUrl] = None + connectionSpecification: Dict[str, Any] = Field( + ..., + description="ConnectorDefinition specific blob. Must be a valid JSON string.", + ) + supportsIncremental: Optional[bool] = Field(None, description="If the connector supports incremental mode or not.") + supportsNormalization: Optional[bool] = Field(False, description="If the connector supports normalization or not.") + supportsDBT: Optional[bool] = Field(False, description="If the connector supports DBT or not.") + supported_destination_sync_modes: Optional[List[DestinationSyncMode]] = Field( + None, description="List of destination sync modes supported by the connector" + ) + authSpecification: Optional[AuthSpecification] = Field(None, description="deprecated, switching to advanced_auth instead") + advanced_auth: Optional[AdvancedAuth] = Field( + None, + description="Additional and optional specification object to describe what an 'advanced' Auth flow would need to function.\n - A connector should be able to fully function with the configuration as described by the ConnectorSpecification in a 'basic' mode.\n - The 'advanced' mode provides easier UX for the user with UI improvements and automations. However, this requires further setup on the\n server side by instance or workspace admins beforehand. The trade-off is that the user does not have to provide as many technical\n inputs anymore and the auth process is faster and easier to complete.", + ) + + class AirbyteCatalog(BaseModel): class Config: extra = Extra.allow diff --git a/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py b/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py index 0e7477a838ff..0de561d5478d 100644 --- a/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py +++ b/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py @@ -113,23 +113,28 @@ class AuthSpecification(BaseModel): ) -class ConnectorSpecification(BaseModel): - class Config: - extra = Extra.allow +class AuthFlowType(Enum): + oauth1_0 = "oauth1.0" + oauth2_0 = "oauth2.0" - documentationUrl: Optional[AnyUrl] = None - changelogUrl: Optional[AnyUrl] = None - connectionSpecification: Dict[str, Any] = Field( - ..., - description="ConnectorDefinition specific blob. Must be a valid JSON string.", + +class OAuthConfigSpecification(BaseModel): + oauth_user_input_from_connector_config_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth.\nMust be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification\nusing special annotation 'path_in_connector_config'.\nThese are input values the user is entering through the UI to authenticate to the connector, that might also shared\nas inputs for syncing data via the connector.\n\nExamples:\n\nif no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[]\nif connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['app_id']\n }\n }\nif connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow,\n oauth_user_input_from_connector_config_specification={\n app_id: {\n type: string\n path_in_connector_config: ['info', 'app_id']\n }\n }", ) - supportsIncremental: Optional[bool] = Field(None, description="If the connector supports incremental mode or not.") - supportsNormalization: Optional[bool] = Field(False, description="If the connector supports normalization or not.") - supportsDBT: Optional[bool] = Field(False, description="If the connector supports DBT or not.") - supported_destination_sync_modes: Optional[List[DestinationSyncMode]] = Field( - None, description="List of destination sync modes supported by the connector" + complete_oauth_output_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations produced by the OAuth flows as they are\nreturned by the distant OAuth APIs.\nMust be a valid JSON describing the fields to merge back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\n\nExamples:\n\n complete_oauth_output_specification={\n refresh_token: {\n type: string,\n path_in_connector_config: ['credentials', 'refresh_token']\n }\n }", + ) + complete_oauth_server_input_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations.\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nserver when completing an OAuth flow (typically exchanging an auth code for refresh token).\n\nExamples:\n\n complete_oauth_server_input_specification={\n client_id: {\n type: string\n },\n client_secret: {\n type: string\n }\n }", + ) + complete_oauth_server_output_specification: Optional[Dict[str, Any]] = Field( + None, + description="OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations that\nalso need to be merged back into the connector configuration at runtime.\nThis is a subset configuration of `complete_oauth_server_input_specification` that filters fields out to retain only the ones that\nare necessary for the connector to function with OAuth. (some fields could be used during oauth flows but not needed afterwards, therefore\nthey would be listed in the `complete_oauth_server_input_specification` but not `complete_oauth_server_output_specification`)\nMust be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the\nconnector when using OAuth flow APIs.\nThese fields are to be merged back to `ConnectorSpecification.connectionSpecification`.\nFor each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,\n\nExamples:\n\n complete_oauth_server_output_specification={\n client_id: {\n type: string,\n path_in_connector_config: ['credentials', 'client_id']\n },\n client_secret: {\n type: string,\n path_in_connector_config: ['credentials', 'client_secret']\n }\n }", ) - authSpecification: Optional[AuthSpecification] = None class AirbyteStream(BaseModel): @@ -174,6 +179,42 @@ class Config: ) +class AdvancedAuth(BaseModel): + auth_flow_type: Optional[AuthFlowType] = None + predicate_key: Optional[List[str]] = Field( + None, + description="Json Path to a field in the connectorSpecification that should exist for the advanced auth to be applicable.", + ) + predicate_value: Optional[str] = Field( + None, + description="Value of the predicate_key fields for the advanced auth to be applicable.", + ) + oauth_config_specification: Optional[OAuthConfigSpecification] = None + + +class ConnectorSpecification(BaseModel): + class Config: + extra = Extra.allow + + documentationUrl: Optional[AnyUrl] = None + changelogUrl: Optional[AnyUrl] = None + connectionSpecification: Dict[str, Any] = Field( + ..., + description="ConnectorDefinition specific blob. Must be a valid JSON string.", + ) + supportsIncremental: Optional[bool] = Field(None, description="If the connector supports incremental mode or not.") + supportsNormalization: Optional[bool] = Field(False, description="If the connector supports normalization or not.") + supportsDBT: Optional[bool] = Field(False, description="If the connector supports DBT or not.") + supported_destination_sync_modes: Optional[List[DestinationSyncMode]] = Field( + None, description="List of destination sync modes supported by the connector" + ) + authSpecification: Optional[AuthSpecification] = Field(None, description="deprecated, switching to advanced_auth instead") + advanced_auth: Optional[AdvancedAuth] = Field( + None, + description="Additional and optional specification object to describe what an 'advanced' Auth flow would need to function.\n - A connector should be able to fully function with the configuration as described by the ConnectorSpecification in a 'basic' mode.\n - The 'advanced' mode provides easier UX for the user with UI improvements and automations. However, this requires further setup on the\n server side by instance or workspace admins beforehand. The trade-off is that the user does not have to provide as many technical\n inputs anymore and the auth process is faster and easier to complete.", + ) + + class AirbyteCatalog(BaseModel): class Config: extra = Extra.allow diff --git a/airbyte-protocol/models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml b/airbyte-protocol/models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml index e621be83553c..e3146e26b6e8 100644 --- a/airbyte-protocol/models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml +++ b/airbyte-protocol/models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml @@ -209,7 +209,7 @@ definitions: #- upsert_dedup # TODO chris: SCD Type 1 can be implemented later - append_dedup # SCD Type 1 & 2 OAuth2Specification: - description: An object containing any metadata needed to describe this connector's Oauth flow + description: An object containing any metadata needed to describe this connector's Oauth flow. Deprecated, switching to advanced_auth instead type: object additionalProperties: true properties: @@ -297,6 +297,7 @@ definitions: items: "$ref": "#/definitions/DestinationSyncMode" authSpecification: + description: deprecated, switching to advanced_auth instead type: object properties: auth_type: @@ -305,3 +306,116 @@ definitions: oauth2Specification: description: If the connector supports OAuth, this field should be non-null. "$ref": "#/definitions/OAuth2Specification" + advanced_auth: + description: |- + Additional and optional specification object to describe what an 'advanced' Auth flow would need to function. + - A connector should be able to fully function with the configuration as described by the ConnectorSpecification in a 'basic' mode. + - The 'advanced' mode provides easier UX for the user with UI improvements and automations. However, this requires further setup on the + server side by instance or workspace admins beforehand. The trade-off is that the user does not have to provide as many technical + inputs anymore and the auth process is faster and easier to complete. + type: object + properties: + auth_flow_type: + type: string + enum: ["oauth2.0", "oauth1.0"] # Future auth types should be added here + predicate_key: + description: Json Path to a field in the connectorSpecification that should exist for the advanced auth to be applicable. + type: array + items: + type: string + predicate_value: + description: Value of the predicate_key fields for the advanced auth to be applicable. + type: string + oauth_config_specification: + "$ref": "#/definitions/OAuthConfigSpecification" + OAuthConfigSpecification: + type: object + properties: + oauth_user_input_from_connector_config_specification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations used as input to OAuth. + Must be a valid non-nested JSON that refers to properties from ConnectorSpecification.connectionSpecification + using special annotation 'path_in_connector_config'. + These are input values the user is entering through the UI to authenticate to the connector, that might also shared + as inputs for syncing data via the connector. + + Examples: + + if no connector values is shared during oauth flow, oauth_user_input_from_connector_config_specification=[] + if connector values such as 'app_id' inside the top level are used to generate the API url for the oauth flow, + oauth_user_input_from_connector_config_specification={ + app_id: { + type: string + path_in_connector_config: ['app_id'] + } + } + if connector values such as 'info.app_id' nested inside another object are used to generate the API url for the oauth flow, + oauth_user_input_from_connector_config_specification={ + app_id: { + type: string + path_in_connector_config: ['info', 'app_id'] + } + } + type: object + existingJavaType: com.fasterxml.jackson.databind.JsonNode + complete_oauth_output_specification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations produced by the OAuth flows as they are + returned by the distant OAuth APIs. + Must be a valid JSON describing the fields to merge back to `ConnectorSpecification.connectionSpecification`. + For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it, + + Examples: + + complete_oauth_output_specification={ + refresh_token: { + type: string, + path_in_connector_config: ['credentials', 'refresh_token'] + } + } + type: object + existingJavaType: com.fasterxml.jackson.databind.JsonNode + complete_oauth_server_input_specification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations. + Must be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the + server when completing an OAuth flow (typically exchanging an auth code for refresh token). + + Examples: + + complete_oauth_server_input_specification={ + client_id: { + type: string + }, + client_secret: { + type: string + } + } + type: object + existingJavaType: com.fasterxml.jackson.databind.JsonNode + complete_oauth_server_output_specification: + description: |- + OAuth specific blob. This is a Json Schema used to validate Json configurations persisted as Airbyte Server configurations that + also need to be merged back into the connector configuration at runtime. + This is a subset configuration of `complete_oauth_server_input_specification` that filters fields out to retain only the ones that + are necessary for the connector to function with OAuth. (some fields could be used during oauth flows but not needed afterwards, therefore + they would be listed in the `complete_oauth_server_input_specification` but not `complete_oauth_server_output_specification`) + Must be a valid non-nested JSON describing additional fields configured by the Airbyte Instance or Workspace Admins to be used by the + connector when using OAuth flow APIs. + These fields are to be merged back to `ConnectorSpecification.connectionSpecification`. + For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it, + + Examples: + + complete_oauth_server_output_specification={ + client_id: { + type: string, + path_in_connector_config: ['credentials', 'client_id'] + }, + client_secret: { + type: string, + path_in_connector_config: ['credentials', 'client_secret'] + } + } + type: object + existingJavaType: com.fasterxml.jackson.databind.JsonNode diff --git a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java index 2820c89b7704..f49ebfea1387 100644 --- a/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java +++ b/airbyte-server/src/main/java/io/airbyte/server/apis/ConfigurationApi.java @@ -164,7 +164,7 @@ public ConfigurationApi(final ConfigRepository configRepository, final String webappUrl, final AirbyteVersion airbyteVersion, final Path workspaceRoot, - HttpClient httpClient) { + final HttpClient httpClient) { this.workerEnvironment = workerEnvironment; this.logConfigs = logConfigs; this.workspaceRoot = workspaceRoot; diff --git a/docs/reference/api/generated-api-html/index.html b/docs/reference/api/generated-api-html/index.html index a43ac05add71..3a93ccfe5b88 100644 --- a/docs/reference/api/generated-api-html/index.html +++ b/docs/reference/api/generated-api-html/index.html @@ -2530,6 +2530,12 @@
AdvancedAuth
- AirbyteCatalog
- AirbyteStream
- AirbyteStreamAndConfiguration
- NotificationRead
- NotificationType
- OAuth2Specification
- OAuthConfigSpecification
- OAuthConsentRead
- OperationCreate
- OperationIdRequestBody
- WorkspaceUpdate
- AdvancedAuth
- UpAirbyteCatalog
- UpCompleteDestinationOAuthRequ
workspaceId UUID format: uuid
redirectUrl (optional)String When completing OAuth flow to gain an access token, some API sometimes requires to verify that the app re-send the redirectUrl that was used when consent was given.
queryParams (optional)map[String, Object] The query parameters present in the redirect URL after a user granted consent e.g auth code
+oAuthInputConfiguration (optional)
CompleteSourceOauthRequest
DestinationDefinition
documentationUrl (optional)
connectionSpecification (optional)
authSpecification (optional)
+advancedAuth (optional)
jobInfo
supportedDestinationSyncModes (optional)
supportsDbt (optional)
@@ -7058,6 +7087,7 @@ DestinationOauthConsentReques
destinationDefinitionId UUID format: uuid
workspaceId UUID format: uuid
redirectUrl String The url to redirect to after getting the user consent
+oAuthInputConfiguration (optional)
OAuth2Specification
- oauthFlowOutputParameters OAuthConfigSpecification
- UpOAuthConsentRead
- UpSourceDefinitionSpecificat
documentationUrl (optional)
connectionSpecification (optional)
authSpecification (optional)
+advancedAuth (optional)
jobInfo
SourceOauthConsentRequest
-