Skip to main content
Version: 0.5.0

UNCEFACT Storage Adapter

The UNCEFACT Storage Service is the default storage service bundled with the Reference Implementation.

About​

The UNCEFACT Storage Service is a standalone service that provides public and private bucket-based storage for credentials, render templates, and other binary data. It supports encryption for private storage and returns URIs, multibase digests (digestMultibase), and decryption keys for stored items.

Supported Version​

The supported version of the UNCEFACT Storage Service is 4.0.0. The adapter also retains compatibility with the previous 3.x deployments via the apiVersion configuration option.

Environment Variables​

The following environment variables configure the connection between the Reference Implementation and a UNCEFACT Storage Service instance:

VariableDescriptionRequiredDefault
SYSTEM_STORAGE_BASE_URLBase URL of the storage serviceYeshttp://localhost:3334
SYSTEM_STORAGE_API_KEYAuthentication token for the storage service APINotest123
SYSTEM_STORAGE_ADAPTER_TYPEMust be set to UNCEFACT_STORAGEYesUNCEFACT_STORAGE
SYSTEM_STORAGE_SERVICE_NAMEDisplay name for this service instanceNoSystem Default Storage
SYSTEM_STORAGE_SERVICE_DESCRIPTIONDescription for this service instanceNo—
SYSTEM_STORAGE_API_VERSIONAPI version (MAJOR.MINOR). 4.0 targets storage service >= 4.0.0; 3.1.0 targets the legacy 3.x deployment.No4.0
SYSTEM_STORAGE_PUBLIC_BUCKETBucket name for public (unencrypted) storageYespublic-data
SYSTEM_STORAGE_PRIVATE_BUCKETBucket name for private (encrypted) storageYesprivate-data

The public and private bucket names can be the same if separate buckets are not required.

These variables are used during startup to seed the default storage service instance into the system tenant.

The storage service hands back URIs on its DOMAIN value (localhost in the bundled Compose file), so every Reference Implementation container must resolve that name. The bundled file maps localhost to the host gateway for ri and ri-worker. A separate Compose or Kubernetes deployment must provide the same reachability by mapping the name or setting the storage service's DOMAIN to a name its containers resolve.

Upload types the storage service must accept​

The storage service checks every multipart upload against its own ALLOWED_UPLOAD_TYPES list (set on the storage service, not on the Reference Implementation). Issuing a credential uses the JSON endpoint, which that list does not govern. Registering a credential received from a third party (Library API) also stores bodies as fetched through the multipart endpoint: an encrypted envelope it could not open (application/json), a body that is not a credential (its own content type, or application/octet-stream when the source sent none). The storage service must therefore allow application/json, application/octet-stream and text/plain in addition to the image, PDF and HTML types it ships with, which the Docker Compose files in this repository now set. A storage service that refuses a type answers the registration with STORAGE_FAILED marked not retryable, and the record says an operator must allow the content before a re-verify can store it. Allowing the type is what unblocks that recovery. A re-verification of a record left without a durable copy then fetches its source again and stores what it gets, so the record picks up the copy the registration could not write.

API Configuration Schema​

When creating or updating a UNCEFACT Storage service instance via the Services API, the config object must conform to the following schema:

FieldTypeRequiredDefaultDescription
baseUrlstring (URL)Yes—Base URL of the storage service (e.g., http://storage-service:3334)
apiKeystringNo—Authentication token for the storage service API. Sensitive — masked in API responses.
apiVersionstringNo4.0API version (MAJOR.MINOR) to use when communicating with the storage service. Mirrors the value reported in the service's version.json. 4.0 targets storage service >= 4.0.0; 3.1.0 is also accepted for 3.x deployments.
publicBucketstringYes—Bucket name for public (unencrypted) storage. Can be the same value as privateBucket.
privateBucketstringYes—Bucket name for private (encrypted) storage. Can be the same value as publicBucket.

Example:

{
"baseUrl": "https://storage.example.com",
"apiKey": "your-api-key",
"apiVersion": "4.0",
"publicBucket": "public-data",
"privateBucket": "private-data"
}