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

feat: add name and token_last_characters to ApiToken #58918

Closed
5 tasks done
mdtro opened this issue Oct 26, 2023 · 0 comments · Fixed by #64493, #63342, #62972 or #58945
Closed
5 tasks done

feat: add name and token_last_characters to ApiToken #58918

mdtro opened this issue Oct 26, 2023 · 0 comments · Fixed by #64493, #63342, #62972 or #58945

Comments

@mdtro
Copy link
Member

mdtro commented Oct 26, 2023

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

@mdtro mdtro self-assigned this Oct 26, 2023
@mdtro mdtro linked a pull request Oct 27, 2023 that will close this issue
mdtro added a commit that referenced this issue Oct 31, 2023
- Add a nullable `name` column to the `ApiToken` model to help users
identify and give meaningful names to their API tokens.
- Add a nullable `last_token_characters` column that will contain the
last four characters of the API token to help users with identify the
token in the UI when the majority of it is obfuscated.

Supports #58918
mdtro added a commit that referenced this issue Jan 12, 2024
Take two of #59455.

- Add an option to toggle on/off automatically populating the
`token_last_characters` for the `ApiToken` model.

This option will ensure tokens created from here on have the field
populated. It will also allow me to thoroughly test the backfill
migration needed for existing tokens that will be coming in a future PR
by disabling the option in tests, creating a bunch of API tokens, and
then running the backfill migration test.

Tracking Issue: #58918
RFC: getsentry/rfcs#32
mdtro added a commit that referenced this issue Jan 17, 2024
Backfills the `token_last_characters` column on existing `ApiToken` entries.

As of #62972, new `ApiToken` entries
are being created with this column already populated with the correct
values. This backfill will only impact old tokens created prior.

Tracking Issue: #58918
Related RFC: getsentry/rfcs#32
trillville pushed a commit that referenced this issue Jan 19, 2024
Take two of #59455.

- Add an option to toggle on/off automatically populating the
`token_last_characters` for the `ApiToken` model.

This option will ensure tokens created from here on have the field
populated. It will also allow me to thoroughly test the backfill
migration needed for existing tokens that will be coming in a future PR
by disabling the option in tests, creating a bunch of API tokens, and
then running the backfill migration test.

Tracking Issue: #58918
RFC: getsentry/rfcs#32
trillville pushed a commit that referenced this issue Jan 19, 2024
Backfills the `token_last_characters` column on existing `ApiToken` entries.

As of #62972, new `ApiToken` entries
are being created with this column already populated with the correct
values. This backfill will only impact old tokens created prior.

Tracking Issue: #58918
Related RFC: getsentry/rfcs#32
mdtro added a commit that referenced this issue Feb 2, 2024
Adds backend support for naming API tokens.

- see issue #9600 and
getsentry/customer-feedback#22
- #58918
- [RFC #32](getsentry/rfcs#32)
cmanallen pushed a commit that referenced this issue Feb 7, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.