Add a token prefix column, generate the token_prefix and the token_digest, removing the plaintext token from use.

This commit is contained in:
Dan Milne
2025-12-30 09:45:16 +11:00
parent 0761c424c1
commit 99c3ac905f
6 changed files with 118 additions and 73 deletions

View File

@@ -0,0 +1,6 @@
# Token HMAC key derivation
# This key is used to compute HMAC-based token prefixes for fast lookup
# Derived from SECRET_KEY_BASE - no storage needed, deterministic output
module TokenHmac
KEY = Rails.application.key_generator.generate_key('oidc_token_prefix', 32)
end