feat(backend): jwt middleware, login with redis rate limit, /auth/me

This commit is contained in:
2026-09-04 23:58:26 +08:00
parent a2f202ada6
commit bc88cabc47
9 changed files with 341 additions and 8 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import (
"time"
"booklib/internal/config"
"booklib/internal/redispkg"
)
func testCfg() *config.Config {
@@ -14,7 +15,7 @@ func testCfg() *config.Config {
}
func TestHealthz(t *testing.T) {
r := NewRouter(testCfg())
r := NewRouter(testCfg(), nil, redispkg.New(""))
req := httptest.NewRequest(http.MethodGet, "/api/healthz", nil)
w := httptest.NewRecorder()
r.ServeHTTP(w, req)