fix(auth): explicit Validation::new(Algorithm::HS256) + mint iss/aud/nbf claims #406
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!406
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-334-explicit-validation-secret-floor-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
MAPPS-334 (step 1 of 2): close the alg-confusion door + prepare for strict iss/aud validation.
decode_tokenpreviously usedValidation::default(). That defaults to HS256 today, but the default is set by jsonwebtoken and can drift on a future dep bump; pinAlgorithm::HS256explicitly so the protocol contract is greppable and stable. Setvalidate_exp = true(already implicit) and add a 30sleewayto match the Bunyip RS verifier.Mint side now stamps
iss = "mokosh-server",aud = "mokosh-server", andnbf = iaton every access + refresh token. The new fields land onJwtClaimswith#[serde(default)]so any in-flight legacy token that lacks them still deserializes - no rolling-deploy 401 storm.iss / aud validation is NOT pinned in this PR. Flipping it on today would 401 every legacy access + refresh token in flight (they were minted without the claims) and force a re-login storm. The follow-up ticket flips strict validation after the rolling refresh-TTL window (~30 days post-merge) has rotated every live token through the new mint path.
JWT_SECRET length floor (32 bytes outside dev) already exists in src/main.rs (PMS-499); no change needed.
#MAPPS-334