-
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 Directory: support oauth #7409
Changes from 4 commits
7e93198
237a4b3
475636a
98ba803
dec5094
e7a6580
d418813
3954b15
2ed8369
021a154
96ef16d
96130d6
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,87 @@ | |||||
"$schema": "http://json-schema.org/draft-07/schema#", | ||||||
"title": "Google Directory Spec", | ||||||
"type": "object", | ||||||
"required": ["credentials_json", "email"], | ||||||
"additionalProperties": false, | ||||||
"required": [], | ||||||
"additionalProperties": true, | ||||||
"properties": { | ||||||
"credentials_json": { | ||||||
"type": "string", | ||||||
"description": "The contents of the JSON service account key. See the <a href=\"https://developers.google.com/admin-sdk/directory/v1/guides/delegation\">docs</a> for more information on how to generate this key.", | ||||||
"airbyte_secret": true | ||||||
}, | ||||||
"email": { | ||||||
"type": "string", | ||||||
"description": "The email of the user, which has permissions to access the Google Workspace Admin APIs." | ||||||
"credentials": { | ||||||
"title": "Google Credentials", | ||||||
"description": "Google APIs use the OAuth 2.0 protocol for authentication and authorization. The Source supports <a href=\"https://developers.google.com/identity/protocols/oauth2#webserver\" target=\"_blank\">Web server application</a> and <a href=\"https://developers.google.com/identity/protocols/oauth2#serviceaccount\" target=\"_blank\">Service accounts</a> scenarios", | ||||||
"type": "object", | ||||||
"oneOf": [ | ||||||
{ | ||||||
"title": "Web server application", | ||||||
"description": "For these scenario user only needs to give permission to read Google Directory data", | ||||||
"type": "object", | ||||||
"required": ["client_id", "client_secret", "refresh_token"], | ||||||
"properties": { | ||||||
"credentials_title": { | ||||||
"type": "string", | ||||||
"title": "Credentials title", | ||||||
"description": "Authentication scenario", | ||||||
"const": "Web server app", | ||||||
"enum": ["Web server app"], | ||||||
"default": "Web server app", | ||||||
"order": 0 | ||||||
}, | ||||||
"client_id": { | ||||||
"title": "Client ID", | ||||||
"type": "string", | ||||||
"description": "The client ID of developer application", | ||||||
"airbyte_secret": true | ||||||
}, | ||||||
"client_secret": { | ||||||
"title": "Client secret", | ||||||
"type": "string", | ||||||
"description": "The client secret of developer application", | ||||||
"airbyte_secret": true | ||||||
}, | ||||||
"refresh_token": { | ||||||
"title": "Refresh Token", | ||||||
"type": "string", | ||||||
"description": "The token for obtaining new access token", | ||||||
"airbyte_secret": true | ||||||
} | ||||||
} | ||||||
}, | ||||||
{ | ||||||
"title": "Service accounts", | ||||||
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.
Suggested change
|
||||||
"description": "For these scenario user should obtain service account's credentials from the Google API Console and provide delegated email", | ||||||
"type": "object", | ||||||
"required": ["credentials_json", "email"], | ||||||
"properties": { | ||||||
"credentials_title": { | ||||||
"type": "string", | ||||||
"title": "Credentials title", | ||||||
"description": "Authentication scenario", | ||||||
"const": "Service accounts", | ||||||
"enum": ["Service accounts"], | ||||||
"default": "Service accounts", | ||||||
"order": 0 | ||||||
}, | ||||||
"credentials_json": { | ||||||
"type": "string", | ||||||
"title": "Credentials JSON", | ||||||
"description": "The contents of the JSON service account key. See the <a href=\"https://developers.google.com/admin-sdk/directory/v1/guides/delegation\">docs</a> for more information on how to generate this key.", | ||||||
"airbyte_secret": true | ||||||
}, | ||||||
"email": { | ||||||
"type": "string", | ||||||
"title": "Email", | ||||||
"description": "The email of the user, which has permissions to access the Google Workspace Admin APIs." | ||||||
} | ||||||
} | ||||||
} | ||||||
] | ||||||
} | ||||||
} | ||||||
}, | ||||||
"authSpecification": { | ||||||
"auth_type": "oauth2.0", | ||||||
"oauth2Specification": { | ||||||
"rootObject": ["credentials", 0], | ||||||
"oauthFlowInitParameters": [["client_id"], ["client_secret"]], | ||||||
"oauthFlowOutputParameters": [["refresh_token"]] | ||||||
} | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,7 +37,9 @@ This connector attempts to back off gracefully when it hits Directory API's rate | |||||
|
||||||
## Getting started | ||||||
|
||||||
### Requirements | ||||||
Google APIs use the OAuth 2.0 protocol for authentication and authorization. The Source supports [Web server application](https://developers.google.com/identity/protocols/oauth2#webserver) and [Service accounts](https://developers.google.com/identity/protocols/oauth2#serviceaccount) scenarios. | ||||||
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.
Suggested change
Can you also add a section explaining the difference in setup between OSS and Cloud? Similar to this one https://docs.airbyte.io/integrations/sources/google-analytics-v4#getting-started-airbyte-cloud |
||||||
|
||||||
### Requirements Service accounts scenario | ||||||
|
||||||
* Credentials to a Google Service Account with delegated Domain Wide Authority | ||||||
* Email address of the workspace admin which created the Service Account | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,7 @@ write_standard_creds source-google-analytics-v4 "$GOOGLE_ANALYTICS_V4_TEST_CREDS | |
write_standard_creds source-google-analytics-v4 "$GOOGLE_ANALYTICS_V4_TEST_CREDS_SRV_ACC" "service_config.json" | ||
write_standard_creds source-google-analytics-v4 "$GOOGLE_ANALYTICS_V4_TEST_CREDS_OLD" "old_config.json" | ||
write_standard_creds source-google-directory "$GOOGLE_DIRECTORY_TEST_CREDS" | ||
write_standard_creds source-google-directory "$GOOGLE_DIRECTORY_TEST_CREDS_OAUTH" "config_oauth.json" | ||
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. does SAT use this config? 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. |
||
write_standard_creds source-google-search-console "$GOOGLE_SEARCH_CONSOLE_CDK_TEST_CREDS" | ||
write_standard_creds source-google-search-console "$GOOGLE_SEARCH_CONSOLE_CDK_TEST_CREDS_SRV_ACC" "service_account_config.json" | ||
write_standard_creds source-google-sheets "$GOOGLE_SHEETS_TESTS_CREDS" | ||
|
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.
making this suggestion because the non-technical personas explained in the UX handbook e.g: data analyst won't know what a "Web Server Application" means