jevb
ce4326766a
fix: resolve all golangci-lint issues blocking CI server build
...
Fix 70+ errcheck violations by adding explicit error discards (`_ =`)
for unchecked return values across test helpers and deferred Close()
calls. Remove unused `senderID` field from broadcastMsg and unused
`defaultCleanupMaxWindow` const. Apply De Morgan's law, remove empty
branch, and simplify redundant type declaration per staticcheck.
2026-03-17 08:09:52 +01:00
jevb
9c1d99683c
fix: address PR review findings (issues #9-#14)
...
- Fix capacity over-allocation and use strings.Builder in getReactionsBatch (#9 )
- Replace `any` types and cache Tauri invoke in window-state.ts (#10 )
- Remove custom `contains` helper, fix NilHub tests to pass nil (#11 )
- Add nil guards before hub method calls in admin handlers (#12 )
- Run golangci-lint v2: modernize interface{}/any, range-over-int loops,
remove dead code, fix errcheck, add .golangci.yml config (#13 )
- Add 23 client unit test suites (694 tests), exclude Tauri-coupled
files from coverage, achieve 80%+ threshold (#14 )
Closes #9 , closes #10 , closes #11 , closes #12 , closes #13 , closes #14
2026-03-17 04:11:04 +01:00
jevb
b7dd6eabe9
feat: implement Phase 2 auth & security with TDD
...
- auth/session: 256-bit crypto-random tokens, SHA-256 hashing for storage
- auth/password: bcrypt cost 12, strength validation (8-72 chars)
- auth/ratelimit: sliding-window RateLimiter with lockout, thread-safe
- db/models: User, Session, Invite, Role types
- db/auth_queries: full user/session/invite CRUD with in-memory test coverage
- api/middleware: AuthMiddleware (Bearer token), RequirePermission (bitfield),
RateLimitMiddleware (X-Real-IP, Retry-After header)
- api/auth_handler: POST register/login, POST logout, GET me
- Generic errors — username existence never revealed
- Rate limits: 3/min register, 5/min login, lockout after 10 failures
- api/invite_handler: create/list/revoke behind MANAGE_INVITES permission
- bluemonday sanitization on all user-supplied string fields
Test coverage: auth 90.9%, db 84.4%, api 80.9%
2026-03-14 20:52:11 +01:00