Skip to content

Add new model OrgAuthToken based on existing ApiToken model #50144

Closed

Description

@mydea

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

Activity

  1. self-assigned this
    on Jun 1, 2023
  2. 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[/+] on Jun 1, 2023
  3. 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[/+] on Jun 1, 2023
  4. changed the title [-]Add new model `OrgAuthToken` (?? Name TBD) based on existing `ApiToken` model[/-] [+]Add new model `OrgAuthToken` based on existing `ApiToken` model[/+] on Jun 1, 2023
  5. mydea commented on Jun 7, 2023

    @mydea
    MemberAuthor

    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.

  6. AniketDas-Tekky commented on Jun 8, 2023

    @AniketDas-Tekky
    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.

  7. mydea commented on Jun 9, 2023

    @mydea
    MemberAuthor

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

  8. added a commit that references this issue on Jun 14, 2023
  9. locked and limited conversation to collaborators on Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions