Liking cljdoc? Tell your friends :D

boundary.user.shell.http

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.

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.
raw docstring

create-interceptor-contextclj

(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.
sourceraw docstring

create-session-handlerclj

(create-session-handler user-service)

POST /api/sessions - Create session using interceptor pipeline.

POST /api/sessions - Create session using interceptor pipeline.
sourceraw docstring

create-user-handlerclj

(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.
sourceraw docstring

delete-user-handlerclj

(delete-user-handler user-service)

DELETE /api/users/:id - Delete user using interceptor pipeline.

DELETE /api/users/:id - Delete user using interceptor pipeline.
sourceraw docstring

extract-observability-servicesclj

(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.
sourceraw docstring

get-user-handlerclj

(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.
sourceraw docstring

invalidate-session-handlerclj

(invalidate-session-handler user-service)

DELETE /api/sessions/:token - Invalidate session using interceptor pipeline.

DELETE /api/sessions/:token - Invalidate session using interceptor pipeline.
sourceraw docstring

list-users-handlerclj

(list-users-handler user-service)

GET /api/users - List users using interceptor pipeline.

GET /api/users - List users using interceptor pipeline.
sourceraw docstring

login-handlerclj

(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.
sourceraw docstring

mfa-disable-handlerclj

(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.
sourceraw docstring

mfa-enable-handlerclj

(mfa-enable-handler mfa-service)

POST /api/auth/mfa/enable - Enable MFA after verification.

POST /api/auth/mfa/enable - Enable MFA after verification.
sourceraw docstring

mfa-setup-handlerclj

(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.
sourceraw docstring

mfa-status-handlerclj

(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.
sourceraw docstring

normalized-api-routesclj

(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
sourceraw docstring

normalized-web-routesclj

(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
sourceraw docstring

update-user-handlerclj

(update-user-handler user-service)

PUT /api/users/:id - Update user using interceptor pipeline.

PUT /api/users/:id - Update user using interceptor pipeline.
sourceraw docstring

user-error-mappingsclj

User module specific error type mappings for RFC 7807 problem details.

User module specific error type mappings for RFC 7807 problem details.
sourceraw docstring

user-routes-normalizedclj

(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:

  • :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

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
sourceraw docstring

validate-session-handlerclj

(validate-session-handler user-service)

GET /api/sessions/:token - Validate session using interceptor pipeline.

GET /api/sessions/:token - Validate session using interceptor pipeline.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close