Repository navigation
feat!: run on Node 22 and stop logging tokens - #6
Merged
Merged
Conversation
- Upgrade to Node 22, express 5, jsonwebtoken 9; drop unused dependencies. - Never log issued tokens or decoded claims; keep method/path/status logs. - Require JWT_SECRET at startup instead of falling back to a built-in default. - Accept only HS256 on /verify; /sign keeps HS256 and the one-year exp. - Run the container as the non-root node user; add tests and CI that publishes ghcr.io/imkit/imkit-auth-server. Tokens stay compatible with 1.x: a test signs and verifies across jsonwebtoken 8 and 9 with the same secret. BREAKING CHANGE: the service exits if JWT_SECRET is not set. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/signno longer prints each issued token and/verifyno longer prints decoded claims. The request log keeps method, path, status and timing.JWT_SECRETis not set. Previously it fell back to the value inpackage.json, which is public in this repository./verifyaccepts only HS256 (the algorithm/signhas always used).nodeuser;.dockerignoreadded.node --test) and CI: test on every PR; onmaster, publishghcr.io/imkit/imkit-auth-server:{sha,master}.Compatibility
GET /,POST /verify(claims or 401),POST /sign({token, expirationDate}, one-yearexp).JWT_SECRET:5698e38e): new-signed → old/verify200, old-signed → new/verify200.Breaking change
Deployments that relied on the default secret must set
JWT_SECRETbefore upgrading, or the service will not start. Rotating to a new secret invalidates existing tokens.Test plan
npm test: 6 passingdocker buildand run: runs asnode, no token in logs, exits 1 withoutJWT_SECRET🤖 Generated with Claude Code