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
add google sheets oauth flow to server + fix auth rootObject type in protocol #7131
Conversation
public class GoogleSheetsOAuthFlow extends GoogleOAuthFlow { | ||
|
||
@VisibleForTesting | ||
static final String SCOPE_URL = "https://www.googleapis.com/auth/spreadsheets.readonly"; |
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.
shouldn't the scopes also include Gdrive readonly like listed here?
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 left out Gdrive because get_authenticated_drive_client()
is never actually used but I'll add it in for completeness.
@@ -227,7 +227,7 @@ definitions: | |||
" | |||
type: array | |||
items: | |||
type: string | |||
type: [string, integer] |
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.
this will require also CDK models and releasing a version of the CDK, also updating the API interface since it returns the same struct, and testing inserting the conversion between the two in the tests for this class
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.
gotcha. I believe this is a correct change and therefore worth the additional changes, sheets connector is hitting jsonvalidationerror on get spec otherwise, understandably because of the index integer in this array.
I'm not entirely sure why other connectors with an integer aren't already failing though... 🤷
Thanks for highlighting required changes!
assertTrue(credentials.get("access_token").toString().length() > 0); | ||
} | ||
|
||
static class ServerHandler implements HttpHandler { |
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.
would it make sense to DRY this component? feels like we use it in every test class
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.
yes all oauth backends are going to copy/paste this test structure, maybe worth DRYing it and making it easier for #4982
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.
Agreed, I think there's a lot of DRY to be had on the testing but thought I'd avoid until #4982 was clear in case the effort would be made redundant. If these will likely exist as is regardless then I'll DRY as part of this PR.
# Conflicts: # airbyte-oauth/src/main/java/io/airbyte/oauth/OAuthImplementationFactory.java
/publish-cdk dry-run=true
|
/publish-cdk dry-run=false
|
Merging this and will create a separate PR for bumping OSS Airbyte version |
…protocol (airbytehq#7131) * adding google sheets oauth flow to server * fix oauth type in protocol yaml * bump sheets version in definitions * added GDrive scope * update sheets to master changes * update protocol incl. cdk * protocol typing for oauth rootobject * format
What
starting point for: #7038
Confirmed
Sheets
,Ads
andSearch Console
OAuth flow all working locally, ready to deploy and record demo videos.Also, in protocol, updated type of OAuth2Specification.rootObject to array of [string or integer] to accurately reflect holding string keys and/or array index.
Note
purposely avoided DRYing tests as it could be made redundant by work that gets done next in this issue