-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: add name and token_last_characters to apitoken #58945
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
Conversation
49b0d5b
to
4df66e6
Compare
This PR has a migration; here is the generated SQL for --
-- Add field name to apitoken
--
ALTER TABLE "sentry_apitoken" ADD COLUMN "name" varchar(255) NULL;
--
-- Add field token_last_characters to apitoken
--
ALTER TABLE "sentry_apitoken" ADD COLUMN "token_last_characters" varchar(4) NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind updating the code in tests/sentry/backup/test_models.py
and src/sentry/testutils/helpers/backups.py
(<- 2 usages) to use these fields as well?
Also, more generally, may be worthwhile adding a couple of general-case tests in ex: test_authetnication.py, test_sentryapp.py, etc.
Codecov Report
@@ Coverage Diff @@
## master #58945 +/- ##
==========================================
+ Coverage 80.64% 80.65% +0.01%
==========================================
Files 5157 5157
Lines 226028 226030 +2
Branches 38078 38078
==========================================
+ Hits 182273 182312 +39
+ Misses 38187 38149 -38
- Partials 5568 5569 +1
|
d4125d0
to
422ab48
Compare
422ab48
to
306704b
Compare
save() is needed after the migration has been applied, not along with otherwise we cannot properly test it and the backfill
f17208b
to
b7e3250
Compare
name
column to theApiToken
model to help users identify and give meaningful names to their API tokens.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