Skip to main content

Client Onboarding, Authentication & Policy Configuration

Before a client application can upload or query documents, an administrator provisions a Client Tenant (clients table) mapped to a dedicated Big Bucket, configures authentication (API Keys and/or JWT), and optionally sets prefix-based Path Governance Policies.


1. Provisioning a Client Tenant (Multi-Cloud or Local Disk)​

Each client tenant is bound to one storage backend (LOCAL_DISK, AWS_S3, GCP_GCS, or AZURE_BLOB) and receives a unique 256-bit KEK (Key Encryption Key) wrapped by the configured KMSProvider.

Option A: Local Disk (LOCAL_DISK)​

Ideal for local development, on-premises deployments, or Kubernetes PersistentVolumes:

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme-local",
"name": "Acme Local Portal",
"cloud_provider": "LOCAL_DISK",
"bucket_name": "arkhos-acme-local-bucket",
"ensure_bucket": true
}'

Option B: Amazon S3 or S3-Compatible (AWS_S3)​

Works with AWS S3, MinIO, Ceph RGW, or Cloudflare R2:

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme-s3-prod",
"name": "Acme Production S3 Vault",
"cloud_provider": "AWS_S3",
"bucket_name": "arkhos-acme-s3-bucket",
"ensure_bucket": true,
"provider_config": {
"region": "us-east-1",
"endpoint": "http://127.0.0.1:9000",
"access_key_id": "arkhosminio",
"secret_access_key": "arkhosminiosecret",
"use_path_style": true
}
}'

Option C: Google Cloud Storage (GCP_GCS)​

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme-gcs-prod",
"name": "Acme GCS Vault",
"cloud_provider": "GCP_GCS",
"bucket_name": "arkhos-acme-gcs-bucket",
"ensure_bucket": true,
"provider_config": {
"endpoint": "http://127.0.0.1:4443/storage/v1/",
"access_id": "service-account@acme-project.iam.gserviceaccount.com"
}
}'

Option D: Azure Blob Storage (AZURE_BLOB)​

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"slug": "acme-azure-prod",
"name": "Acme Azure Blob Vault",
"cloud_provider": "AZURE_BLOB",
"bucket_name": "arkhos-acme-azure-container",
"ensure_bucket": true,
"provider_config": {
"account_name": "devstoreaccount1",
"account_key": "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==",
"endpoint": "http://127.0.0.1:10000/devstoreaccount1"
}
}'

2. Dual Authentication Setup (API Keys & JWT)​

Client applications can authenticate requests to Arkhos using either API Keys (X-API-Key: ak_live_...) or Bearer JWTs (Authorization: Bearer <jwt>).

Issuing Scoped & Prefix-Restricted API Keys​

You can issue multiple API keys per tenant, restricting each key to specific scopes and logical folder prefixes:

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients/${CLIENT_ID}/api-keys" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "finance-department-writer",
"scopes": ["files:read", "files:write", "presign:download"],
"allowed_path_prefixes": ["finance/2026/", "reports/public/"]
}'
ScopePermitted Client Operations
files:readGET /v1/files, GET /v1/files/{id}, GET /v1/files/{id}/content (including Range requests)
files:writePOST /v1/files/upload
files:deleteDELETE /v1/files/{id}?shred=false|true
presign:uploadPOST /v1/files/presign-upload, POST /v1/files/{id}/confirm
presign:downloadPOST /v1/files/{id}/presign-download
audit:readGET /v1/audit-logs?verify=true
One-Time Secret Display

Arkhos never stores plaintext API keys in PostgreSQL — only their SHA-256 hash (key_hash). Store the returned "api_key": "ak_live_..." securely in your application's secrets manager upon creation.

Configuring Tenant JWT Authentication (HS256, RS256, ES256 / JWKS)​

If your application or Identity Provider (Keycloak, Auth0, AWS Cognito, Microsoft Entra ID) issues JWTs, configure jwt_config during client creation:

{
"slug": "acme-jwt-tenant",
"name": "Acme OIDC Tenant",
"cloud_provider": "LOCAL_DISK",
"bucket_name": "arkhos-acme-jwt-bucket",
"ensure_bucket": true,
"jwt_config": {
"enabled": true,
"issuer": "https://auth.acme.corp/",
"audience": "arkhos-vault",
"algorithms": ["RS256", "ES256"],
"jwks_url": "https://auth.acme.corp/.well-known/jwks.json",
"scopes_claim": "scope",
"prefixes_claim": "allowed_prefixes"
}
}

When a client sends Authorization: Bearer <JWT>, Arkhos verifies the signature, issuer, audience, and expiration, and extracts the allowed scopes and path prefixes directly from the token claims.


3. Prefix-Based Path Governance Policies (Longest-Prefix Match)​

You can enforce automatic governance rules on specific folders inside a client's Big Bucket via POST /v1/admin/clients/{id}/path-policies. When a file is uploaded, Arkhos evaluates the most specific matching prefix (longest-prefix match):

curl -sS -X POST "http://127.0.0.1:8080/v1/admin/clients/${CLIENT_ID}/path-policies" \
-H "Authorization: Bearer ${ARKHOS_ADMIN_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"path_prefix": "finance/invoices/",
"max_size_bytes": 10485760,
"allowed_mime_types": ["application/pdf", "text/xml", "application/xml"],
"default_retain_days": 365,
"auto_expire_days": 1825,
"auto_shred_on_expire": true
}'
  • max_size_bytes: Rejects any upload under finance/invoices/ larger than 10 MB (HTTP 413).
  • allowed_mime_types: Validates the actual file Magic Bytes (first 512 bytes) against the allowlist (HTTP 415 on mismatch).
  • default_retain_days: Automatically applies a 365-day WORM Legal Hold (retain_until) even if the client doesn't pass retain_days.
  • auto_expire_days & auto_shred_on_expire: Automatically sets expires_at and instructs the background Reconciler Worker to crypto-shred the file once expired.