Skip to content
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

Low code CDK: Make refresh token in oauth authenticator optional #26031

Merged
merged 3 commits into from
May 15, 2023

Conversation

flash1293
Copy link
Contributor

What

Fixes #23450

How

Makes the refresh_token parameter optional in schema and python classes, add test to fail if it's not set for grant_type "refresh_token".

@flash1293 flash1293 requested a review from a team as a code owner May 12, 2023 14:54
@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label May 12, 2023
@flash1293 flash1293 requested a review from brianjlai May 12, 2023 14:54
Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it make sense to encode this via JSONSchema dependency keywords? https://json-schema.org/understanding-json-schema/reference/conditionals.html

@@ -22,7 +22,7 @@ def __init__(
token_refresh_endpoint: str,
client_id: str,
client_secret: str,
refresh_token: str,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the type annotation removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was an oversight, I will add it back

@flash1293
Copy link
Contributor Author

@sherifnada JSON schema isn't great on types that depend on values of other fields - I tested around with if-then-else blocks (https://json-schema.org/understanding-json-schema/reference/conditionals.html#id6) but couldn't make that work - the approach https://stackoverflow.com/questions/9029524/json-schema-specify-field-is-required-based-on-value-of-another-field should work but it's not compatible with how we generate docs and types out of our schema. I think ultimately it would be nice to express this invariant in the schema but it's not worth the downsides based on current tooling

@flash1293
Copy link
Contributor Author

@girarda added back that annotation, could you take another look?

Copy link
Contributor

@girarda girarda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@flash1293 flash1293 merged commit dbb766c into master May 15, 2023
19 checks passed
@flash1293 flash1293 deleted the flash1293/optional-refresh-token branch May 15, 2023 12:47
marcosmarxm pushed a commit to natalia-miinto/airbyte that referenced this pull request Jun 8, 2023
…bytehq#26031)

* make refresh_token optional

* format

* add back type annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Low-code CDK: Support OAuth client flow as an auth option
4 participants