Skip to content

Commit 312f2e1

Browse files
authored
fix: add interpolation_context to auth fields (#659)
`interpolation_context` was missing from multiple auth fields that commonly need to access the `config` interpolation variable. This is a problem for the Builder UI, as `interpolation_context` is how the Builder UI knows whether it should render the JinjaInput component for a field, which offers suggestions and formatting for jinja expressions. This PR fixes the issue by adding this property to the fields that were missing it. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified that several authentication fields now explicitly support dynamic value interpolation using connector configuration. This applies to secret key fields in JWT authentication and client credentials in OAuth authentication. * Corrected example syntax for OAuth client ID and client secret fields to improve clarity. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent ff16dbf commit 312f2e1

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,8 @@ definitions:
10951095
title: Secret Key
10961096
type: string
10971097
description: Secret used to sign the JSON web token.
1098+
interpolation_context:
1099+
- config
10981100
examples:
10991101
- "{{ config['secret_key'] }}"
11001102
base64_encode_secret_key:
@@ -1224,8 +1226,10 @@ definitions:
12241226
title: Client ID
12251227
description: The OAuth client ID. Fill it in the user inputs.
12261228
type: string
1229+
interpolation_context:
1230+
- config
12271231
examples:
1228-
- "{{ config['client_id }}"
1232+
- "{{ config['client_id'] }}"
12291233
- "{{ config['credentials']['client_id }}"
12301234
client_secret_name:
12311235
title: Client Secret Property Name
@@ -1238,8 +1242,10 @@ definitions:
12381242
title: Client Secret
12391243
description: The OAuth client secret. Fill it in the user inputs.
12401244
type: string
1245+
interpolation_context:
1246+
- config
12411247
examples:
1242-
- "{{ config['client_secret }}"
1248+
- "{{ config['client_secret'] }}"
12431249
- "{{ config['credentials']['client_secret }}"
12441250
refresh_token_name:
12451251
title: Refresh Token Property Name
@@ -1252,6 +1258,8 @@ definitions:
12521258
title: Refresh Token
12531259
description: Credential artifact used to get a new access token.
12541260
type: string
1261+
interpolation_context:
1262+
- config
12551263
examples:
12561264
- "{{ config['refresh_token'] }}"
12571265
- "{{ config['credentials]['refresh_token'] }}"
@@ -1272,6 +1280,8 @@ definitions:
12721280
title: Access Token Value
12731281
description: The value of the access_token to bypass the token refreshing using `refresh_token`.
12741282
type: string
1283+
interpolation_context:
1284+
- config
12751285
examples:
12761286
- secret_access_token_value
12771287
expires_in_name:

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,10 @@ class OAuthAuthenticator(BaseModel):
523523
client_id: Optional[str] = Field(
524524
None,
525525
description="The OAuth client ID. Fill it in the user inputs.",
526-
examples=["{{ config['client_id }}", "{{ config['credentials']['client_id }}"],
526+
examples=[
527+
"{{ config['client_id'] }}",
528+
"{{ config['credentials']['client_id }}",
529+
],
527530
title="Client ID",
528531
)
529532
client_secret_name: Optional[str] = Field(
@@ -536,7 +539,7 @@ class OAuthAuthenticator(BaseModel):
536539
None,
537540
description="The OAuth client secret. Fill it in the user inputs.",
538541
examples=[
539-
"{{ config['client_secret }}",
542+
"{{ config['client_secret'] }}",
540543
"{{ config['credentials']['client_secret }}",
541544
],
542545
title="Client Secret",

0 commit comments

Comments
 (0)