-
Notifications
You must be signed in to change notification settings - Fork 0
Add authentication endpoints to core service #215
Copy link
Copy link
Closed
Labels
architectureCross-service architectural design or reviewCross-service architectural design or reviewcomplexity:largeLarge scope: 200+ lines, multiple filesLarge scope: 200+ lines, multiple filesenhancementNew feature or requestNew feature or requestneeds-testsArea needs dedicated test coverageArea needs dedicated test coveragetriagedIssue has been triaged, ready for planning or implementationIssue has been triaged, ready for planning or implementation
Metadata
Metadata
Assignees
Labels
architectureCross-service architectural design or reviewCross-service architectural design or reviewcomplexity:largeLarge scope: 200+ lines, multiple filesLarge scope: 200+ lines, multiple filesenhancementNew feature or requestNew feature or requestneeds-testsArea needs dedicated test coverageArea needs dedicated test coveragetriagedIssue has been triaged, ready for planning or implementationIssue has been triaged, ready for planning or implementation
Context
The core service (#211) needs authentication endpoints for user login, registration, and session management. Sessions should be managed without requiring an external cache like Redis — instead use SQLite-backed session tokens.
Acceptance Criteria
POST /auth/registerendpoint:{ username, email, full_name, password }POST /auth/loginendpoint:{ username, password }or{ email, password }{ token, user, active_organization }POST /auth/logoutendpoint:Authorization: Bearer <token>headerGET /auth/meendpoint:sessionsSQLite table:token(TEXT, primary key, random 256-bit hex)user_id(UUID, foreign key to users)created_at(TEXT/datetime)expires_at(TEXT/datetime)agentd_common::error::ApiErrorfor error responses (401 Unauthorized variant needed)Notes
Unauthorizedvariant should be added toagentd_common::error::ApiErrorRelevant Files
crates/common/src/error.rs— needsUnauthorizedvariantcrates/orchestrator/src/api.rs— reference for API endpoint patternscrates/core/src/api/auth.rs,crates/core/src/storage/sessions.rs,crates/core/src/middleware/auth.rsDependencies