Persist token acquired through 'external-browser' auth type#110
Merged
Conversation
This cache is local to the Python SDK and keyed off the workspace host, the OAuth client ID, and the list of scopes to authorize for. It does not persist refreshes that happen during a session.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
==========================================
+ Coverage 52.72% 52.81% +0.09%
==========================================
Files 29 29
Lines 17067 17098 +31
==========================================
+ Hits 8998 9031 +33
+ Misses 8069 8067 -2
☔ View full report in Codecov by Sentry. |
nfx
reviewed
May 15, 2023
|
|
||
|
|
||
| class TokenCache(): | ||
| BASE_PATH = "~/.config/databricks-sdk-py/oauth" |
Contributor
There was a problem hiding this comment.
Probably it's better to use ~/.databricks/tokens
nfx
approved these changes
May 17, 2023
Contributor
nfx
left a comment
There was a problem hiding this comment.
will make necessary renames later
nfx
pushed a commit
that referenced
this pull request
May 17, 2023
## Changes This cache is local to the Python SDK and keyed off the workspace host, the OAuth client ID, and the list of scopes to authorize for. The cache path is `~/.config/databricks-sdk-py/oauth`. Files saved to this directory are masked 0600. It does not persist refreshes that happen during a session. ## Tests Reproduce by running `./examples/local_browser_oauth.py` multiple times. - [x] `make test` run locally - [x] `make fmt` applied - [x] relevant integration tests applied
Closed
nfx
added a commit
that referenced
this pull request
May 17, 2023
# Version changelog ## 0.1.7 * Added an extensive set of examples ([#113](#113)). * Fixed broken `dbutils.fs.mount` and `dbutils.fs.updateMount` ([#119](#119)). * Ignore `.netrc` when sending unauthenticated requests for OAuth handshake ([#108](#108)). * Make ApiClient more `pyodide` friendly ([#114](#114)). * Persist token acquired through `external-browser` auth type ([#110](#110)). * Prototype for notebook-native auth ([#115](#115)). * Rename `RefreshableCredentials` to `SessionCredentials` ([#116](#116)). * Use shell for opening `az` cli on Windows ([#117](#117)).
Merged
nfx
added a commit
that referenced
this pull request
May 17, 2023
# Version changelog ## 0.1.7 * Added an extensive set of examples ([#113](#113)). * Fixed broken `dbutils.fs.mount` and `dbutils.fs.updateMount` ([#119](#119)). * Ignore `.netrc` when sending unauthenticated requests for OAuth handshake ([#108](#108)). * Make ApiClient more `pyodide` friendly ([#114](#114)). * Persist token acquired through `external-browser` auth type ([#110](#110)). * Prototype for notebook-native auth ([#115](#115)). * Rename `RefreshableCredentials` to `SessionCredentials` ([#116](#116)). * Use shell for opening `az` cli on Windows ([#117](#117)).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changes
This cache is local to the Python SDK and keyed off the workspace host, the OAuth client ID, and the list of scopes to authorize for. The cache path is
~/.config/databricks-sdk-py/oauth. Files saved to this directory are masked 0600.It does not persist refreshes that happen during a session.
Tests
Reproduce by running
./examples/local_browser_oauth.pymultiple times.make testrun locallymake fmtapplied