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

Add new model OrgAuthToken based on existing ApiToken model #50144

Closed
Tracked by #50140
mydea opened this issue Jun 1, 2023 · 3 comments
Closed
Tracked by #50140

Add new model OrgAuthToken based on existing ApiToken model #50144

mydea opened this issue Jun 1, 2023 · 3 comments
Assignees

Comments

@mydea
Copy link
Member

mydea commented Jun 1, 2023

We will add a new model OrgAuthToken with the following properties:

  • organization
  • name - note that this is required in order to identify the token
  • token_hashed - the JWT token - we'll store this as a hash
  • token_last_characters- the last characters of the original token, to be shown to the user (e.g. "ends with ABCD")
  • scope_list - for now can only contain org:ci, but in the future maybe more.
  • date_added
  • user_added
  • date_last_used
  • project_last_used

We decided against re-using/extending the ApiToken model, as there are too many differences and may lead to more confusion/problems.

Some important things:

  • token is only viewable after creation.
  • Only the name & projects may be edited - the scopes may not.
  • Although the token is JWT, we do not want to authorize anything directly from the token, but only use it as carrier for information
  • We decided against allowing projects for now, as that complicates stuff with HybridCloud considerably. We may add this later.

Future things

  • Make sure to reference it in the audit log
@mydea mydea self-assigned this Jun 1, 2023
@mydea mydea changed the title Add new model OrgApiToken (?? Name TBD) based on existing ApiToken model Add new model OrgAccessToken (?? Name TBD) based on existing ApiToken model Jun 1, 2023
@mydea mydea changed the title Add new model OrgAccessToken (?? Name TBD) based on existing ApiToken model Add new model OrgAuthToken (?? Name TBD) based on existing ApiToken model Jun 1, 2023
@stephanie-anderson stephanie-anderson changed the title Add new model OrgAuthToken (?? Name TBD) based on existing ApiToken model Add new model OrgAuthToken based on existing ApiToken model Jun 1, 2023
@mydea
Copy link
Member Author

mydea commented Jun 7, 2023

Note: We decided to make the name of the token required. This is also this way e.g. for github tokens, and makes especially sense as we want to hide the token from the UI, making it hard to identify them.

@AniketDas-Tekky
Copy link
Contributor

Hey, is there a tech spec for this change available? This is a pretty substantial change I want to make sure we've done our due diligence in investigating the implications of adding a new token type.

@mydea
Copy link
Member Author

mydea commented Jun 9, 2023

Hey, the RFC outlining this is here: getsentry/rfcs#91

mydea added a commit that referenced this issue Jun 14, 2023
@mydea mydea closed this as completed Jun 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants