Skip to content

feat(auth): add login, register, refresh, logout API endpoints [REN-88] - #108

Merged
Scott Graham (cheddarfox) merged 1 commit into
devfrom
REN-88-auth-api-endpoints
Mar 9, 2026
Merged

Scott Graham (cheddarfox) merged 1 commit into
devfrom
REN-88-auth-api-endpoints

Conversation

@cheddarfox

Copy link
Copy Markdown
Member

Summary

  • Add auth API endpoints: register, login, refresh, logout at /api/v1/auth/
  • Pydantic request/response schemas with validation (EmailStr, min_length, max_length)
  • Rate limiting via REN-70 limiters (login 5/min, register 10/min, refresh 3/min)
  • Audit logging for all auth events (no PII/tokens logged)
  • Logout is a placeholder pending REN-72 token revocation

Test plan

  • POST /api/v1/auth/register creates user and returns tokens
  • POST /api/v1/auth/register with duplicate email returns 409
  • POST /api/v1/auth/login with valid credentials returns tokens
  • POST /api/v1/auth/login with invalid credentials returns 401
  • POST /api/v1/auth/login with inactive account returns 401
  • POST /api/v1/auth/refresh with valid refresh token returns new tokens
  • POST /api/v1/auth/refresh with access token returns 401
  • POST /api/v1/auth/logout returns success message
  • ruff check passes

🤖 Generated with Claude Code

Add auth API routes at /api/v1/auth with Pydantic request/response
schemas, bcrypt password hashing, and JWT token issuance. Wire in
REN-70 rate limiters (login 5/min, register 10/min, refresh 3/min).
Audit-log all auth events via structlog without exposing PII or tokens.
Logout is a placeholder pending REN-72 token revocation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cheddarfox

Copy link
Copy Markdown
Member Author

ARCHitect Review — REN-88 ✅ APPROVED

4 endpoints (register/login/refresh/logout), rate limiters wired, anti-enumeration on login, token type guard on refresh, no PII logged. Solid auth implementation.

🤖 Generated with Claude Code

@cheddarfox
Scott Graham (cheddarfox) merged commit a0333d2 into dev Mar 9, 2026
15 of 17 checks passed
@cheddarfox
Scott Graham (cheddarfox) deleted the REN-88-auth-api-endpoints branch March 9, 2026 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant