Skip to main content

Authorization API Reference

Keymate exposes a gRPC-based Authorization API for fine-grained access control decisions. This API implements the Zanzibar model, allowing applications to check permissions based on relationship tuples.

Scope

This reference covers the public-facing Authorization API that external applications use to:

  • Evaluate authorization decisions (Check, BatchCheck)
  • Query accessible objects (ListObjects, ListUsers)
  • Manage relationship tuples (Read, Write)
  • Inspect permission graphs (Expand)
note

Internal platform services (User Management, Audit, Event Hub) use separate APIs not documented here. This page focuses on the authorization endpoints available to integrating applications.

Definitions

TermDescription
StoreIsolated authorization data container for a tenant
TupleA relationship record: user:aliceviewerdocument:budget
RelationThe type of relationship (e.g., viewer, editor, owner)
ObjectThe resource being accessed (e.g., document:budget-2024)
UserThe entity requesting access (user, group, or service account)
Authorization ModelSchema defining valid object types, relations, and inheritance rules
UsersetA computed set of users derived from relations and conditions

Core Methods

MethodDescription
CheckEvaluate a single authorization decision
BatchCheckEvaluate multiple authorization decisions in one call
ReadRead relationship tuples matching a filter
WriteCreate or delete relationship tuples
ExpandExpand a userset to see the permission graph
ListObjectsList all objects a user can access with a given relation
ListUsersList all users who have a given relation to an object

Store Management Methods

MethodDescription
CreateStoreCreate a new authorization store for a tenant
GetStoreRetrieve store metadata
ListStoresList all stores
DeleteStoreDelete a store and all its data

Authorization Model Methods

MethodDescription
ReadAuthorizationModelRetrieve a specific authorization model version
WriteAuthorizationModelDeploy a new authorization model
ReadChangesRead the changelog of tuple modifications

Request & Response Messages

CheckRequest

message CheckRequest {
string store_id = ...;
string authorization_model_id = ...;
TupleKey tuple_key = ...;
Context context = ...;
}

message TupleKey {
string user = ...;
string relation = ...;
string object = ...;
}

CheckResponse

message CheckResponse {
bool allowed = ...;
string resolution = ...;
}

WriteRequest

message WriteRequest {
string store_id = ...;
string authorization_model_id = ...;
TupleKeys writes = ...;
TupleKeys deletes = ...;
}

ListObjectsRequest

message ListObjectsRequest {
string store_id = ...;
string authorization_model_id = ...;
string type = ...;
string relation = ...;
string user = ...;
Context context = ...;
}

ListObjectsResponse

message ListObjectsResponse {
repeated string objects = ...;
}

Minimal Example

A permission check to verify if a user can view a document:

// Request
CheckRequest {
store_id: "store_01H..."
tuple_key: {
user: "user:jane"
relation: "viewer"
object: "document:budget-2024"
}
}

// Response
CheckResponse {
allowed: true
resolution: "direct"
}

Invalid Example

Missing required store_id field:

// ❌ Invalid - store_id is required
CheckRequest {
tuple_key: {
user: "user:jane"
relation: "viewer"
object: "document:budget-2024"
}
}

// Error Response
{
code: INVALID_ARGUMENT
message: "store_id is required"
}

Authorization Flow


Allowed Values

Resolution Types

ValueMeaning
directUser has a direct tuple granting access
computedAccess derived from another relation (e.g., editor implies viewer)
conditionalAccess granted based on context conditions

Notes

warning

Rate Limits: The Authorization API enforces rate limits per store. Batch operations (BatchCheck) are more efficient than multiple single Check calls.

tip

Best Practice: Use ListObjects for UI filtering (show only accessible items) and Check for enforcement at access time.


Used By

  • ReBAC — Relationship-Based Access Control concept
  • FGA Engine Overview — Fine-grained authorization engine component details