IBEX Harness
DocsBenchmarksBlogChangelogRoadmap
GitHub
IBEX Harness

Documentation

HTTP route inventoryAuth gRPC (ValidateToken, ValidateAgent)Health and metricsChat completionsErrors
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.

The auth service exposes ibex.auth.v1.AuthService on IBEX_GRPC_PORT (default 9091). The proxy is the primary caller. Management RPCs (CreateToken, RevokeToken, ListTokens) are available on the same service — see Issuing API keys.

Internal only

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

Service definition

Full AuthService surface from the proto (proxy hot path uses Validate*; token lifecycle uses Create/Revoke/List):

protobuf
service AuthService {
  rpc ValidateToken(ValidateTokenRequest) returns (ValidateTokenResponse);
  rpc ValidateAgent(ValidateAgentRequest) returns (ValidateAgentResponse);
  rpc CreateToken(CreateTokenRequest) returns (CreateTokenResponse);
  rpc RevokeToken(RevokeTokenRequest) returns (RevokeTokenResponse);
  rpc ListTokens(ListTokensRequest) returns (ListTokensResponse);
}

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

PreviousHTTP route inventoryNextHealth 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%