-
Notifications
You must be signed in to change notification settings - Fork 33
add support for google service accounts #1682
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
Open
mtuchi
wants to merge
9
commits into
main
Choose a base branch
from
service-accounts
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
715f80d
add support for google service accounts
mtuchi 4c09707
support service accounts credentials
mtuchi 881b568
turn createConnection into async function
mtuchi 5e61a5e
devDependecy update for unit test
mtuchi c3da180
update unit tests
mtuchi 679007a
document service account auth in gmail, googledrive, and googlesheets…
mtuchi 45fc087
cli vs app credential difference
mtuchi 7dec8dc
update gmail, googledrive, and googlesheets README auth docs
mtuchi b66e155
add changeset
mtuchi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@openfn/language-googlesheets': minor | ||
| '@openfn/language-googledrive': minor | ||
| '@openfn/language-gmail': minor | ||
| --- | ||
|
|
||
| Add support for Google Service Account credential |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,54 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$comment": "OAuth2", | ||
| "type": "object", | ||
| "properties": { | ||
| "access_token": { | ||
| "title": "Access Token", | ||
| "type": "string", | ||
| "description": "Your Gmail access token", | ||
| "description": "Your Gmail OAuth2 access token", | ||
| "writeOnly": true, | ||
| "minLength": 1, | ||
| "examples": [ | ||
| "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmhax0rZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI" | ||
| ] | ||
| }, | ||
| "private_key": { | ||
| "title": "Private Key", | ||
| "type": "string", | ||
| "description": "RSA private key from the Google service account JSON key file", | ||
| "writeOnly": true, | ||
| "minLength": 1, | ||
| "examples": [ | ||
| "-----BEGIN RSA PRIVATE KEY-----\nMIIEow..." | ||
| ] | ||
| }, | ||
| "client_email": { | ||
| "title": "Client Email", | ||
| "type": "string", | ||
| "description": "Service account email address (e.g. my-app@project-id.iam.gserviceaccount.com)", | ||
| "minLength": 1, | ||
| "examples": [ | ||
| "my-app@project-id.iam.gserviceaccount.com" | ||
| ] | ||
| }, | ||
| "subject": { | ||
| "title": "Subject Email", | ||
| "type": "string", | ||
| "description": "Gmail user to impersonate via domain-wide delegation (e.g. user@yourdomain.com). Required for service account access to Gmail.", | ||
| "examples": [ | ||
| "user@yourdomain.com" | ||
| ] | ||
| } | ||
| }, | ||
| "type": "object", | ||
| "additionalProperties": true, | ||
| "required": ["access_token"] | ||
| "oneOf": [ | ||
| { | ||
| "$comment": "OAuth2", | ||
| "required": ["access_token"] | ||
| }, | ||
| { | ||
| "$comment": "Service Account", | ||
| "required": ["private_key", "client_email"] | ||
| } | ||
| ], | ||
| "additionalProperties": true | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 am worried this will break on lightning 🤔
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.
@josephjclark would love you're input on this, I think lightning is expecting
requiredfiled not "oneOf".Should we have have two different schema maybe 🤷🏽 ? But again lightning need to support both of those schema