All user endpoints require authentication with ROLE_USER. Users authenticate via Indy proof verification at
/login/user.Dashboard
GET /user/dashboard
Displays the user’s main dashboard with document list from Hyperledger Fabric. Authentication: Required (ROLE_USER) Response: HTML view Model Attributes:displayName: User’s full nameidType: User’s ID typeidNumber: User’s ID numberemail: User’s emaildocs: List of documents from Fabric ledgertotpEnabled: Boolean indicating if TOTP is activetotpConfirmedAtHuman: Timestamp of TOTP confirmation
list-docs.js script
Reference: UserController.java:55
Document Viewing
Document URLs use HMAC-signed parameters to prevent unauthorized access. The
SignedUrlService generates time-limited URLs for document viewing and downloading.GET /user/docs/view/
Views a document inline (e.g., in browser or modal). Authentication: Required (ROLE_USER)Document ID from Fabric ledger
URL expiration timestamp (epoch seconds)
HMAC-SHA256 signature of the URL
Content-Disposition: inline
Validation:
- Document exists in Fabric for authenticated user
- File path is within allowed directories
- File exists and is readable
- Signed URL is valid and not expired
GET /user/docs/download/
Downloads a document as an attachment. Authentication: Required (ROLE_USER)Document ID from Fabric
URL expiration timestamp
HMAC signature
Content-Disposition: attachment
Reference: UserDocsController.java:86
Access Requests
GET /user/requests
Lists all access requests from issuers requesting permission to view user documents. Authentication: Required (ROLE_USER)Optional error message to display
requests: List of AccessRequest entities for this userccRequestsSignal: Signal string for change detection
PENDIENTE: Awaiting user decisionAPROBADA: User approvedRECHAZADA: User rejectedEXPIRADA: Expired
GET /user/requests/signal
Returns a lightweight signal for detecting changes in access requests. Authentication: Required (ROLE_USER) Response: JSONSuccess indicator
Signal string (format:
total|pending|approved|rejected|expired|maxId|maxRequestedAt|maxDecidedAt)POST /user/requests//approve
Approves an access request, granting the issuer permission to view selected documents. Authentication: Required (ROLE_USER)Access request ID
Optional note or comment (optional)
/user/requests
Validation:
- Request must be in PENDIENTE status
- Request must belong to the authenticated user
POST /user/requests//reject
Rejects an access request, denying the issuer permission. Authentication: Required (ROLE_USER)Access request ID
Optional reason for rejection
/user/requests
Validation:
- Request must be in PENDIENTE status
- Request must belong to the authenticated user
Multi-Factor Authentication (TOTP)
TOTP (Time-based One-Time Password) provides an additional security layer. Users can configure authenticator apps like Google Authenticator or Aegis.
GET /user/mfa/totp/status
Returns the current TOTP status for the authenticated user. Authentication: Required (ROLE_USER) Response: JSONWhether TOTP is enabled
Timestamp when TOTP was confirmed (formatted: yyyy-MM-dd HH:mm)
POST /user/mfa/totp/setup
Initiates TOTP setup by generating a secret and QR code URI. Authentication: Required (ROLE_USER) Response: JSONSuccess indicator
Suggested authenticator apps
Base32-encoded secret for manual entry
URI for QR code generation (format:
otpauth://totp/...)POST /user/mfa/totp/confirm
Confirms and activates TOTP by validating a code from the authenticator app. Authentication: Required (ROLE_USER)6-digit code from authenticator app
Success indicator
TOTP enabled status
Confirmation timestamp
POST /user/mfa/totp/disable
Disables TOTP for the authenticated user. Authentication: Required (ROLE_USER) Response: JSONSuccess indicator
TOTP enabled status (false)
Authentication
See Authentication for detailed information on the user login flow with Indy proof verification.Security
Allowed Document Directories
Documents are validated to be within configured base directories: Primary:app.user-files-base-dir (env: CCDIGITAL_FS_BASE_PATH)
Legacy: app.user-files-legacy-base-dir (env: APP_USER_FILES_LEGACY_BASE_DIR)
Default: /home/ccdigital/CCDigitalBlock/CCDigital
Signed URL Configuration
Document viewing and download URLs use HMAC-SHA256 signatures: Format:APP_SECURITY_SIGNED_URLS_SECRET: Secret key for HMAC (required)APP_SECURITY_SIGNED_URLS_TTL_SECONDS: URL lifetime (default: 300)
Session Management
These endpoints support client-side session timeout and keep-alive functionality.GET /user/session/keepalive
Keeps the user session alive during active UI interaction. Authentication: Required (ROLE_USER) Response: 204 No Content Usage: Called periodically by frontend JavaScript to prevent session timeout during active use. Reference: SessionActivityController.java:22GET /user/session/expire
Explicitly expires the user session due to client-detected inactivity. Authentication: Required (ROLE_USER) Response: 204 No Content Behavior:- Invalidates HTTP session
- Clears Spring Security context
- Forces user to re-authenticate
Password Recovery
Password recovery responses are intentionally generic to prevent user enumeration attacks.
POST /user/auth/forgot/verify
Initiates password recovery by sending a temporary code via email. Authentication: Not required (public endpoint) Request Body:User’s registered email address
ID type (CC, CE, TI, etc.)
ID number
Whether the request was processed (true if code sent)
Generic message for UI display
POST /user/auth/forgot/reset
Completes password recovery by validating the temporary code and updating the password. Authentication: Not required (public endpoint) Request Body:User’s email address
ID type
ID number
Temporary code received via email
New password (hashed with BCrypt before storage)
Whether password was successfully updated
Success or error message
APP_SECURITY_FORGOT_PASSWORD_CODE_LENGTH: Code length (default: 6)APP_SECURITY_FORGOT_PASSWORD_CODE_TTL_MINUTES: Code validity (default: 15)APP_SECURITY_FORGOT_PASSWORD_MAX_ATTEMPTS: Max attempts (default: 3)
