ibexharness
DocsBlogReleasesRoadmap
GitHub
ibexharness

Documentation

Auth gRPC (ValidateToken, ValidateAgent)Health and metricsChat completions (Phase 1 stub)Errors
API Reference›Auth gRPC (ValidateToken, ValidateAgent)
API Reference

Auth gRPC (ValidateToken, ValidateAgent)

Internal AuthService RPCs consumed by the proxy — not exposed on the public internet in Phase 1.

The auth service exposes ibex.auth.v1.AuthService on IBEX_GRPC_PORT (default 9091). The proxy is the primary caller in Phase 1. Management RPCs (CreateToken, RevokeToken, ListTokens) exist but are out of scope for this page — see milestone 1.1.4 in the roadmap.

Internal only

Do not expose port 9091 to the public internet. Production uses mTLS on the internal mesh. Contract policy: ADR-0006.

Service definition

protobuf
service AuthService {
  rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
  rpc ValidateAgent(ValidateAgentRequest) returns (ValidateAgentResponse);
}

Source: packages/proto/proto/ibex/auth/v1/auth.proto

ValidateToken

Called on every protected proxy request before the handler reads the body. No caller metadata is required on the hot path.

RPC: ibex.auth.v1.AuthService/ValidateToken

Parse and verify a bearer PAT; return tenant context on success.

Request

ParameterTypeDescription
access_tokenRequiredstring
Full bearer value from Authorization header (e.g. ibex_pat_…). Never log in implementations.

Response (success)

ParameterTypeDescription
org_idRequiredstring (uuid)
Organization scope for RLS and rate-limit keys.
permissionsRequiredint64
Permission bitmap — see ADR-0009 and packages/permissions.
agent_idstring (uuid)
Optional: agent_id, user_id, token_id, expires_at when present on token.

gRPC status codes

gRPC codeMeaning
OKToken valid
UnauthenticatedMissing, malformed, expired, or revoked token
InternalPostgres or hashing failure (logged server-side)
DeadlineExceededExceeded proxy-side validate budget

Proxy maps transport failures to HTTP 503 SERVICE_DEGRADED. See Errors.

ValidateAgent

Called after ValidateToken on protected routes. Confirms X-IBEX-Agent-ID belongs to the token org and is active.

RPC: ibex.auth.v1.AuthService/ValidateAgent

Request

ParameterTypeDescription
agent_idRequiredstring (uuid)
Value from X-IBEX-Agent-ID header.
org_idRequiredstring (uuid)
Org from ValidateToken response — never from the URL alone.

Response (success)

FieldTypeDescription
agent_iduuid stringEcho of verified agent
org_iduuid stringEcho of verified org
statusstringactive, paused, suspended, or archived

gRPC status codes

gRPC codeProxy HTTPIBEX code
OK200 (handler continues)—
PermissionDenied403AGENT_NOT_AUTHORIZED or AGENT_SUSPENDED
InvalidArgument400validation failure
Unavailable / transport error503AUTH_UNAVAILABLE

Cross-org agent lookups return PermissionDenied, not NotFound. Policy: ADR-0016.

Example (grpcurl)

bash
grpcurl -plaintext -d '{"access_token":"ibex_pat_…LOCALDEVELOPMENTONLY"}' \
  localhost:9091 ibex.auth.v1.AuthService/ValidateToken

Requires make db-seed, running auth, and make proto-gen stubs.

Related

  • Authentication — required HTTP headers
  • Errors — HTTP envelope for proxy-facing failures

Was this page helpful?

Edit on GitHub

Last updated on

PreviousIncident responseNextHealth and metrics

On this page

  • Service definition
  • ValidateToken
  • Request
  • Response (success)
  • gRPC status codes
  • ValidateAgent
  • Request
  • Response (success)
  • gRPC status codes
  • Example (grpcurl)
  • Related
0%