FC/IS Shell Layer - User module service coordination.
This is the SHELL layer in Functional Core / Imperative Shell architecture. The shell coordinates between:
Shell responsibilities:
The shell does NOT contain business logic - that lives in core.* The shell does NOT handle database operations - that lives in persistence.*
FC/IS Shell Layer - User module service coordination. This is the SHELL layer in Functional Core / Imperative Shell architecture. The shell coordinates between: - Pure functional CORE (boundary.user.core.*) - I/O SHELL persistence (boundary.user.shell.persistence) Shell responsibilities: 1. Coordinate calls between core and persistence layers 2. Manage external dependencies (time, UUIDs, logging) 3. Handle all side effects and I/O operations 4. Orchestrate transaction boundaries 5. Transform between external and internal representations The shell does NOT contain business logic - that lives in core.* The shell does NOT handle database operations - that lives in persistence.*
Per-request audit context bound by HTTP/CLI interceptors. Expected keys: :actor-id, :actor-email, :ip-address, :user-agent.
Per-request audit context bound by HTTP/CLI interceptors. Expected keys: :actor-id, :actor-email, :ip-address, :user-agent.
(create-user-service user-repository
session-repository
audit-repository
validation-config
auth-service)(create-user-service user-repository
session-repository
audit-repository
validation-config
auth-service
cache)Create a user service instance with injected repositories, validation config, and auth service.
Args: user-repository: Implementation of IUserRepository session-repository: Implementation of IUserSessionRepository audit-repository: Implementation of IUserAuditRepository validation-config: Map containing validation policies and settings auth-service: Implementation of IAuthenticationService cache: (optional) Implementation of ICache for session/user caching
Returns: UserService instance
Example: (def service (create-user-service user-repo session-repo audit-repo validation-cfg auth-svc)) (def service (create-user-service user-repo session-repo audit-repo validation-cfg auth-svc cache))
Create a user service instance with injected repositories, validation config, and auth service. Args: user-repository: Implementation of IUserRepository session-repository: Implementation of IUserSessionRepository audit-repository: Implementation of IUserAuditRepository validation-config: Map containing validation policies and settings auth-service: Implementation of IAuthenticationService cache: (optional) Implementation of ICache for session/user caching Returns: UserService instance Example: (def service (create-user-service user-repo session-repo audit-repo validation-cfg auth-svc)) (def service (create-user-service user-repo session-repo audit-repo validation-cfg auth-svc cache))
(current-timestamp)Get current timestamp. Shell layer responsibility for time dependency.
Get current timestamp. Shell layer responsibility for time dependency.
(generate-secure-token)Generate cryptographically secure random token for sessions. This is a shell layer responsibility as it involves external randomness.
Generate cryptographically secure random token for sessions. This is a shell layer responsibility as it involves external randomness.
(generate-user-id)Generate UUID for new users. Shell layer responsibility.
Generate UUID for new users. Shell layer responsibility.
(with-audit-context audit-context f)Execute f with audit context bound for downstream service calls.
Execute `f` with audit context bound for downstream service calls.
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 |