Skip to content

refactor: extract authentication orchestration to service layer#118

Merged
Besthope-Official merged 2 commits into
mainfrom
refactor/seperate-auth-logic-to-service
Feb 3, 2026
Merged

refactor: extract authentication orchestration to service layer#118
Besthope-Official merged 2 commits into
mainfrom
refactor/seperate-auth-logic-to-service

Conversation

@Besthope-Official
Copy link
Copy Markdown
Contributor

Related Issue

Closes #115

Summary of Changes

Extracted authentication orchestration logic from HTTP handlers to a dedicated service layer:

  • Created src/auth/service.py with AuthenticationService containing login, refresh, and logout methods
  • Refactored src/http/routers/auth.py - handlers now delegate to service (lines 41-66)
  • Pattern alignment - follows existing PermissionService and AuditService patterns (Repository+Service with dependency injection)

Service orchestrates UserManager, JWTStrategy, RefreshTokenManager, and AuditService. Handlers became thin wrappers (3-7 lines each). Business logic moved from presentation layer to service layer.

Breaking Changes

N/A

Checklist

  • Issue discussion completed before opening PR
  • Scope is small and focused (single feature/fix)
  • All functions have full type annotations
  • Async/await used for all I/O operations
  • Tests added for new behaviors

🤖 Generated with Claude Code

@Besthope-Official Besthope-Official merged commit fd6ab15 into main Feb 3, 2026
3 checks passed
@Besthope-Official Besthope-Official deleted the refactor/seperate-auth-logic-to-service branch February 3, 2026 11:29
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.

refactor: extract authentication orchestration to service layer

1 participant