You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Five JWT/storage/bootstrap messages hardcode a minimum that can drift from the enforced value. Derive their text from JWT_SECRET_MIN_LENGTH, preserving the single-line templates and the current validation behavior.
Use the shared constant in all five messages and in the auth module documentation.
Export the existing development fallback for its length guard, and hoist the bootstrap message so the guard checks the actual runtime value.
Add guards for message text, single-line templates, and the fallback's minimum length.
Testing
bun run test:unit -t 'minimum-length message guard': 0 passed / 3 failed before, 3 passed / 0 failed after. Temporarily setting JWT_SECRET_MIN_LENGTH to 48 produced 2 passed / 1 failed: all messages followed the new minimum, while the existing fallback correctly failed its length guard. Restored the constant before committing. The minimum remains 32, the fallback value is unchanged, and no cryptographic key size changes.
Full Linux validation used the repository's unchanged CI workflow on submitted commit a44413edcb448f151f05e29dcc3c9562ee14cd17: run and logs.
bun run test:coverage: 14,716 tests passed, all 392 core test files and 34 component isolation groups passed.
bun run coverage:check: 46,321 / 46,321 lines (100%).
Format, lint, typecheck, knip, README/chart/channel/security drift guards, application/library builds, package type-resolution checks, Helm lint, and Go launcher checks passed.
The fork run's overall status is red solely because SonarCloud Analysis lacks the upstream token/project access. All test/build jobs passed. CLAUDE.md explicitly excludes SonarCloud from required checks, and the upstream workflow skips it for fork PRs. Upstream required workflows still need normal maintainer approval.
Full validation ran on GitHub-hosted Linux: this Windows host cannot run the container-based checks because Docker Desktop fails at inference-manager initialization, and its native full component runner encounters SQLite cleanup EBUSY. No complete native-Windows pass is claimed.
Checklist
Issue acceptance criteria checked; actual validation results recorded above.
Full tests and the 100% line-coverage gate passed on the submitted commit.
Diff reviewed; no database-provider changes requiring the provider triad.
Additional Notes
AI-assisted implementation, review, and validation. This branch starts independently from main and contains only this issue's change.
CI follow-up
The fork-run SonarCloud 401 is tracked in #732 and fixed by #733. The inherited condition admitted fork-owned pushes and fork-local PRs to the canonical SonarCloud project. The dedicated CI fix run now succeeds: all nine executable test/build jobs pass, and SonarCloud is scoped to the canonical repository. That run tests CI fix commit 80a318b; this PR's exact-head verification remains the original run linked above, whose nine executable jobs passed. Upstream Actions still await maintainer approval.
Checked against #672. All four "Done when" items hold, and I widened the last one: no literal minimum survives anywhere in src/, not just in the three files the issue named.
Three things I measured that are worth telling you:
The guard catches all three drift shapes, not only the one the issue asked for. JWT_SECRET_MIN_LENGTH = 48 turns the fallback guard red, as you reported; reverting one message to a literal 32 turns the source guard red; and making a message stop quoting the constant without writing a digit turns two of the three red.
The refactor is behaviour-preserving. I rendered all five constants and diffed them against the old literals: byte-identical at 32, so no operator-visible text changed. That is the right property for a change like this and it is easy to lose by accident.
Exporting DEV_FALLBACK_SECRET does not widen the package API, because auth-env is not re-exported from src/exports. knip is clean too, so the two test-only exports do not read as dead code.
One observation, take it or leave it: expect(templates).toHaveLength(5) pins a magnitude, so a sixth correctly written message would turn it red. It does buy completeness in exchange, which the first test alone does not give you, so it is a fair trade rather than a mistake.
For context and not an ask: README.md, .env.example and five files under docs/ still write the minimum as text, so the same drift lives on outside these three files. That is outside this issue and I am tracking it.
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
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.
Description
Five JWT/storage/bootstrap messages hardcode a minimum that can drift from the enforced value. Derive their text from
JWT_SECRET_MIN_LENGTH, preserving the single-line templates and the current validation behavior.Type of Change
Related Issue
Closes #672
Changes Made
Testing
bun run test:unit -t 'minimum-length message guard': 0 passed / 3 failed before, 3 passed / 0 failed after. Temporarily settingJWT_SECRET_MIN_LENGTHto 48 produced 2 passed / 1 failed: all messages followed the new minimum, while the existing fallback correctly failed its length guard. Restored the constant before committing. The minimum remains 32, the fallback value is unchanged, and no cryptographic key size changes.Full Linux validation used the repository's unchanged CI workflow on submitted commit
a44413edcb448f151f05e29dcc3c9562ee14cd17: run and logs.bun run test:coverage: 14,716 tests passed, all 392 core test files and 34 component isolation groups passed.bun run coverage:check: 46,321 / 46,321 lines (100%).The fork run's overall status is red solely because SonarCloud Analysis lacks the upstream token/project access. All test/build jobs passed. CLAUDE.md explicitly excludes SonarCloud from required checks, and the upstream workflow skips it for fork PRs. Upstream required workflows still need normal maintainer approval.
Full validation ran on GitHub-hosted Linux: this Windows host cannot run the container-based checks because Docker Desktop fails at inference-manager initialization, and its native full component runner encounters SQLite cleanup
EBUSY. No complete native-Windows pass is claimed.Checklist
Additional Notes
AI-assisted implementation, review, and validation. This branch starts independently from
mainand contains only this issue's change.CI follow-up
The fork-run SonarCloud 401 is tracked in #732 and fixed by #733. The inherited condition admitted fork-owned pushes and fork-local PRs to the canonical SonarCloud project. The dedicated CI fix run now succeeds: all nine executable test/build jobs pass, and SonarCloud is scoped to the canonical repository. That run tests CI fix commit
80a318b; this PR's exact-head verification remains the original run linked above, whose nine executable jobs passed. Upstream Actions still await maintainer approval.