HTTP routing and handlers for user module - provides structured route definitions.
This namespace implements the REST API and Web UI for user and session management.
The module exports routes in a structured format {:api [...] :web [...] :static [...]} for composition by the top-level router, which applies appropriate prefixes:
API Endpoints (mounted under /api):
Web UI Endpoints (mounted under /web):
Static Assets (mounted at root):
All observability is handled automatically by interceptors.
HTTP routing and handlers for user module - provides structured route definitions.
This namespace implements the REST API and Web UI for user and session management.
Route Structure:
----------------
The module exports routes in a structured format {:api [...] :web [...] :static [...]}
for composition by the top-level router, which applies appropriate prefixes:
API Endpoints (mounted under /api):
- POST /api/users - Create user
- GET /api/users/:id - Get user by ID
- GET /api/users - List users (with filters)
- PUT /api/users/:id - Update user
- DELETE /api/users/:id - Soft delete user
- POST /api/sessions - Create session (login)
- GET /api/sessions/:token - Validate session
- DELETE /api/sessions/:token - Invalidate session (logout)
- POST /api/auth/login - Authenticate with email/password
Web UI Endpoints (mounted under /web):
- GET /web/users - Users listing page
- GET /web/users/new - Create user page
- GET /web/users/:id - User detail page
- POST /web/users - Create user (HTMX fragment)
- PUT /web/users/:id - Update user (HTMX fragment)
- DELETE /web/users/:id - Delete user (HTMX fragment)
Static Assets (mounted at root):
- GET /css/* - CSS assets
- GET /js/* - JavaScript assets
- GET /modules/* - Module-specific assets
- GET /docs/* - Documentation
All observability is handled automatically by interceptors.(create-interceptor-context operation-type user-service request)Creates interceptor context with real observability services and error mappings.
Creates interceptor context with real observability services and error mappings.
(create-session-handler user-service)POST /api/sessions - Create session using interceptor pipeline.
POST /api/sessions - Create session using interceptor pipeline.
(create-user-handler user-service)Create a new user using interceptor pipeline.
This version demonstrates the interceptor-based approach that eliminates manual observability boilerplate while providing comprehensive tracking.
Create a new user using interceptor pipeline. This version demonstrates the interceptor-based approach that eliminates manual observability boilerplate while providing comprehensive tracking.
(delete-user-handler user-service)DELETE /api/users/:id - Delete user using interceptor pipeline.
DELETE /api/users/:id - Delete user using interceptor pipeline.
(extract-observability-services user-service)Extracts observability services from user-service for interceptor context.
Note: Since service layer cleanup removed direct observability dependencies, the interceptor context will obtain these services from the system wiring.
Extracts observability services from user-service for interceptor context. Note: Since service layer cleanup removed direct observability dependencies, the interceptor context will obtain these services from the system wiring.
(get-user-handler user-service)GET /api/users/:id - Get user by ID using interceptor pipeline.
GET /api/users/:id - Get user by ID using interceptor pipeline.
(invalidate-session-handler user-service)DELETE /api/sessions/:token - Invalidate session using interceptor pipeline.
DELETE /api/sessions/:token - Invalidate session using interceptor pipeline.
(list-users-handler user-service)GET /api/users - List users using interceptor pipeline.
GET /api/users - List users using interceptor pipeline.
(login-handler user-service)POST /auth/login - Authenticate user with email/password using interceptor pipeline.
POST /auth/login - Authenticate user with email/password using interceptor pipeline.
(mfa-disable-handler mfa-service)POST /api/auth/mfa/disable - Disable MFA for authenticated user.
POST /api/auth/mfa/disable - Disable MFA for authenticated user.
(mfa-enable-handler mfa-service)POST /api/auth/mfa/enable - Enable MFA after verification.
POST /api/auth/mfa/enable - Enable MFA after verification.
(mfa-setup-handler mfa-service)POST /api/auth/mfa/setup - Initiate MFA setup for authenticated user.
POST /api/auth/mfa/setup - Initiate MFA setup for authenticated user.
(mfa-status-handler mfa-service)GET /api/auth/mfa/status - Get MFA status for authenticated user.
GET /api/auth/mfa/status - Get MFA status for authenticated user.
(normalized-api-routes user-service mfa-service)Define API routes in normalized format.
Args: user-service: User service instance mfa-service: MFA service instance
Returns: Vector of normalized route maps
Define API routes in normalized format. Args: user-service: User service instance mfa-service: MFA service instance Returns: Vector of normalized route maps
(normalized-web-routes user-service mfa-service config)Define web UI routes in normalized format (WITHOUT /web prefix).
NOTE: These routes will be mounted under /web by the top-level router. Do NOT include /web prefix in paths here.
Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map
Returns: Vector of normalized route maps
Define web UI routes in normalized format (WITHOUT /web prefix). NOTE: These routes will be mounted under /web by the top-level router. Do NOT include /web prefix in paths here. Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map Returns: Vector of normalized route maps
(update-user-handler user-service)PUT /api/users/:id - Update user using interceptor pipeline.
PUT /api/users/:id - Update user using interceptor pipeline.
User module specific error type mappings for RFC 7807 problem details.
User module specific error type mappings for RFC 7807 problem details.
(user-routes-normalized user-service mfa-service config)Define user module routes in normalized format for top-level composition.
DEPRECATED: Use user-routes-normalized instead for new code. This function returns routes in Reitit-specific format.
Returns a map with route categories:
Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map
Returns: Map with keys :api, :web, :static containing normalized route vectors
Define user module routes in normalized format for top-level composition. DEPRECATED: Use user-routes-normalized instead for new code. This function returns routes in Reitit-specific format. Returns a map with route categories: - :api - REST API routes (will be mounted under /api) - :web - Web UI routes (will be mounted under /web) - :static - Static asset routes (empty - served at handler level) Args: user-service: User service instance mfa-service: MFA service instance config: Application configuration map Returns: Map with keys :api, :web, :static containing normalized route vectors
(validate-session-handler user-service)GET /api/sessions/:token - Validate session using interceptor pipeline.
GET /api/sessions/:token - Validate session using interceptor pipeline.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |