-
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
🎉 Source Google Sheets: Support connecting via oAuth webflow #6354
Changes from 6 commits
eb98c03
a7a9ff4
5b5442d
2426eea
e672b01
a48e48c
ffcad91
c4ca548
f0ab96b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,81 @@ | |
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Stripe Source Spec", | ||
"type": "object", | ||
"required": ["spreadsheet_id", "credentials_json"], | ||
"additionalProperties": false, | ||
"required": ["spreadsheet_id"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is "credentials" not required? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the idea is to have a backward compatibility with the old-style config, and credentials are still required for auth through the UI |
||
"additionalProperties": true, | ||
"properties": { | ||
"spreadsheet_id": { | ||
"type": "string", | ||
"description": "The ID of the spreadsheet to be replicated." | ||
}, | ||
"credentials_json": { | ||
"type": "string", | ||
"description": "The contents of the JSON service account key. See the <a href=\"https://docs.airbyte.io/integrations/sources/google-sheets\">docs</a> for more information on how to generate this key.", | ||
"airbyte_secret": true | ||
"credentials": { | ||
"type": "object", | ||
"oneOf": [ | ||
{ | ||
"title": "Authenticate via Google (Oauth)", | ||
"type": "object", | ||
"required": [ | ||
"auth_type", | ||
"client_id", | ||
"client_secret", | ||
"refresh_token" | ||
], | ||
"properties": { | ||
"auth_type": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think, auth_type shouldn't be part of specification. It should be recognized in code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vitaliizazmic this practice is used in the others connectors, could you point to some code with a new approach? |
||
"type": "string", | ||
"const": "Client" | ||
}, | ||
"client_id": { | ||
"title": "Client ID", | ||
"type": "string", | ||
"description": "The Client ID of your developer application", | ||
"airbyte_secret": true | ||
}, | ||
"client_secret": { | ||
"title": "Client Secret", | ||
"type": "string", | ||
"description": "The client secret of your developer application", | ||
"airbyte_secret": true | ||
}, | ||
"refresh_token": { | ||
"title": "Refresh Token", | ||
"type": "string", | ||
"description": "A refresh token generated using the above client ID and secret", | ||
"airbyte_secret": true | ||
} | ||
} | ||
}, | ||
{ | ||
"title": "Service Account Key Authentication", | ||
"type": "object", | ||
"required": ["auth_type", "service_account_info"], | ||
"properties": { | ||
"auth_type": { | ||
"type": "string", | ||
"const": "Service" | ||
}, | ||
"service_account_info": { | ||
"type": "string", | ||
"description": "The JSON key of the service account to use for authorization", | ||
"examples": [ | ||
"{ \"type\": \"service_account\", \"project_id\": YOUR_PROJECT_ID, \"private_key_id\": YOUR_PRIVATE_KEY, ... }" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"authSpecification": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What this for? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. based on #6456 |
||
"auth_type": "oauth2.0", | ||
"oauth2Specification": { | ||
"rootObject": ["credentials", 0], | ||
"oauthFlowInitParameters": [ | ||
["client_id"], | ||
["client_secret"], | ||
["refresh_token"] | ||
] | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"spreadsheet_id": "randomid", | ||
"credentials_json": "{\"type\": \"service_account\",\"project_id\": \"airbyte-310409\",\"private_key_id\": \"xyz\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\n ... -----END PRIVATE KEY-----\\n\",\"client_email\": \"[email protected]\",\"client_id\": \"121512124\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/airbyte%40airbyte-123456.iam.gserviceaccount.com\"}" | ||
"spreadsheet_id": "invalid_spreadsheet_id", | ||
"credentials": { | ||
"auth_type": "Client", | ||
"client_id": "invalid_id", | ||
"client_secret": "invalid_secret", | ||
"refresh_token": "invalid_token" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"spreadsheet_id": "randomid", | ||
"credentials_json": "{\"type\": \"service_account\",\"project_id\": \"airbyte-310409\",\"private_key_id\": \"xyz\",\"private_key\": \"-----BEGIN PRIVATE KEY-----\\n ... -----END PRIVATE KEY-----\\n\",\"client_email\": \"[email protected]\",\"client_id\": \"121512124\",\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\"token_uri\": \"https://oauth2.googleapis.com/token\",\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/airbyte%40airbyte-123456.iam.gserviceaccount.com\"}" | ||
"spreadsheet_id": "random_id", | ||
"credentials": { | ||
"auth_type": "Client", | ||
"client_id": "CLIENT_ID", | ||
"client_secret": "CLIENT_SECRET", | ||
"refresh_token": "CLIENT_REFRESH_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.
I might be wrong, but what will happen here if the first comparison fail?
so the
auth_type
is already removed, would it always return None?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.
ok, I read it as a two
pop
s, but nevertheless can't we popauth_type
first and then do if/else logic?