Skip to content

Commit

Permalink
Change Airbyte Protocol for OAuth and Make protocol more permissive (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopheDuong authored Sep 29, 2021
1 parent 3a825e8 commit 960214a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
15 changes: 9 additions & 6 deletions airbyte-cdk/python/airbyte_cdk/models/airbyte_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,19 @@ class DestinationSyncMode(Enum):


class OAuth2Specification(BaseModel):
rootObject: List[str] = Field(
...,
class Config:
extra = Extra.allow

rootObject: Optional[List[str]] = Field(
None,
description="A list of strings representing a pointer to the root object which contains any oauth parameters in the ConnectorSpecification.\nExamples:\nif oauth parameters were contained inside the top level, rootObject=[] If they were nested inside another object {'credentials': {'app_id' etc...}, rootObject=['credentials'] If they were inside a oneOf {'switch': {oneOf: [{client_id...}, {non_oauth_param]}}, rootObject=['switch', 0] ",
)
oauthFlowInitParameters: List[List[str]] = Field(
...,
oauthFlowInitParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the rootObject needed to obtain the initial refresh/access tokens for the OAuth flow. Each inner array represents the path in the rootObject of the referenced field. For example. Assume the rootObject contains params 'app_secret', 'app_id' which are needed to get the initial refresh token. If they are not nested in the rootObject, then the array would look like this [['app_secret'], ['app_id']] If they are nested inside an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]",
)
oauthFlowOutputParameters: List[List[str]] = Field(
...,
oauthFlowOutputParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the rootObject which can be populated from successfully completing the oauth flow using the init parameters. This is typically a refresh/access token. Each inner array represents the path in the rootObject of the referenced field.",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,19 @@ class DestinationSyncMode(Enum):


class OAuth2Specification(BaseModel):
rootObject: List[str] = Field(
...,
class Config:
extra = Extra.allow

rootObject: Optional[List[str]] = Field(
None,
description="A list of strings representing a pointer to the root object which contains any oauth parameters in the ConnectorSpecification.\nExamples:\nif oauth parameters were contained inside the top level, rootObject=[] If they were nested inside another object {'credentials': {'app_id' etc...}, rootObject=['credentials'] If they were inside a oneOf {'switch': {oneOf: [{client_id...}, {non_oauth_param]}}, rootObject=['switch', 0] ",
)
oauthFlowInitParameters: List[List[str]] = Field(
...,
oauthFlowInitParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the rootObject needed to obtain the initial refresh/access tokens for the OAuth flow. Each inner array represents the path in the rootObject of the referenced field. For example. Assume the rootObject contains params 'app_secret', 'app_id' which are needed to get the initial refresh token. If they are not nested in the rootObject, then the array would look like this [['app_secret'], ['app_id']] If they are nested inside an object called 'auth_params' then this array would be [['auth_params', 'app_secret'], ['auth_params', 'app_id']]",
)
oauthFlowOutputParameters: List[List[str]] = Field(
...,
oauthFlowOutputParameters: Optional[List[List[str]]] = Field(
None,
description="Pointers to the fields in the rootObject which can be populated from successfully completing the oauth flow using the init parameters. This is typically a refresh/access token. Each inner array represents the path in the rootObject of the referenced field.",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,7 @@ definitions:
OAuth2Specification:
description: An object containing any metadata needed to describe this connector's Oauth flow
type: object
required:
- rootObject
- oauthFlowInitParameters
- oauthFlowOutputParameters
additionalProperties: true
properties:
rootObject:
description:
Expand Down

0 comments on commit 960214a

Please sign in to comment.