Hashes remoteStorage access tokens at rest (ref #259, part of #254).
New token_digest column with a unique index on remote_storage_authorizations; the model keeps the plaintext in an in-memory accessor and stores only SHA256(token).
Redis authorization keys become authorizations:<cn>:<digest>.
New idempotent rs:rekey_tokens task backfills missing digests, re-keys existing authorizations from the plaintext to the digest form, and sweeps leftover plaintext keys.
Revocation and expiry delete by digest, falling back to the persisted plaintext while the legacy column still exists.
This is the expand half of an expand/contract rollout: the plaintext token column is intentionally kept so the old code can keep running during the deploy. A follow-up PR will drop it once rs:rekey_tokens reports a clean sweep.
Deploy order, together with the Liquor Cabinet PR: enable LC's RS_HASHED_ACCESS_TOKENS, deploy this, run rs:rekey_tokens, then ship the contract migration and later retire LC's plaintext fallback.
Tests: the remoteStorage model/service/job/controller specs pass (91 examples, 0 failures).
Hashes remoteStorage access tokens at rest (ref #259, part of #254).
- New `token_digest` column with a unique index on `remote_storage_authorizations`; the model keeps the plaintext in an in-memory accessor and stores only `SHA256(token)`.
- Redis authorization keys become `authorizations:<cn>:<digest>`.
- New idempotent `rs:rekey_tokens` task backfills missing digests, re-keys existing authorizations from the plaintext to the digest form, and sweeps leftover plaintext keys.
- Revocation and expiry delete by digest, falling back to the persisted plaintext while the legacy column still exists.
This is the expand half of an expand/contract rollout: the plaintext `token` column is intentionally kept so the old code can keep running during the deploy. A follow-up PR will drop it once `rs:rekey_tokens` reports a clean sweep.
Deploy order, together with the Liquor Cabinet PR: enable LC's `RS_HASHED_ACCESS_TOKENS`, deploy this, run `rs:rekey_tokens`, then ship the contract migration and later retire LC's plaintext fallback.
Tests: the remoteStorage model/service/job/controller specs pass (91 examples, 0 failures).
Store only SHA256(token) in a new token_digest column and use the digest for the Redis authorization keys instead of the plaintext token. The plaintext is now held in memory only for issuance.
This is the expand step: the plaintext token column stays in place so the old code can keep running during the deploy. A follow-up migration will drop it once rs:rekey_tokens has re-keyed Redis and confirmed no plaintext keys remain.
Refs #259
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Hashes remoteStorage access tokens at rest (ref #259, part of #254).
token_digestcolumn with a unique index onremote_storage_authorizations; the model keeps the plaintext in an in-memory accessor and stores onlySHA256(token).authorizations:<cn>:<digest>.rs:rekey_tokenstask backfills missing digests, re-keys existing authorizations from the plaintext to the digest form, and sweeps leftover plaintext keys.This is the expand half of an expand/contract rollout: the plaintext
tokencolumn is intentionally kept so the old code can keep running during the deploy. A follow-up PR will drop it oncers:rekey_tokensreports a clean sweep.Deploy order, together with the Liquor Cabinet PR: enable LC's
RS_HASHED_ACCESS_TOKENS, deploy this, runrs:rekey_tokens, then ship the contract migration and later retire LC's plaintext fallback.Tests: the remoteStorage model/service/job/controller specs pass (91 examples, 0 failures).