Support for oauth2 token per user per host (vs per host only) #430
Closed
Description
Describe the feature
Hello,
While using this package in Sagemaker Notebook I noticed that OAuth2 tokens are cached per host making it hard for multiple users to share a single notebook.
I think tokens should be cached per (host,user) pair and not just per host for the following reasons:
- Security: token is user-specific and can't (and should not) be shared between users.
- Granular access: there are use cases with granular access where different resources (schemas, tables) are accessed with different usernames/credentials. Having just 1 token per host makes it more difficult for developer to access different databases/tables within an application.
- web service: similar to Sagemaker Notebook's use case, using this package within a webservice would require a workaround.
This request is somewhat similar to Custom cache for oauth2 tokens, but offers a different approach to address it: rather than implementing a custom cache, extend official caching mechanism to support multi user token caching.
Thank you
Describe alternatives you've considered
currently using a keyring with file-based backend which can be configured with a different filename per user.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Metadata
Assignees
Labels
No labels