Skip to content
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

[Python SDK][Auth] Refresh token id w/o gcloud cli #1413

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

pyalex
Copy link
Collaborator

@pyalex pyalex commented Mar 26, 2021

Signed-off-by: Oleksii Moskalenko [email protected]

What this PR does / why we need it:

Currently python SDK requires gcloud cli to be installed in order to extract id_token from ServiceAccount. This is very inconvenient. This PR uses google.oauth2 instead.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Oleksii Moskalenko <[email protected]>
@woop
Copy link
Member

woop commented Mar 26, 2021

So you are able to strip the oid token with the oauth module? I believe I added that code because it didn't work without the gcloud CLI.

Currently python SDK requires gcloud cli to be installed in order to extract id_token from ServiceAccount.

It doesnt seem to be a requirement. It's wrapped in a try/except.

Signed-off-by: Oleksii Moskalenko <[email protected]>
@pyalex
Copy link
Collaborator Author

pyalex commented Mar 29, 2021

It doesnt seem to be a requirement. It's wrapped in a try/except.

Yes, but google_auth.default doesn't refresh id_token for service accounts. Thus the only way to authorize with service account is to have gcloud cli installed.

Copy link
Collaborator

@khorshuheng khorshuheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: khorshuheng, pyalex
To complete the pull request process, please assign jklegar after the PR has been reviewed.
You can assign the PR to them by writing /assign @jklegar in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@khorshuheng khorshuheng merged commit 6d12589 into feast-dev:master Mar 29, 2021
pyalex added a commit to pyalex/feast that referenced this pull request Mar 30, 2021
* Auth: refresh token id w/o gcloud sdk

Signed-off-by: Oleksii Moskalenko <[email protected]>

* fix unit tests

Signed-off-by: Oleksii Moskalenko <[email protected]>
pyalex added a commit that referenced this pull request Mar 30, 2021
* Auth: refresh token id w/o gcloud sdk

Signed-off-by: Oleksii Moskalenko <[email protected]>

* fix unit tests

Signed-off-by: Oleksii Moskalenko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants