Skip to content
State: Draft

ADR#3086429157

authorizationnamingtaxonomyiamspicedb

GCP-aligned authorization vocabulary with SpiceDB ​

Context ​

ADR#8779742261 reserves principal for an authenticated actor and ADR#1394819661 chooses resource for a governed thing. Neither defines how actions, permissions, relations, relationships, grants, and roles differ.

GCP IAM is the reference for product-facing vocabulary: principals receive roles on resources through role bindings in allow policies. AWS IAM and Azure RBAC use related words with different meanings, especially role. The cloud terminology research records the first-party evidence and the differences this proposal preserves.

SpiceDB remains the implementation reference. Its schema distinguishes stored relationships from computed permissions, and its subject is broader than an individual caller. Treating these words as synonyms hides which facts applications write and which answers they check.

Resolution ​

Chosen option: use GCP-aligned IAM vocabulary for product contracts, retain the existing actor/resource definitions, and map explicitly to SpiceDB's native schema and API terms. This proposal defines language and naming; it does not select a hosting service, deploy SpiceDB, or specify an identity schema for every product.

Vocabulary ​

  • Principal: An authenticated identity acting through a governed surface. A human or service account can be a principal. Example: The identity making an API request.
  • Service account: A non-human identity used by a workload or automation. Its role bindings determine its access; the account is not itself a permission collection. Example: deployment-worker.
  • Impersonation: An authorized caller acting as a service account through credentials issued for that account. The caller and effective principal remain distinguishable. Example: A maintainer obtains short-lived credentials for deployment-worker.
  • Resource: The governed thing against which access is evaluated, identified by type and ID. Example: document:budget
  • Subject: The participant referenced on the subject side of a SpiceDB relationship or check. A relationship subject may reference an individual resource or a set selected by a subject relation. Example: principal:alice, group:finance#member
  • Action: An operation the application attempts. Its authorization contract identifies the permissions and resources to check. Example: Updating a document's content.
  • Permission: A named authorization requirement for an operation or predicate on a resource type. SpiceDB implements it as a computed set of subjects. Example: docs.documents.update, implemented as permission update = writer.
  • Relation: A named, typed schema slot describing how a resource relates to subjects. Example: relation writer: principal
  • Relationship: A stored fact filling a relation on a particular resource with a particular subject, optionally conditioned or expiring. Example: document:budget#writer@principal:alice
  • Grant: An access-conferring assignment, expressed through relationships and interpreted by permission expressions. Example: Assigning Alice as a document writer.
  • Role: A named collection of permissions, following GCP's meaning. It is not an assumable identity. Example: roles/docs.documentReader includes docs.documents.get.
  • Role binding: An association of a role with one or more identity selectors on a resource, optionally subject to a condition. Example: Bind Document Reader to the finance group's members on the budget document.
  • Allow policy: The resource's collection of role bindings and policy metadata. Example: The budget document's reader and writer bindings.
  • Policy: A named set of access rules. Use allow policy for grants and deny policy or limit policy when discussing those different mechanisms. Schema expressions implement policy; a relationship is not itself an entire policy.
  • Condition: An expression constraining when a binding grants access. A SpiceDB caveat can implement a condition; the terms name different layers.
  • Caveat: A named SpiceDB expression attached to a relationship that conditions whether the relationship contributes to a check. Example: Access valid only within an allowed network.
  • Authorization context: Inputs used to evaluate conditions for a check, distinct from identity and stored assignments. Example: The request's verified network address.
  • Capability: A general product ability in prose. It is not a separate authorization primitive or a synonym for a stored permission. Example: A product's sharing capability.

principal names the actor; subject names a position in the authorization model. A group reference is not thereby an authenticated principal. The same resource may appear on either side of different relationships. Products MUST NOT rename SDK fields such as subject or object_type merely to match domain prose; external namespaces retain their native spelling.

GCP also calls groups and sets of identities principals. This ADR preserves the narrower actor meaning in ADR#8779742261. Use identity selector for the single identity, group membership, or set selected by a role binding. This is our boundary term, not a claim that GCP uses it as a replacement for principal. Prefer principals over GCP's legacy members spelling when discussing identities; reserve member for actual group membership and preserve external API fields unchanged.

Existing hierarchy ADRs use “per capability” to mean per governed ability. At the SpiceDB boundary, products MUST identify the concrete permission that implements each such ability. This use of capability does not introduce bearer tokens or an object-capability security model.

Service accounts are identities; roles are permission collections ​

Products MUST use service account for a non-human identity and role for a collection of permissions. Say “impersonate a service account” and “grant a role”; MUST NOT call a permission collection an assumable identity or describe impersonation as assuming a role.

Create a service account when a workload needs a distinct identity, independent lifecycle, or an identity that authorized callers can act as. Create or reuse a role when a set of permissions needs a name. Grant that role through a binding on the relevant resource. A service account can receive multiple roles, and a role can be granted to multiple service accounts or human principals. Products MUST NOT create one service account per role merely to represent a permission bundle.

A service account participates in different relationships:

  • As a principal, it receives roles on the resources it accesses.
  • As a resource, it has access rules governing who can manage or impersonate it. Permission to impersonate it is separate from the permissions it receives on other resources.

For example, deployment-worker is a service account. A Deployment Publisher role contains the permissions to publish releases. A binding grants that role to the account on a release repository. A separate binding permits a maintainer to impersonate that account. The maintainer can then obtain short-lived credentials and publish as deployment-worker. Another service account can receive the same Deployment Publisher role without sharing the identity or the impersonation binding.

For products supporting impersonation:

  • The credential issuer MUST authorize the caller to impersonate the target account before issuing credentials. Possessing a role that the target also holds MUST NOT confer impersonation permission.
  • Resource checks MUST use the effective service-account principal for impersonated requests. The caller's own roles are not implicitly added to that account's permissions.
  • Audit records MUST distinguish the initiating caller from the effective principal and retain the delegation chain when present.
  • Credentials SHOULD be short-lived. Having a service account does not require distributing a long-lived account key.

In GCP specifically, Service Account Token Creator is a role granting credential-creation permissions on a target service account. Service Account User instead permits attaching the account to a workload resource; it does not by itself authorize minting short-lived impersonation credentials. These GCP role names explain the distinction; they do not register equivalent roles or implement credential issuance in this product.

SpiceDB can evaluate the permission to impersonate a target service account and the effective account's permissions on application resources. The identity or credential service authenticates callers and issues credentials; SpiceDB relationship writes alone do not switch identities or mint tokens.

Naming rules ​

  • Schema definitions SHOULD use singular nouns. Definitions, relations, and permissions SHOULD use lowercase snake_case, within SpiceDB's identifier constraints. A product MUST distinguish its principal types explicitly; the generic noun does not require one principal definition.
  • Service-account names SHOULD describe the workload or responsibility, such as deployment-worker, rather than the current role assignment. Account identifiers MUST remain separate from role identifiers; a role change does not rename the account. Product identity names need not use a GCP service-account email address or a SpiceDB type name.
  • Relations SHOULD be nouns that read as a relationship to the resource: reader, writer, member, parent. A relation MUST NOT be named permission, action, or access merely to avoid naming its meaning.
  • Public permission identifiers SHOULD follow GCP's common <service>.<resourceCollection>.<verb> form: docs.documents.get, docs.documents.list, docs.documents.create, docs.documents.update, docs.documents.delete. Use plural collection names and domain verbs such as approve where they convey a different operation. These names belong to the product's permission catalog, not Google's IAM registry.
  • Local SpiceDB operation permissions SHOULD be verbs: get, list, create, update, delete, share, manage_members. New names SHOULD NOT carry redundant can_, allow_, or _permission affixes. Use get for retrieving one resource and list for enumerating a collection; products MUST define the information each permits. Neither implies the other. Prefer update over edit for ordinary modification, without forcing domain operations into CRUD.
  • Computed predicates MAY use nouns such as effective_member. SpiceDB permits noun permissions; the noun/verb convention does not redefine every permission as an application action.
  • Products MUST record the mapping from each catalog permission to its SpiceDB resource type, local permission name, and check target. For example, docs.documents.get maps to document#get on the document; docs.documents.create can map to folder#create_document on its parent. Dotted catalog names MUST NOT be passed as local SpiceDB identifiers. Compound GCP-style verbs, such as getIamPolicy, use a recorded local spelling such as get_iam_policy. Application action names and transport method names MUST NOT be treated as permission names without mapping.
  • Role identifiers SHOULD follow roles/<service>.<roleName>, such as roles/docs.documentReader, with a separate human-readable title such as Document Reader. Role identifiers MUST NOT be used as principal IDs. Custom roles MUST have a documented owner namespace; this pattern does not import GCP's organization or project resource paths.
  • Products MUST define what broad names such as manage include. owner MUST NOT mean “all permissions” by convention. Ownership and mutation authority retain the meanings reserved by the existing ADRs; managed_by is not an access grant.

Bind roles, write relationships, check permissions ​

Describe product access management as “grant a role to these identities on this resource,” represented by a role binding in an allow policy. Describe the implementation as relationship writes and permission checks. A binding is a product contract; it need not correspond to a single relationship.

Products MUST document each role's permission collection and how a binding maps to SpiceDB. A fixed role may map to a relation such as reader; custom roles require an explicit model for their definitions and assignments. SpiceDB does not provide a native GCP role-binding or allow-policy document. This terminology does not imply arbitrary custom-role support.

Applications MUST authorize operations through named permissions rather than checking a caller's direct role or relation. SpiceDB can check relations, but doing so couples enforcement to one assignment path and can miss access computed through groups or inheritance.

Applications MUST NOT describe writing a permission as a SpiceDB data operation. Relationships are written against relations; permissions are computed from the schema and relationship graph. A parent relationship or group membership is a relationship, but is not necessarily itself a grant. Likewise, deleting one grant does not necessarily remove effective access: another permitted path may remain.

An action MAY require multiple permission checks. Creating a resource SHOULD check a create permission on an existing parent or collection; the resource being created does not yet exist. Products MUST document the target and permission for each protected action.

For example, this illustrative schema uses a unified principal type:

text
definition principal {}

definition group {
    relation member: principal
}

definition document {
    relation reader: principal | group#member
    relation writer: principal | group#member

    permission get = reader + writer
    permission update = writer
}

Writing document:budget#writer@group:finance#member assigns the finance group's members as writers. Checking document:budget#update for principal:alice asks whether Alice has effective update permission. A product can expose a Document Writer role containing docs.documents.get and docs.documents.update, with a binding mapped to the writer relation. SpiceDB has no separate role declaration in this schema. The role's permission collection, stored relationship, and computed permission each describe a different concept. The example does not implement list, custom roles, or the complete resource hierarchy.

With caveats, a check can return permission, no permission, or conditional permission with missing context. Applications MUST NOT treat conditional permission or a check error as authorization to proceed. Context that affects access MUST come from the authority responsible for that fact rather than being trusted merely because the caller supplied it.

This vocabulary preserves the existing hierarchy semantics: ADR#1917971986 combines grants by union and limits by intersection per governed ability. SpiceDB does not impose those product rules automatically; permission expressions must implement them explicitly.

Considered alternatives ​

  • Use AWS IAM's role meaning. Rejected because an assumable identity with temporary credentials is different from the permission collection this product needs to name.
  • Use Azure's role assignment and operation strings. Viable, but GCP's role binding and permission naming better match the requested language. Azure's scope remains useful for describing a grant's extent, not as a replacement for the existing resource parent field.
  • Use action, permission, and capability interchangeably. Rejected because an attempted operation, a computed authorization answer, and a general product ability have different responsibilities.
  • Call every subject a principal. Rejected because structural resources and subject sets can occupy the subject position without being callers.
  • Invent a storage-neutral name for every SpiceDB term. Rejected because translating relation and relationship into new synonyms makes schemas, SDK calls, and operational documentation harder to compare.

Consequences ​

Products can explain an access decision as a principal attempting an action on a resource, checked through permissions computed from relationships. Roles become explicit permission collections and bindings, with schema mappings rather than labels that silently stand for direct relations. Existing published identifiers are not renamed by this proposal; new authorization contracts follow the naming rules when this ADR is approved.

Except as otherwise noted, the content of this repository is licensed under the Creative Commons Attribution 4.0 License and code samples are licensed under the MIT