Skip to content

Support for oauth2 token per user per host (vs per host only) #430

Closed
@gerilya

Description

@gerilya

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions