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

[Fix] Initiate a new OAuth external browser login flow in case of refresh token exception #823

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

eric-wang-1990
Copy link

@eric-wang-1990 eric-wang-1990 commented Nov 15, 2024

What changes are proposed in this pull request?

This PR change the OAuth token cache that when the cached oauth token cannot be refreshed, we still wanna go trigger a new OAuth login flow instead of just throwing an exception.
This help customers who use OAuth U2M, when their cached access token expire they have a way to continue rather than stuck with exception.

How is this tested?

Manual test from dbt-databricks.

@eric-wang-1990 eric-wang-1990 marked this pull request as draft November 19, 2024 23:18
@eric-wang-1990 eric-wang-1990 marked this pull request as ready for review November 19, 2024 23:19
Copy link

@yunbodeng-db yunbodeng-db left a comment

Choose a reason for hiding this comment

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

Miles is OOO.
Please add renaudhartert-db to the reviewer.

@eric-wang-1990 eric-wang-1990 changed the title fix token cache for oauth [DECO-24101] fix token cache for oauth Nov 22, 2024
@renaudhartert-db renaudhartert-db self-requested a review November 26, 2024 22:25
@benc-db
Copy link

benc-db commented Dec 5, 2024

Anything I can do to get this prioritized? We've been stuck on 0.17.0 for more than a year, and this is the last piece needed for us to finish our migration to fully relying on SDK for dbt-databricks auth and being able to use latest versions of SDK.

Copy link
Contributor

@renaudhartert-db renaudhartert-db left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @eric-wang-1990! The overall logic looks good to me. Though, I would ideally like to see some form of regression test for this.

databricks/sdk/credentials_provider.py Outdated Show resolved Hide resolved
databricks/sdk/credentials_provider.py Show resolved Hide resolved
@renaudhartert-db renaudhartert-db changed the title [DECO-24101] fix token cache for oauth [Fix] Initiate a new OAuth external browser flow in case of refresh token exception Dec 10, 2024
@renaudhartert-db renaudhartert-db changed the title [Fix] Initiate a new OAuth external browser flow in case of refresh token exception [Fix] Initiate a new OAuth external browser login flow in case of refresh token exception Dec 10, 2024
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-py

Inputs:

  • PR number: 823
  • Commit SHA: 61f0ddaa186d303f1489433696fc657f6ee41822

Checks will be approved automatically on success.

Copy link
Contributor

@renaudhartert-db renaudhartert-db left a comment

Choose a reason for hiding this comment

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

@eric-wang-1990, I see you've re-assigned the PR to me but I cannot find any additional test in the code. Did you forget to commit the tests or is it that you need guidance to write them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants