Skip to content

Commit

Permalink
fix: (Low-Code) (DeclarativeOAuthFlow) - fix tooltip examples and `…
Browse files Browse the repository at this point in the history
…labels` representation to show values instead of full object (#172)
  • Loading branch information
bazarnov authored Dec 13, 2024
1 parent ceebfda commit 216cd43
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 78 deletions.
66 changes: 31 additions & 35 deletions airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2130,65 +2130,61 @@ definitions:
- extract_output
properties:
consent_url:
title: DeclarativeOAuth Consent URL
title: Consent URL
type: string
description: |-
The DeclarativeOAuth Specific string URL string template to initiate the authentication.
The placeholders are replaced during the processing to provide neccessary values.
examples:
- consent_url: https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}
- consent_url: https://endpoint.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}
- https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}
- https://endpoint.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}
scope:
title: (Optional) DeclarativeOAuth Scope
title: Scopes
type: string
description: |-
The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.
examples:
- scope: user:read user:read_orders workspaces:read
- user:read user:read_orders workspaces:read
access_token_url:
title: DeclarativeOAuth Access Token URL
title: Access Token URL
type: string
description: |-
The DeclarativeOAuth Specific URL templated string to obtain the `access_token`, `refresh_token` etc.
The placeholders are replaced during the processing to provide neccessary values.
examples:
- access_token_url: https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}
- https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}
access_token_headers:
title: (Optional) DeclarativeOAuth Access Token Headers
title: Access Token Headers
type: object
additionalProperties: true
description: |-
The DeclarativeOAuth Specific optional headers to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.
examples:
- access_token_headers:
{
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}",
}
- {"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"}
access_token_params:
title: (Optional) DeclarativeOAuth Access Token Query Params (Json Encoded)
title: Access Token Query Params (Json Encoded)
type: object
additionalProperties: true
description: |-
The DeclarativeOAuth Specific optional query parameters to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.
When this property is provided, the query params will be encoded as `Json` and included in the outgoing API request.
examples:
- access_token_params:
{
"{auth_code_key}": "{{auth_code_key}}",
"{client_id_key}": "{{client_id_key}}",
"{client_secret_key}": "{{client_secret_key}}",
}
- {
"{auth_code_key}": "{{auth_code_key}}",
"{client_id_key}": "{{client_id_key}}",
"{client_secret_key}": "{{client_secret_key}}",
}
extract_output:
title: DeclarativeOAuth Extract Output
title: Extract Output
type: array
items:
type: string
description: |-
The DeclarativeOAuth Specific list of strings to indicate which keys should be extracted and returned back to the input config.
examples:
- extract_output: ["access_token", "refresh_token", "other_field"]
- ["access_token", "refresh_token", "other_field"]
state:
title: (Optional) DeclarativeOAuth Configurable State Query Param
title: Configurable State Query Param
type: object
additionalProperties: true
required:
Expand All @@ -2203,49 +2199,49 @@ definitions:
max:
type: integer
examples:
- state: { "min": 7, "max": 128 }
- { "min": 7, "max": 128 }
client_id_key:
title: (Optional) DeclarativeOAuth Client ID Key Override
title: Client ID Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `client_id` key name, if required by data-provider.
examples:
- client_id_key: "my_custom_client_id_key_name"
- "my_custom_client_id_key_name"
client_secret_key:
title: (Optional) DeclarativeOAuth Client Secret Key Override
title: Client Secret Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `client_secret` key name, if required by data-provider.
examples:
- client_secret_key: "my_custom_client_secret_key_name"
- "my_custom_client_secret_key_name"
scope_key:
title: (Optional) DeclarativeOAuth Scope Key Override
title: Scopes Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `scope` key name, if required by data-provider.
examples:
- scope_key: "my_custom_scope_key_key_name"
- "my_custom_scope_key_key_name"
state_key:
title: (Optional) DeclarativeOAuth State Key Override
title: State Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `state` key name, if required by data-provider.
examples:
- state_key: "my_custom_state_key_key_name"
- "my_custom_state_key_key_name"
auth_code_key:
title: (Optional) DeclarativeOAuth Auth Code Key Override
title: Auth Code Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `code` key name to something like `auth_code` or `custom_auth_code`, if required by data-provider.
examples:
- auth_code_key: "my_custom_auth_code_key_name"
- "my_custom_auth_code_key_name"
redirect_uri_key:
title: (Optional) DeclarativeOAuth Redirect URI Key Override
title: Redirect URI Key Override
type: string
description: |-
The DeclarativeOAuth Specific optional override to provide the custom `redirect_uri` key name to something like `callback_uri`, if required by data-provider.
examples:
- redirect_uri_key: "my_custom_redirect_uri_key_name"
- "my_custom_redirect_uri_key_name"
complete_oauth_output_specification:
title: "OAuth output specification"
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,104 +795,90 @@ class Config:
...,
description="The DeclarativeOAuth Specific string URL string template to initiate the authentication.\nThe placeholders are replaced during the processing to provide neccessary values.",
examples=[
{
"consent_url": "https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}"
},
{
"consent_url": "https://endpoint.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}"
},
"https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}",
"https://endpoint.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}",
],
title="DeclarativeOAuth Consent URL",
title="Consent URL",
)
scope: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.",
examples=[{"scope": "user:read user:read_orders workspaces:read"}],
title="(Optional) DeclarativeOAuth Scope",
examples=["user:read user:read_orders workspaces:read"],
title="Scopes",
)
access_token_url: str = Field(
...,
description="The DeclarativeOAuth Specific URL templated string to obtain the `access_token`, `refresh_token` etc.\nThe placeholders are replaced during the processing to provide neccessary values.",
examples=[
{
"access_token_url": "https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}"
}
"https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}"
],
title="DeclarativeOAuth Access Token URL",
title="Access Token URL",
)
access_token_headers: Optional[Dict[str, Any]] = Field(
None,
description="The DeclarativeOAuth Specific optional headers to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.",
examples=[
{
"access_token_headers": {
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"
}
}
],
title="(Optional) DeclarativeOAuth Access Token Headers",
examples=[{"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"}],
title="Access Token Headers",
)
access_token_params: Optional[Dict[str, Any]] = Field(
None,
description="The DeclarativeOAuth Specific optional query parameters to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.\nWhen this property is provided, the query params will be encoded as `Json` and included in the outgoing API request.",
examples=[
{
"access_token_params": {
"{auth_code_key}": "{{auth_code_key}}",
"{client_id_key}": "{{client_id_key}}",
"{client_secret_key}": "{{client_secret_key}}",
}
"{auth_code_key}": "{{auth_code_key}}",
"{client_id_key}": "{{client_id_key}}",
"{client_secret_key}": "{{client_secret_key}}",
}
],
title="(Optional) DeclarativeOAuth Access Token Query Params (Json Encoded)",
title="Access Token Query Params (Json Encoded)",
)
extract_output: List[str] = Field(
...,
description="The DeclarativeOAuth Specific list of strings to indicate which keys should be extracted and returned back to the input config.",
examples=[{"extract_output": ["access_token", "refresh_token", "other_field"]}],
title="DeclarativeOAuth Extract Output",
examples=[["access_token", "refresh_token", "other_field"]],
title="Extract Output",
)
state: Optional[State] = Field(
None,
description="The DeclarativeOAuth Specific object to provide the criteria of how the `state` query param should be constructed,\nincluding length and complexity.",
examples=[{"state": {"min": 7, "max": 128}}],
title="(Optional) DeclarativeOAuth Configurable State Query Param",
examples=[{"min": 7, "max": 128}],
title="Configurable State Query Param",
)
client_id_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `client_id` key name, if required by data-provider.",
examples=[{"client_id_key": "my_custom_client_id_key_name"}],
title="(Optional) DeclarativeOAuth Client ID Key Override",
examples=["my_custom_client_id_key_name"],
title="Client ID Key Override",
)
client_secret_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `client_secret` key name, if required by data-provider.",
examples=[{"client_secret_key": "my_custom_client_secret_key_name"}],
title="(Optional) DeclarativeOAuth Client Secret Key Override",
examples=["my_custom_client_secret_key_name"],
title="Client Secret Key Override",
)
scope_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `scope` key name, if required by data-provider.",
examples=[{"scope_key": "my_custom_scope_key_key_name"}],
title="(Optional) DeclarativeOAuth Scope Key Override",
examples=["my_custom_scope_key_key_name"],
title="Scopes Key Override",
)
state_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `state` key name, if required by data-provider.",
examples=[{"state_key": "my_custom_state_key_key_name"}],
title="(Optional) DeclarativeOAuth State Key Override",
examples=["my_custom_state_key_key_name"],
title="State Key Override",
)
auth_code_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `code` key name to something like `auth_code` or `custom_auth_code`, if required by data-provider.",
examples=[{"auth_code_key": "my_custom_auth_code_key_name"}],
title="(Optional) DeclarativeOAuth Auth Code Key Override",
examples=["my_custom_auth_code_key_name"],
title="Auth Code Key Override",
)
redirect_uri_key: Optional[str] = Field(
None,
description="The DeclarativeOAuth Specific optional override to provide the custom `redirect_uri` key name to something like `callback_uri`, if required by data-provider.",
examples=[{"redirect_uri_key": "my_custom_redirect_uri_key_name"}],
title="(Optional) DeclarativeOAuth Redirect URI Key Override",
examples=["my_custom_redirect_uri_key_name"],
title="Redirect URI Key Override",
)


Expand Down

0 comments on commit 216cd43

Please sign in to comment.