Skip to content

Commit f15dbd7

Browse files
aldogonzalez8claude
andcommitted
feat: add scopes array, optional_scopes, and scopes_join_strategy to declarative OAuth spec
Adds structured scopes support to oauth_connector_input_specification: - scopes: array of strings, takes precedence over scope string - optional_scopes: array of optional scopes - scopes_join_strategy: enum (space/comma/plus), defaults to space per RFC 6749 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7f41401 commit f15dbd7

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,6 +3064,39 @@ definitions:
30643064
The DeclarativeOAuth Specific string of the scopes needed to be grant for authenticated user.
30653065
examples:
30663066
- user:read user:read_orders workspaces:read
3067+
scopes:
3068+
title: Scopes
3069+
type: array
3070+
items:
3071+
type: string
3072+
description: |-
3073+
The DeclarativeOAuth Specific list of scopes needed to be granted for the authenticated user.
3074+
When present, takes precedence over the `scope` string property.
3075+
The scopes are joined using the `scopes_join_strategy` (default: space) before being
3076+
sent to the OAuth provider.
3077+
examples:
3078+
- ["user:read", "user:write"]
3079+
optional_scopes:
3080+
title: Optional Scopes
3081+
type: array
3082+
items:
3083+
type: string
3084+
description: |-
3085+
The DeclarativeOAuth Specific list of optional scopes to request from the OAuth provider.
3086+
These scopes may or may not be granted depending on the provider and user consent.
3087+
examples:
3088+
- ["admin:read"]
3089+
scopes_join_strategy:
3090+
title: Scopes Join Strategy
3091+
type: string
3092+
enum:
3093+
- space
3094+
- comma
3095+
- plus
3096+
default: space
3097+
description: |-
3098+
The strategy used to join the `scopes` array into a single string for the OAuth request.
3099+
Defaults to `space` per RFC 6749.
30673100
access_token_url:
30683101
title: Access Token URL
30693102
type: string

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ class AuthFlowType(Enum):
2020
oauth1_0 = "oauth1.0"
2121

2222

23+
class ScopesJoinStrategy(Enum):
24+
space = "space"
25+
comma = "comma"
26+
plus = "plus"
27+
28+
2329
class BasicHttpAuthenticator(BaseModel):
2430
type: Literal["BasicHttpAuthenticator"]
2531
username: str = Field(
@@ -846,6 +852,23 @@ class Config:
846852
examples=["user:read user:read_orders workspaces:read"],
847853
title="Scopes",
848854
)
855+
scopes: Optional[List[str]] = Field(
856+
None,
857+
description="The DeclarativeOAuth Specific list of scopes needed to be granted for the authenticated user.\nWhen present, takes precedence over the `scope` string property.\nThe scopes are joined using the `scopes_join_strategy` (default: space) before being\nsent to the OAuth provider.",
858+
examples=[["user:read", "user:write"]],
859+
title="Scopes",
860+
)
861+
optional_scopes: Optional[List[str]] = Field(
862+
None,
863+
description="The DeclarativeOAuth Specific list of optional scopes to request from the OAuth provider.\nThese scopes may or may not be granted depending on the provider and user consent.",
864+
examples=[["admin:read"]],
865+
title="Optional Scopes",
866+
)
867+
scopes_join_strategy: Optional[ScopesJoinStrategy] = Field(
868+
ScopesJoinStrategy.space,
869+
description="The strategy used to join the `scopes` array into a single string for the OAuth request.\nDefaults to `space` per RFC 6749.",
870+
title="Scopes Join Strategy",
871+
)
849872
access_token_url: str = Field(
850873
...,
851874
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.",

0 commit comments

Comments
 (0)