Skip to main content

API caller identity

The v1 contract uses a workspace API key in the Authorization bearer header. Generate keys using a cryptographically secure source, show the secret only at creation and store a verification hash. Record the key identifier, workspace, permissions, creation time, expiry and revocation time separately from the secret. Never place keys in query strings or documentation examples. Require a valid key and enforce workspace ownership before reading a job, PDF or delivery record. Use these permissions as the server-side access model: A role may contain several permissions. No role can cross workspace boundaries. Return 401 for invalid credentials, 403 for an unauthorized action and 404 for a resource outside the workspace. Validate permissions on every request, including polling, pagination, download and email retry. These are implementation requirements for the v1 contract; the current HTTP registration does not establish this access model.

Portal credentials and workflow state

Portal credentials authenticate to the external device portal, not to the API. Use dedicated portal accounts limited to the required devices and read-only actions where supported. Resolve an approved workspace-to-portal mapping server-side. A caller-supplied portal URL or device ID is not proof of ownership. The current starter sends the request body and headers into Durable Functions. Before production, replace plaintext credentials in persisted workflow input with a protected credential reference. Resolve secrets only inside the worker, restrict access to its job and delete temporary credential material after completion or cancellation. Set a maximum credential-reference lifetime of 24 hours and fail safely when it expires. Do not persist bearer headers, browser cookies or portal passwords in orchestration output, custom status or exception text.

Runtime and deployment secrets

Use an approved managed secret store for provider passwords and any remaining connection strings. Prefer workload identity for storage access where supported. Separate runtime identity, deployment identity and administrator identity. Use environment variables only as the runtime interface to protected configuration. Do not bake production secrets into container images, source files or build arguments. The application reads AZURE_STORAGE_CONNECTION_STRING, EMAIL_SERVICE, EMAIL_USER and EMAIL_PASSWORD. Use distinct values in staging and production. Restrict the storage identity to required report containers and workflow-state operations. Limit the mail identity to the approved sender.

Rotation and revocation

Revoke a suspected exposed key immediately. Rotate portal, storage and mail credentials after exposure, account changes or provider security events. Use a 90-day maximum API-key lifetime as the service policy, with administrator-approved exceptions recorded. Support overlap during scheduled rotation, then verify the previous credential fails. A rollback must never restore an exposed credential. The repository contains committed storage and email credentials. Treat their invalidation as a release blocker; removing text from the latest file does not revoke the credential. Sources: src/functions/orchestrator_reporting.js, src/functions/shared/utils/blobStorageService.js and src/functions/shared/utils/sendEmailService.js. Secret lifecycle controls follow OWASP Secrets Management guidance.