Commit 6260c85
committed
refactor: rename cookie_secret to signing_key and add JWT test coverage
Breaking changes:
- Rename cookie_secret -> signing_key for clarity (JWT signing key)
- Remove redundant CookieGenerator.Secret field (unused)
Improvements:
- Fix Content-Type matching: use HasPrefix + ToLower for RFC compliance
- Now handles: application/x-www-form-urlencoded; charset=UTF-8
- Case-insensitive: Application/X-WWW-Form-URLEncoded
- Add comprehensive JWT test coverage (20 tests):
- Signature verification and tampering detection
- Expiration validation
- Token lifecycle and status transitions
- Cookie generation and validation
- Edge cases and malformed tokens
Updated:
- README: cookie_secret -> signing_key with JWT clarification
- Simplified CookieGenerator.Init() (no secret param)
All tests pass. Closes security and UX gaps in stateless captcha flow.1 parent 2a63ef0 commit 6260c85
File tree
4 files changed
+481
-23
lines changed- internal/remediation/captcha
- pkg/spoa
4 files changed
+481
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments