Commit Graph

2 Commits

Author SHA1 Message Date
yusing
b122d42a0b fix(test): correct test expectations and logic
Httptest and similar callers often leave Host unset; fall back to URL
for scheme, host, port, and addr substitution.

jsonstore drops the IsTest load short-circuit and duplicate loadNS map
registration; tests isolate storesPath. Skip MaxMind background updates
when IsTest. Tests restore APISkipOriginCheck, use app-scoped OIDC
state cookies, attach route context in middleware helpers, and use
locked buffers for concurrent log capture.
2026-04-19 14:40:22 +08:00
yusing
213e4a5cdb feat(auth): add CSRF protection middleware
Implement Signed Double Submit Cookie pattern to prevent CSRF attacks.
Adds CSRF token generation, validation, and middleware for API endpoints.
Safe methods (GET/HEAD/OPTIONS) automatically receive CSRF cookies, while
unsafe methods require X-CSRF-Token header matching the cookie value with
valid HMAC signature. Includes same-origin exemption for login/callback
endpoints to support browser-based authentication flows.
2026-03-19 14:55:47 +08:00