Skip to content

Commit 216cd43

Browse files
author
Baz
authored
fix: (Low-Code) (DeclarativeOAuthFlow) - fix tooltip examples and labels representation to show values instead of full object (#172)
1 parent ceebfda commit 216cd43

File tree

2 files changed

+60
-78
lines changed

2 files changed

+60
-78
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,65 +2130,61 @@ definitions:
21302130
- extract_output
21312131
properties:
21322132
consent_url:
2133-
title: DeclarativeOAuth Consent URL
2133+
title: Consent URL
21342134
type: string
21352135
description: |-
21362136
The DeclarativeOAuth Specific string URL string template to initiate the authentication.
21372137
The placeholders are replaced during the processing to provide neccessary values.
21382138
examples:
2139-
- 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}}
2140-
- 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}
2139+
- https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}
2140+
- 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}
21412141
scope:
2142-
title: (Optional) DeclarativeOAuth Scope
2142+
title: Scopes
21432143
type: string
21442144
description: |-
21452145
The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.
21462146
examples:
2147-
- scope: user:read user:read_orders workspaces:read
2147+
- user:read user:read_orders workspaces:read
21482148
access_token_url:
2149-
title: DeclarativeOAuth Access Token URL
2149+
title: Access Token URL
21502150
type: string
21512151
description: |-
21522152
The DeclarativeOAuth Specific URL templated string to obtain the `access_token`, `refresh_token` etc.
21532153
The placeholders are replaced during the processing to provide neccessary values.
21542154
examples:
2155-
- 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}}}
2155+
- 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}}}
21562156
access_token_headers:
2157-
title: (Optional) DeclarativeOAuth Access Token Headers
2157+
title: Access Token Headers
21582158
type: object
21592159
additionalProperties: true
21602160
description: |-
21612161
The DeclarativeOAuth Specific optional headers to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.
21622162
examples:
2163-
- access_token_headers:
2164-
{
2165-
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}",
2166-
}
2163+
- {"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"}
21672164
access_token_params:
2168-
title: (Optional) DeclarativeOAuth Access Token Query Params (Json Encoded)
2165+
title: Access Token Query Params (Json Encoded)
21692166
type: object
21702167
additionalProperties: true
21712168
description: |-
21722169
The DeclarativeOAuth Specific optional query parameters to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.
21732170
When this property is provided, the query params will be encoded as `Json` and included in the outgoing API request.
21742171
examples:
2175-
- access_token_params:
2176-
{
2177-
"{auth_code_key}": "{{auth_code_key}}",
2178-
"{client_id_key}": "{{client_id_key}}",
2179-
"{client_secret_key}": "{{client_secret_key}}",
2180-
}
2172+
- {
2173+
"{auth_code_key}": "{{auth_code_key}}",
2174+
"{client_id_key}": "{{client_id_key}}",
2175+
"{client_secret_key}": "{{client_secret_key}}",
2176+
}
21812177
extract_output:
2182-
title: DeclarativeOAuth Extract Output
2178+
title: Extract Output
21832179
type: array
21842180
items:
21852181
type: string
21862182
description: |-
21872183
The DeclarativeOAuth Specific list of strings to indicate which keys should be extracted and returned back to the input config.
21882184
examples:
2189-
- extract_output: ["access_token", "refresh_token", "other_field"]
2185+
- ["access_token", "refresh_token", "other_field"]
21902186
state:
2191-
title: (Optional) DeclarativeOAuth Configurable State Query Param
2187+
title: Configurable State Query Param
21922188
type: object
21932189
additionalProperties: true
21942190
required:
@@ -2203,49 +2199,49 @@ definitions:
22032199
max:
22042200
type: integer
22052201
examples:
2206-
- state: { "min": 7, "max": 128 }
2202+
- { "min": 7, "max": 128 }
22072203
client_id_key:
2208-
title: (Optional) DeclarativeOAuth Client ID Key Override
2204+
title: Client ID Key Override
22092205
type: string
22102206
description: |-
22112207
The DeclarativeOAuth Specific optional override to provide the custom `client_id` key name, if required by data-provider.
22122208
examples:
2213-
- client_id_key: "my_custom_client_id_key_name"
2209+
- "my_custom_client_id_key_name"
22142210
client_secret_key:
2215-
title: (Optional) DeclarativeOAuth Client Secret Key Override
2211+
title: Client Secret Key Override
22162212
type: string
22172213
description: |-
22182214
The DeclarativeOAuth Specific optional override to provide the custom `client_secret` key name, if required by data-provider.
22192215
examples:
2220-
- client_secret_key: "my_custom_client_secret_key_name"
2216+
- "my_custom_client_secret_key_name"
22212217
scope_key:
2222-
title: (Optional) DeclarativeOAuth Scope Key Override
2218+
title: Scopes Key Override
22232219
type: string
22242220
description: |-
22252221
The DeclarativeOAuth Specific optional override to provide the custom `scope` key name, if required by data-provider.
22262222
examples:
2227-
- scope_key: "my_custom_scope_key_key_name"
2223+
- "my_custom_scope_key_key_name"
22282224
state_key:
2229-
title: (Optional) DeclarativeOAuth State Key Override
2225+
title: State Key Override
22302226
type: string
22312227
description: |-
22322228
The DeclarativeOAuth Specific optional override to provide the custom `state` key name, if required by data-provider.
22332229
examples:
2234-
- state_key: "my_custom_state_key_key_name"
2230+
- "my_custom_state_key_key_name"
22352231
auth_code_key:
2236-
title: (Optional) DeclarativeOAuth Auth Code Key Override
2232+
title: Auth Code Key Override
22372233
type: string
22382234
description: |-
22392235
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.
22402236
examples:
2241-
- auth_code_key: "my_custom_auth_code_key_name"
2237+
- "my_custom_auth_code_key_name"
22422238
redirect_uri_key:
2243-
title: (Optional) DeclarativeOAuth Redirect URI Key Override
2239+
title: Redirect URI Key Override
22442240
type: string
22452241
description: |-
22462242
The DeclarativeOAuth Specific optional override to provide the custom `redirect_uri` key name to something like `callback_uri`, if required by data-provider.
22472243
examples:
2248-
- redirect_uri_key: "my_custom_redirect_uri_key_name"
2244+
- "my_custom_redirect_uri_key_name"
22492245
complete_oauth_output_specification:
22502246
title: "OAuth output specification"
22512247
description: |-

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 29 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -795,104 +795,90 @@ class Config:
795795
...,
796796
description="The DeclarativeOAuth Specific string URL string template to initiate the authentication.\nThe placeholders are replaced during the processing to provide neccessary values.",
797797
examples=[
798-
{
799-
"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}}"
800-
},
801-
{
802-
"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}"
803-
},
798+
"https://domain.host.com/marketing_api/auth?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{state_key}={{state_key}}",
799+
"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}",
804800
],
805-
title="DeclarativeOAuth Consent URL",
801+
title="Consent URL",
806802
)
807803
scope: Optional[str] = Field(
808804
None,
809805
description="The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.",
810-
examples=[{"scope": "user:read user:read_orders workspaces:read"}],
811-
title="(Optional) DeclarativeOAuth Scope",
806+
examples=["user:read user:read_orders workspaces:read"],
807+
title="Scopes",
812808
)
813809
access_token_url: str = Field(
814810
...,
815811
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.",
816812
examples=[
817-
{
818-
"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}}}"
819-
}
813+
"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}}}"
820814
],
821-
title="DeclarativeOAuth Access Token URL",
815+
title="Access Token URL",
822816
)
823817
access_token_headers: Optional[Dict[str, Any]] = Field(
824818
None,
825819
description="The DeclarativeOAuth Specific optional headers to inject while exchanging the `auth_code` to `access_token` during `completeOAuthFlow` step.",
826-
examples=[
827-
{
828-
"access_token_headers": {
829-
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"
830-
}
831-
}
832-
],
833-
title="(Optional) DeclarativeOAuth Access Token Headers",
820+
examples=[{"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"}],
821+
title="Access Token Headers",
834822
)
835823
access_token_params: Optional[Dict[str, Any]] = Field(
836824
None,
837825
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.",
838826
examples=[
839827
{
840-
"access_token_params": {
841-
"{auth_code_key}": "{{auth_code_key}}",
842-
"{client_id_key}": "{{client_id_key}}",
843-
"{client_secret_key}": "{{client_secret_key}}",
844-
}
828+
"{auth_code_key}": "{{auth_code_key}}",
829+
"{client_id_key}": "{{client_id_key}}",
830+
"{client_secret_key}": "{{client_secret_key}}",
845831
}
846832
],
847-
title="(Optional) DeclarativeOAuth Access Token Query Params (Json Encoded)",
833+
title="Access Token Query Params (Json Encoded)",
848834
)
849835
extract_output: List[str] = Field(
850836
...,
851837
description="The DeclarativeOAuth Specific list of strings to indicate which keys should be extracted and returned back to the input config.",
852-
examples=[{"extract_output": ["access_token", "refresh_token", "other_field"]}],
853-
title="DeclarativeOAuth Extract Output",
838+
examples=[["access_token", "refresh_token", "other_field"]],
839+
title="Extract Output",
854840
)
855841
state: Optional[State] = Field(
856842
None,
857843
description="The DeclarativeOAuth Specific object to provide the criteria of how the `state` query param should be constructed,\nincluding length and complexity.",
858-
examples=[{"state": {"min": 7, "max": 128}}],
859-
title="(Optional) DeclarativeOAuth Configurable State Query Param",
844+
examples=[{"min": 7, "max": 128}],
845+
title="Configurable State Query Param",
860846
)
861847
client_id_key: Optional[str] = Field(
862848
None,
863849
description="The DeclarativeOAuth Specific optional override to provide the custom `client_id` key name, if required by data-provider.",
864-
examples=[{"client_id_key": "my_custom_client_id_key_name"}],
865-
title="(Optional) DeclarativeOAuth Client ID Key Override",
850+
examples=["my_custom_client_id_key_name"],
851+
title="Client ID Key Override",
866852
)
867853
client_secret_key: Optional[str] = Field(
868854
None,
869855
description="The DeclarativeOAuth Specific optional override to provide the custom `client_secret` key name, if required by data-provider.",
870-
examples=[{"client_secret_key": "my_custom_client_secret_key_name"}],
871-
title="(Optional) DeclarativeOAuth Client Secret Key Override",
856+
examples=["my_custom_client_secret_key_name"],
857+
title="Client Secret Key Override",
872858
)
873859
scope_key: Optional[str] = Field(
874860
None,
875861
description="The DeclarativeOAuth Specific optional override to provide the custom `scope` key name, if required by data-provider.",
876-
examples=[{"scope_key": "my_custom_scope_key_key_name"}],
877-
title="(Optional) DeclarativeOAuth Scope Key Override",
862+
examples=["my_custom_scope_key_key_name"],
863+
title="Scopes Key Override",
878864
)
879865
state_key: Optional[str] = Field(
880866
None,
881867
description="The DeclarativeOAuth Specific optional override to provide the custom `state` key name, if required by data-provider.",
882-
examples=[{"state_key": "my_custom_state_key_key_name"}],
883-
title="(Optional) DeclarativeOAuth State Key Override",
868+
examples=["my_custom_state_key_key_name"],
869+
title="State Key Override",
884870
)
885871
auth_code_key: Optional[str] = Field(
886872
None,
887873
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.",
888-
examples=[{"auth_code_key": "my_custom_auth_code_key_name"}],
889-
title="(Optional) DeclarativeOAuth Auth Code Key Override",
874+
examples=["my_custom_auth_code_key_name"],
875+
title="Auth Code Key Override",
890876
)
891877
redirect_uri_key: Optional[str] = Field(
892878
None,
893879
description="The DeclarativeOAuth Specific optional override to provide the custom `redirect_uri` key name to something like `callback_uri`, if required by data-provider.",
894-
examples=[{"redirect_uri_key": "my_custom_redirect_uri_key_name"}],
895-
title="(Optional) DeclarativeOAuth Redirect URI Key Override",
880+
examples=["my_custom_redirect_uri_key_name"],
881+
title="Redirect URI Key Override",
896882
)
897883

898884

0 commit comments

Comments
 (0)