Skip to content

feat: add name and token_last_characters to ApiToken #58918

Closed

Description

@mdtro

As part of the initial work for RFC #32 we need to add a name and token_last_characters column to the ApiToken model.

This will help users more easily identify their API tokens and their intended use (see issue #9600 and https://github.com/getsentry/customer-feedback/issues/22).

I had a PR that accomplishes this on the backend (see #58876), but it needs to be broken up into three different ones in order to avoid any weird states and running multiple backfills.

### Tasks
- [x] Add nullable `name` and `token_last_characters` fields to the `ApiToken` model
- [x] Update the `.save()` method on `ApiToken` to add the `token_last_characters` on new `ApiToken`s
- [x] Run a backfill migration that updates existing tokens and sets the `token_last_characters`
- [x] Update backend serializer to handle optional `name` field for the `ApiToken`
- [x] Update frontend to display and allow name to be set for `ApiToken`s

Activity

  1. self-assigned this
    on Oct 26, 2023
  2. linked a pull request that will close this issuemigration: backfill apitoken last characters #63342on Feb 2, 2024
  3. linked a pull request that will close this issuefeat: apitoken last characters option #62972on Feb 2, 2024
  4. locked and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions