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

Revert "Revert "Create a method to generate OAuth tokens (#644)" (#653)" #655

Merged
merged 2 commits into from
May 24, 2024

Conversation

hectorcast-db
Copy link
Contributor

This reverts commit 9c5fae7.

Changes

Introduce again the method to generate OAuth tokens, including fixes for impacted auth types

Tests

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

Copy link

github-actions bot commented May 24, 2024

This PR breaks backwards compatibility for databrickslabs/ucx downstream. See build logs for more details.

Running from downstreams #147

@hectorcast-db hectorcast-db requested a review from tanmay-db May 24, 2024 10:33
@@ -124,11 +176,14 @@ def inner() -> Dict[str, str]:
token = token_source.token()
return {'Authorization': f'{token.token_type} {token.access_token}'}

return inner
def token() -> Token:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The difference from the original is this function. Previous code:

return OAuthCredentialsProvider(inner, inner.token)

That does not work because config.py tries to make a copy of inner which uses a "lock" (and cannot be copied). The function works as a wrapper, and allows this object to be copied without copying inner.

@hectorcast-db hectorcast-db added this pull request to the merge queue May 24, 2024
Merged via the queue into main with commit 2bafb95 May 24, 2024
8 of 9 checks passed
@hectorcast-db hectorcast-db deleted the oauth-token-fix branch May 24, 2024 11:44
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.

2 participants