Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Mango HTTP API

Mango is the identity and authorization service. It issues and validates tokens, enforces RBAC, manages users/orgs/teams/roles/tasks, serves audit verification, and bridges revocation events to Sol.

The generated OpenAPI document is available at GET /openapi when the deployment enables it; both /openapi and /metrics are loopback or bearer-gated.

Conventions

JSON request/response bodies. A non-object JSON body is rejected with 400 before auth. Auth is a bearer token (Authorization: Bearer) or the Sol-issued service token for service-to-service calls. Pagination uses /page/<route> variants and a documented envelope envelope. Every mutation writes an audit row; secrets are never logged. Rate limits are per-IP and per-account; failed authentication is the only path that spends the account limiter.

Health and readiness

MethodPathNotes
GET/healthLiveness + dependency data
GET/readyReadiness, including the schema/DB probe
GET/metricsLoopback/bearer-gated; always registered
GET/openapiConditional on the deployment lever

Authentication

MethodPathPurpose
POST/auth/loginUsername/password login; sets session cookies on success
POST/auth/logoutRevokes the token and clears cookies
POST/auth/validateValidates a token; returns identity + permissions
POST/auth/service-tokenMints a scoped service token (TTL and live-token caps apply)
GET/auth/service-tokensLists live service tokens (self; admin with ?user_uuid=)
POST/auth/revocationsService-token revocation feed (service tokens only)
POST/auth/change-passwordPassword change with lockout/rate limits
POST/auth/accounts/:uuid/lockAdmin unlock
POST/auth/users/:uuid/tokensRevoke all tokens for a user
POST/auth/tokens/:id/revokeRevoke one token
POST/auth/users/:uuid/ldap-tombstoneClear a revalidation tombstone (audited)

Orchestrator lease

MethodPathPurpose
POST/orchestrator/leaseAcquire/renew the orchestration lease (heartbeat is a verdict on this route)
POST/orchestrator/lease/takeoverTake over the lease under the takeover authority

Users, orgs, roles, tasks

ResourcePaths
UsersGET/POST /users, GET/PUT/DELETE /users/:uuid, GET /users/page/:n, GET /users/:uuid/tasks, GET /users/:uuid/permissions
OrgsGET/POST /orgs, GET/PUT/DELETE /orgs/:uuid, GET /orgs/page/:n
TeamsGET/POST /orgs/:org/teams, GET/PUT/DELETE /orgs/:org/teams/:team, GET /orgs/:org/teams/page/:n
RolesGET/POST /roles, GET/PUT/DELETE /roles/:uuid, GET /roles/page/:n, GET/PUT/DELETE /teams/:team/roles/:role
TasksGET/POST /tasks, GET/PUT/DELETE /tasks/:uuid, GET /tasks/page/:n, POST /tasks/:uuid/assign/:assignee
MembershipGET/PUT/DELETE /orgs/:org/users/:user, GET/PUT/DELETE /teams/:team/users/:user
Cost/usageGET/PUT /teams/:team/cost-centers, GET/PUT /teams/:team/members/:user/caps, GET /teams/:team/usage-attribution

The exact method set per route is in the OpenAPI document; mutations are RBAC-gated and audit-logged.

Audit

MethodPathPurpose
POST/api/mango/audit-archiveIngest a batch of audit events from Sol (HMAC over exact bytes; idempotent row ids)

Mango maintains its own HMAC-chained audit_logs table with a signed checkpoint anchor and a retention floor. Operators verify with Audit.verify_integrity; a truncated head/tail, sequence rewind, or invalid checkpoint is a typed verdict.

Revocation bridge

Mango publishes token.revoked events to Sol over the bridge (HMAC v2 wire, freshness window + nonce replay guard). Sol clears its auth cache on receipt and resyncs on reconnect and every 60 seconds.

Errors

Mango uses a typed error envelope. A dependency outage returns 503, never a bare 500. Auth failures are enumeration-resistant.

Next

Authentication flow RBAC scopes Mango configuration Security model