feat: auto-generate sidecar secret + cache hash lookup (#338)#339
Merged
Conversation
- Sidecar secret auth middleware with bcrypt verification - Integrated with rate limiter backoff (#336) - Auto-generated 256-bit secret (no manual input) - Secret shown once with copy button, never retrievable again - Cached getSidecarSecretHash() with invalidation on set/clear - Admin UI exempt from sidecar check Closes #281, closes #338 All tests passing (164), lint clean.
luthien-m
approved these changes
Feb 25, 2026
Collaborator
luthien-m
left a comment
There was a problem hiding this comment.
Clean and minimal. Exactly what the issue asked for.
Reviewed:
db.js— cache with invalidation on set/clear,_resetSidecarCache()for testing ✅settings.js— manual input replaced withrandomBytes(32).toString("hex"), returns JSON for one-time display ✅settings.ejs— "Enable" / "Regenerate" / "Clear" flow, secret shown once with copy button and warning ✅- CI all green (build, test, lint) ✅
Minor: Secret display HTML is duplicated in both EJS branches (configured vs not). Could be a partial, but not worth blocking on.
LGTM 👍
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.
Closes #338
Changes
1. Auto-generate secret (no manual input)
crypto.randomBytes(32)2. Cache
getSidecarSecretHash()/api/*requestsetSidecarSecret()andclearSidecarSecret()_resetSidecarCache()exported for testingTesting
Reviewer: @luthien-m