Skip to main content

Caller identity and roles

The API validates Microsoft Entra JWT signature, issuer, audience, expiry, and required claims, including roles. Protected routes return HTTP 401 for missing or invalid tokens and HTTP 403 when the caller lacks an allowed role. The current POST /v1/admin/orders role dependency accepts either Admin or Customer, despite the route name and description. Treat this as an authorization decision to review before production use. Customer-only reads of another customer’s claim return HTTP 404. The assessment workflow requires two distinct reviewer IDs when the proposed refund amount exceeds 500. It waits at most seven days for the required approvals.

Azure identities and secrets

The repository includes Azure infrastructure and runtime configuration for managed identity and service access. Verify actual assignments in the target environment. Runtime secret categories include Stripe keys, webhook signing secret, Azure service settings, and a Functions key. Keep local values in ignored configuration files and deployed secrets in approved secret storage. The Stripe webhook uses Stripe-Signature verification instead of Entra bearer authentication. Do not log tokens, SAS URLs, secret values, or raw authorization headers.

Local-only identity

When APP_ENV=local and no bearer token is supplied, the API returns a synthetic identity with Customer, Reviewer, and Admin roles. Never use local mode in a deployed environment.