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

migration: add columns for hashed values on ApiToken #65300

Merged
merged 7 commits into from
Feb 16, 2024

Conversation

mdtro
Copy link
Member

@mdtro mdtro commented Feb 16, 2024

In support of our improved API tokens initiative (getsentry/rfcs#32), this PR adds two null-able columns to the ApiToken model that will hold the hash values.

Hashed values for token values will be implemented over several PRs to maintain backwards compatibility and to prevent broken state between versions.

@mdtro mdtro requested a review from a team as a code owner February 16, 2024 00:38
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 16, 2024
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/0647_apitoken_add_hashed_columns.py ()

--
-- Add field hashed_refresh_token to apitoken
--
ALTER TABLE "sentry_apitoken" ADD COLUMN "hashed_refresh_token" varchar(128) NULL;
--
-- Add field hashed_token to apitoken
--
ALTER TABLE "sentry_apitoken" ADD COLUMN "hashed_token" varchar(128) NULL;

Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6809aed) 81.47% compared to head (f888338) 81.46%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #65300      +/-   ##
==========================================
- Coverage   81.47%   81.46%   -0.01%     
==========================================
  Files        5255     5255              
  Lines      232091   232093       +2     
  Branches    45521    45521              
==========================================
- Hits       189087   189086       -1     
- Misses      37124    37126       +2     
- Partials     5880     5881       +1     
Files Coverage Δ
src/sentry/backup/comparators.py 95.26% <ø> (ø)
src/sentry/models/apitoken.py 99.06% <100.00%> (+0.01%) ⬆️

... and 11 files with indirect coverage changes

Copy link
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I think you just need to follow this instructions in that test failure to update snapshots

@mdtro mdtro requested a review from a team as a code owner February 16, 2024 16:48
@mdtro mdtro merged commit 8fad5c1 into master Feb 16, 2024
49 checks passed
@mdtro mdtro deleted the mdtro/apitoken-hashed branch February 16, 2024 17:40
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants