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: increase max_length for api tokens #65743

Merged
merged 1 commit into from
Feb 26, 2024
Merged

Conversation

mdtro
Copy link
Member

@mdtro mdtro commented Feb 23, 2024

In support of getsentry/rfcs#32.

API Tokens will be prefixed with seven extra characters (ex. sntryu_). Eventually these plaintext token columns will be dropped, but to maintain backwards compatibility and a smooth transition to fully hashed tokens we'll still want to store them here.

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

This PR has a migration; here is the generated SQL for src/sentry/hybridcloud/migrations/0012_apitoken_increase_token_length.py src/sentry/migrations/0655_apitoken_increase_token_length.py ()

--
-- Alter field refresh_token on apitoken
--
ALTER TABLE "sentry_apitoken" ALTER COLUMN "refresh_token" TYPE varchar(71);
--
-- Alter field token on apitoken
--
ALTER TABLE "sentry_apitoken" ALTER COLUMN "token" TYPE varchar(71);

Copy link

codecov bot commented Feb 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.21%. Comparing base (8190a27) to head (98b8376).

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #65743       +/-   ##
===========================================
+ Coverage   58.51%   84.21%   +25.69%     
===========================================
  Files        5086     5274      +188     
  Lines      224231   235949    +11718     
  Branches    38792    40859     +2067     
===========================================
+ Hits       131206   198695    +67489     
+ Misses      92801    37035    -55766     
+ Partials      224      219        -5     
Files Coverage Δ
.../migrations/0012_apitoken_increase_token_length.py 100.00% <100.00%> (ø)
src/sentry/hybridcloud/models/apitokenreplica.py 97.43% <100.00%> (+20.51%) ⬆️
src/sentry/models/apitoken.py 100.00% <100.00%> (+25.45%) ⬆️

... and 1920 files with indirect coverage changes

@mdtro mdtro merged commit 618bfe2 into master Feb 26, 2024
51 checks passed
@mdtro mdtro deleted the mdtro/apitoken-increase-length branch February 26, 2024 20:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 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