-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🎉 Asana source: Add oauth init flow parameters support #6832
Conversation
695a83c
to
74f418b
Compare
/test connector=connectors/source-asana
|
/publish connector=bases/source-acceptance-test
|
74f418b
to
8a86660
Compare
/test connector=connectors/source-asana
|
@@ -4,15 +4,74 @@ | |||
"$schema": "http://json-schema.org/draft-07/schema#", | |||
"title": "Asana Spec", | |||
"type": "object", | |||
"required": ["access_token"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why we remove "required" param?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for backward compatability, see my another hotfix PR for github with explanatory comment #6833 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, I like the option of canceling the config check during the read method more than removing the required field from the specification.
}, | ||
"client_id": { | ||
"type": "string", | ||
"title": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title
and description
should not be empty ;)
"type": "string", | ||
"title": "", | ||
"description": "", | ||
"airbyte_secret": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
client ID is not a secret
"oneOf": [ | ||
{ | ||
"type": "object", | ||
"title": "PAT Credentials", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why two titles?
def _get_authenticator(config: dict) -> Union[TokenAuthenticator, AsanaOauth2Authenticator]: | ||
if "access_token" in config: | ||
# Before Oauth we had Person Access Token stored under "access_token" | ||
# config filed, this code here is for backward compatability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# config filed, this code here is for backward compatability | |
# config field, this code here is for backward compatibility |
a = AsanaOauth2Authenticator( | ||
token_refresh_endpoint=URL, | ||
client_secret="client_secret", | ||
client_id="client_id", | ||
refresh_token="refresh_token", | ||
) | ||
token = a.get_access_token() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a = AsanaOauth2Authenticator( | |
token_refresh_endpoint=URL, | |
client_secret="client_secret", | |
client_id="client_id", | |
refresh_token="refresh_token", | |
) | |
token = a.get_access_token() | |
authenticator = AsanaOauth2Authenticator( | |
token_refresh_endpoint=URL, | |
client_secret="client_secret", | |
client_id="client_id", | |
refresh_token="refresh_token", | |
) | |
token = authenticator.get_access_token() |
/publish connector=connectors/source-asana
|
/publish connector=connectors/source-asana
|
What
Resolves #6259
How
Describe the solution
Recommended reading order
x.java
y.python
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes