Skip to content

chore: reorder inject_into in RequestOption and fix title, description, and defaults in refresh_token_updater #635

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
36 changes: 18 additions & 18 deletions airbyte_cdk/sources/declarative/declarative_component_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,8 @@ definitions:
examples:
- "%Y-%m-%d %H:%M:%S.%f+00:00"
refresh_token_updater:
title: Token Updater
description: When the token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.
title: Refresh Token Updater
description: When the refresh token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.
properties:
refresh_token_name:
title: Refresh Token Property Name
Expand All @@ -1355,7 +1355,7 @@ definitions:
type: array
items:
type: string
default: ["credentials", "access_token"]
default: ["access_token"]
examples:
- ["credentials", "access_token"]
- ["access_token"]
Expand All @@ -1365,7 +1365,7 @@ definitions:
type: array
items:
type: string
default: ["credentials", "refresh_token"]
default: ["refresh_token"]
examples:
- ["credentials", "refresh_token"]
- ["refresh_token"]
Expand All @@ -1375,7 +1375,7 @@ definitions:
type: array
items:
type: string
default: ["credentials", "token_expiry_date"]
default: ["token_expiry_date"]
examples:
- ["credentials", "token_expiry_date"]
refresh_token_error_status_codes:
Expand Down Expand Up @@ -3418,6 +3418,19 @@ definitions:
type:
type: string
enum: [RequestOption]
inject_into:
title: Inject Into
description: Configures where the descriptor should be set on the HTTP requests. Note that request parameters that are already encoded in the URL path will not be duplicated.
enum:
- request_parameter
- header
- body_data
- body_json
examples:
- request_parameter
- header
- body_data
- body_json
field_name:
title: Field Name
description: Configures which key should be used in the location that the descriptor is being injected into. We hope to eventually deprecate this field in favor of `field_path` for all request_options, but must currently maintain it for backwards compatibility in the Builder.
Expand All @@ -3438,19 +3451,6 @@ definitions:
interpolation_context:
- config
- parameters
inject_into:
title: Inject Into
description: Configures where the descriptor should be set on the HTTP requests. Note that request parameters that are already encoded in the URL path will not be duplicated.
enum:
- request_parameter
- header
- body_data
- body_json
examples:
- request_parameter
- header
- body_data
- body_json
Schemas:
title: Schemas
description: The stream schemas representing the shape of the data emitted by the stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,19 +475,19 @@ class RefreshTokenUpdater(BaseModel):
title="Refresh Token Property Name",
)
access_token_config_path: Optional[List[str]] = Field(
["credentials", "access_token"],
["access_token"],
description="Config path to the access token. Make sure the field actually exists in the config.",
examples=[["credentials", "access_token"], ["access_token"]],
title="Config Path To Access Token",
)
refresh_token_config_path: Optional[List[str]] = Field(
["credentials", "refresh_token"],
["refresh_token"],
description="Config path to the access token. Make sure the field actually exists in the config.",
examples=[["credentials", "refresh_token"], ["refresh_token"]],
title="Config Path To Refresh Token",
)
token_expiry_date_config_path: Optional[List[str]] = Field(
["credentials", "token_expiry_date"],
["token_expiry_date"],
description="Config path to the expiry date. Make sure actually exists in the config.",
examples=[["credentials", "token_expiry_date"]],
title="Config Path To Expiry Date",
Expand Down Expand Up @@ -635,8 +635,8 @@ class OAuthAuthenticator(BaseModel):
)
refresh_token_updater: Optional[RefreshTokenUpdater] = Field(
None,
description="When the token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.",
title="Token Updater",
description="When the refresh token updater is defined, new refresh tokens, access tokens and the access token expiry date are written back from the authentication response to the config object. This is important if the refresh token can only used once.",
title="Refresh Token Updater",
)
profile_assertion: Optional[JwtAuthenticator] = Field(
None,
Expand Down Expand Up @@ -1305,6 +1305,12 @@ class InjectInto(Enum):

class RequestOption(BaseModel):
type: Literal["RequestOption"]
inject_into: InjectInto = Field(
...,
description="Configures where the descriptor should be set on the HTTP requests. Note that request parameters that are already encoded in the URL path will not be duplicated.",
examples=["request_parameter", "header", "body_data", "body_json"],
title="Inject Into",
)
field_name: Optional[str] = Field(
None,
description="Configures which key should be used in the location that the descriptor is being injected into. We hope to eventually deprecate this field in favor of `field_path` for all request_options, but must currently maintain it for backwards compatibility in the Builder.",
Expand All @@ -1317,12 +1323,6 @@ class RequestOption(BaseModel):
examples=[["data", "viewer", "id"]],
title="Field Path",
)
inject_into: InjectInto = Field(
...,
description="Configures where the descriptor should be set on the HTTP requests. Note that request parameters that are already encoded in the URL path will not be duplicated.",
examples=["request_parameter", "header", "body_data", "body_json"],
title="Inject Into",
)


class Schemas(BaseModel):
Expand Down
Loading