Skip to content
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

Add auth config to oauth api #7798

Merged
merged 8 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airbyte-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ task generateApiServer(type: GenerateTask) {
modelPackage = "io.airbyte.api.model"

importMappings = [
'AuthInputConfiguration' : 'com.fasterxml.jackson.databind.JsonNode',
'SourceDefinitionSpecification' : 'com.fasterxml.jackson.databind.JsonNode',
'SourceConfiguration' : 'com.fasterxml.jackson.databind.JsonNode',
'DestinationDefinitionSpecification': 'com.fasterxml.jackson.databind.JsonNode',
Expand Down
16 changes: 13 additions & 3 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteOauthResponse"
$ref: "#/components/schemas/CompleteOAuthResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
Expand Down Expand Up @@ -1357,7 +1357,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/CompleteOauthResponse"
$ref: "#/components/schemas/CompleteOAuthResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"422":
Expand Down Expand Up @@ -3227,6 +3227,8 @@ components:
items:
$ref: "#/components/schemas/DbMigrationRead"
# OAuth
AuthInputConfiguration:
ChristopheDuong marked this conversation as resolved.
Show resolved Hide resolved
description: The values required to configure OAuth flows. The schema for this must match the authSpecification schema.
SourceOauthConsentRequest:
type: object
required:
Expand All @@ -3241,6 +3243,8 @@ components:
redirectUrl:
description: The url to redirect to after getting the user consent
type: string
authInputConfiguration:
$ref: "#/components/schemas/AuthInputConfiguration"
DestinationOauthConsentRequest:
type: object
required:
Expand All @@ -3255,6 +3259,8 @@ components:
redirectUrl:
description: The url to redirect to after getting the user consent
type: string
authInputConfiguration:
$ref: "#/components/schemas/AuthInputConfiguration"
OAuthConsentRead:
type: object
required:
Expand All @@ -3279,6 +3285,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
authInputConfiguration:
$ref: "#/components/schemas/AuthInputConfiguration"
CompleteDestinationOAuthRequest:
type: object
required:
Expand All @@ -3296,7 +3304,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:
authInputConfiguration:
$ref: "#/components/schemas/AuthInputConfiguration"
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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions docs/reference/api/generated-api-html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6802,6 +6802,7 @@ <h3><a name="CompleteDestinationOAuthRequest"><code>CompleteDestinationOAuthRequ
<div class="param">workspaceId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">redirectUrl (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> 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. </div>
<div class="param">queryParams (optional)</div><div class="param-desc"><span class="param-type"><a href="#object">map[String, Object]</a></span> The query parameters present in the redirect URL after a user granted consent e.g auth code </div>
<div class="param">authInputConfiguration (optional)</div><div class="param-desc"><span class="param-type"><a href="#">oas_any_type_not_mapped</a></span> The values required to configure OAuth flows. The schema for this must match the authSpecification schema. </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand All @@ -6812,6 +6813,7 @@ <h3><a name="CompleteSourceOauthRequest"><code>CompleteSourceOauthRequest</code>
<div class="param">workspaceId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">redirectUrl (optional)</div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> 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. </div>
<div class="param">queryParams (optional)</div><div class="param-desc"><span class="param-type"><a href="#object">map[String, Object]</a></span> The query parameters present in the redirect URL after a user granted consent e.g auth code </div>
<div class="param">authInputConfiguration (optional)</div><div class="param-desc"><span class="param-type"><a href="#">oas_any_type_not_mapped</a></span> The values required to configure OAuth flows. The schema for this must match the authSpecification schema. </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down Expand Up @@ -7058,6 +7060,7 @@ <h3><a name="DestinationOauthConsentRequest"><code>DestinationOauthConsentReques
<div class="param">destinationDefinitionId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">workspaceId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">redirectUrl </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The url to redirect to after getting the user consent </div>
<div class="param">authInputConfiguration (optional)</div><div class="param-desc"><span class="param-type"><a href="#">oas_any_type_not_mapped</a></span> The values required to configure OAuth flows. The schema for this must match the authSpecification schema. </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down Expand Up @@ -7526,6 +7529,7 @@ <h3><a name="SourceOauthConsentRequest"><code>SourceOauthConsentRequest</code> -
<div class="param">sourceDefinitionId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">workspaceId </div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">redirectUrl </div><div class="param-desc"><span class="param-type"><a href="#string">String</a></span> The url to redirect to after getting the user consent </div>
<div class="param">authInputConfiguration (optional)</div><div class="param-desc"><span class="param-type"><a href="#">oas_any_type_not_mapped</a></span> The values required to configure OAuth flows. The schema for this must match the authSpecification schema. </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down