Overview
The Issuer Module enables authorized institutional entities (government agencies, banks, universities, etc.) to upload official documents for citizens and create access requests for approved documents. All uploads undergo mandatory review before becoming accessible.Person Search
Find citizens by ID type and number
Document Upload
Upload PDF documents with metadata and validation
Access Requests
Create requests to access approved documents
Document Viewing
View and download authorized documents
Security & Authentication
Role Required:ROLE_ISSUER
Access Path: /issuer/** and /login/issuer
Issuers are represented by the IssuingEntity entity and authenticated via IssuerPrincipal. The authenticated issuer’s ID is retrieved from the security context for authorization checks.
Controller: IssuerController (src/main/java/co/edu/unbosque/ccdigital/controller/IssuerController.java:67)
Key Features
Person Search
Issuers must first locate the citizen before uploading documents.Access Issuer Home
Navigate to the issuer dashboard at
/issuerEndpoint: GET /issuerController: IssuerController (src/main/java/co/edu/unbosque/ccdigital/controller/IssuerController.java:91)Search by Identification
Use the search form to find a person by:
- ID Type (CC, TI, CE, etc.)
- ID Number
POST /issuer/searchController: IssuerController (src/main/java/co/edu/unbosque/ccdigital/controller/IssuerController.java:132)If the person is not found, an error message is displayed. The person must be created by an administrator before documents can be uploaded.
Document Upload
Issuers can only upload document types allowed for their entity as defined inentity_document_definitions table.
Endpoint: POST /issuer/upload
Controller: IssuerController (src/main/java/co/edu/unbosque/ccdigital/controller/IssuerController.java:153)
Service: PersonDocumentService#uploadFromIssuer
Upload Requirements
Upload Workflow
Choose Document Type
Select from allowed document definitions for your issuing entity.Service:
DocumentDefinitionService#findAllowedByIssuerProvide Metadata
Fill in document details:
- Document type (from allowed list)
- Status (typically PENDING for review)
- Issue date
- Expiry date (optional)
Upload PDF File
Select and upload the PDF document file.The file undergoes:
- PDF format validation
- SHA-256 hash calculation
- Storage in person’s physical folder
- Database record creation
Form Data Structure
Form DTO:IssuerUploadForm
Access Request Management
Issuers can create access requests for approved documents and view authorized documents.Access request functionality is referenced in README.md section 3.2 with these endpoints:
GET /issuer/access-requests- List access requestsGET /issuer/access-requests/new- Create new requestGET /issuer/access-requests/{requestId}/documents/{personDocumentId}/view- View documentGET /issuer/access-requests/{requestId}/documents/{personDocumentId}/download- Download document
Creating Access Requests
Access requests allow issuers to formally request permission to view specific approved documents. Requirements:- Documents must be in
APPROVEDstatus - Request must specify which documents are needed
- User must approve the request before access is granted
access_requeststable stores request metadataaccess_request_itemstable links specific documents to requests- Requests have a status workflow (pending → approved/rejected)
Viewing Approved Documents
Once an access request is approved by the end user:- Request status changes to
APROBADA - Request must be within validity period
- Issuer can view and download the approved documents
- Access events are recorded for audit trail
- Access is validated via signed URLs (
SignedUrlService) - File paths are validated against allowed directories
- Access events are logged to Fabric ledger
Endpoint Reference
| HTTP Method | Endpoint | Description | Controller Line |
|---|---|---|---|
GET | /issuer | Issuer dashboard home | IssuerController.java:91 |
POST | /issuer/search | Search person by ID | IssuerController.java:132 |
POST | /issuer/upload | Upload document for person | IssuerController.java:153 |
GET | /issuer/access-requests | List access requests | README.md:149 |
GET | /issuer/access-requests/new | Create access request form | README.md:150 |
GET | /issuer/access-requests/{requestId}/documents/{personDocumentId}/view | View document | README.md:151 |
GET | /issuer/access-requests/{requestId}/documents/{personDocumentId}/download | Download document | README.md:152 |
Data Model
Key Entities
IssuingEntity (entities table)- Represents the issuer organization
- Links to entity users via
entity_userstable - Defines allowed document types via
entity_document_definitions
- Citizen identity record
- Created by administrators
- Links to documents via
person_documents
- Document metadata
- Links to person and document definition
- Tracks review status
- References physical file via
filestable
- Request for document access
- Links to entity and person
- Has approval workflow
- Links specific documents to requests
- Enables granular access control
Database Procedures
The issuer module leverages stored procedures for complex operations:sp_add_person_document- Atomic document creationsp_upload_file_path- File metadata persistencesp_upload_pdf_blob- Binary storage handling
Integration Points
PersonService
Provides person lookup and validation:PersonDocumentService
Handles document upload workflow:- Validates issuer permissions
- Enforces PDF-only validation
- Checks document definition authorization
- Persists file and metadata
- Sets initial review status
DocumentDefinitionService
Filters allowed document types per issuer:entity_document_definitions table
FileStorageService
Manages physical file operations:- Stores files in normalized folder structure
- Calculates SHA-256 hashes
- Validates file paths against security policies
- Base path configured via
CCDIGITAL_FS_BASE_PATH
PDF Validation Details
The issuer module implements three-layer PDF validation to ensure document integrity:Layer 1: Controller Pre-Check
Location:IssuerController#isPdfUpload (IssuerController.java:192)
Layer 2: Service Validation
Location:PersonDocumentService#uploadFromIssuer
- Validates file extension
- Checks MIME type
- Verifies PDF signature (
%PDFat file start) - Prevents non-PDF files from entering storage
Layer 3: Storage Integrity
Location:FileStorageService
- Calculates SHA-256 hash for tamper detection
- Stores hash in
filestable for verification - Validates file path security
Configuration
Key environment variables for the issuer module:Error Handling
Common Error Scenarios:| Error | Cause | Resolution |
|---|---|---|
| ”Persona no encontrada” | Person doesn’t exist in system | Contact admin to create person record |
| ”Solo se permite subir archivos PDF” | Non-PDF file upload attempt | Convert document to PDF format |
| Invalid document type | Document not allowed for issuer | Use only allowed document definitions |
| Permission denied | Issuer not authorized for document type | Contact admin to update permissions |
| File too large | Exceeds upload size limit | Compress PDF or split into multiple files |
Best Practices
- Person Verification: Always verify person details before uploading documents
- Document Quality: Ensure PDFs are clean, readable, and properly formatted
- Metadata Accuracy: Double-check issue dates and expiry dates before submission
- Access Requests: Only request access to documents necessary for your business purpose
- Timely Review: Monitor review status and follow up on pending documents
- Data Privacy: Handle citizen documents according to data protection regulations
Workflow Example
Upload Document
Select allowed document type, provide metadata, upload PDF file.Document enters PENDING review status.
Related Modules
- Admin Module - Person creation and document review
- End-User Module - Access request approval
