IF Commons GitHub

Identity access

0033Active

0033-identity-access · owner if · domain data

Requirements

FR-001checkpassing

The access module MUST require the identity core and hold the permission (unique by its key, with its risk, its side effect and the kinds that may hold it), the role (unique by key within its tenant, with the kinds that may hold it and whether it is privileged), a role's inheritance of another role (never of itself) and the permissions a role holds (once each).

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: each module names what it requires, a project composes only what it needs and gets no table of the others, and a module whose requirement is not listed is an error as a value

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-access/codes.ts, data/models/identity-access/concepts.ts, data/models/identity-access/mod.ts

Tests: passed: suite/identity.test.ts each module names what it requires, a project composes only what it needs and gets no tabl

FR-002checkpassing

A separation rule MUST say how many of a set of roles together are too many, and name its roles once each.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: on three engines any kind of principal holds roles once, roles inherit and are separated, attributes of any principal and resource are one value each, policies and relation tuples and the permissions they grant are unique

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-access/concepts.ts

Tests: passed: suite/identity.test.ts on three engines any kind of principal holds roles once, roles inherit and are separated,

FR-003checkpassing

A role assignment MUST grant one role to one principal of any kind in one tenant, with who granted it, how it came to be, its status and its time, and MUST be unique by a key made of the principal, the role, the tenant and the resource, so that it is not made twice where the resource is empty; and an invitation MUST name the roles it grants once each.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: on three engines any kind of principal holds roles once, roles inherit and are separated, attributes of any principal and resource are one value each, policies and relation tuples and the permissions they grant are unique; suite/identity.test.ts: on three engines invitations grant roles once, domains and policies and the audit chain keep what the model says, and a hash in the chain is unique

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-access/concepts.ts

Tests: passed: suite/identity.test.ts on three engines invitations grant roles once, domains and policies and the audit chain ke; passed: suite/identity.test.ts on three engines any kind of principal holds roles once, roles inherit and are separated,

FR-004checkpassing

An entitlement MUST say what feature a tenant may use, how much, until when and where it comes from.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: on three engines any kind of principal holds roles once, roles inherit and are separated, attributes of any principal and resource are one value each, policies and relation tuples and the permissions they grant are unique

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-access/concepts.ts

Tests: passed: suite/identity.test.ts on three engines any kind of principal holds roles once, roles inherit and are separated,

Out of scope

  • The operations that do the business of this module: a later specification, run by the operations runtime (0031).
  • How a decision is made from these tables: the decision engine is a later specification.

Edge cases

  • A kind of principal that has no table of its own in this module: it is held by the principal and its roles alone, per FR-001.
  • DuckDB loads this schema and can read it, and cannot update a row that another row refers to; operations that change principals, runs or delegations are for PostgreSQL and SQLite, per FR-001.

Assumptions

  • The application makes identifiers, hashes and timestamps; the database stores them and refuses what the constraints say.

Open questions

OQ-1open question

The constraints that governance cannot say (acyclic hierarchies, a subtype row only for a principal of its kind) are checks of the operations and of invariant queries, not of the schema.

Key entities

  • Access - what this module holds, as its requirements say.

Success criteria

SC-001success criterion

A project composes this module only when it needs it, and the database refuses what the requirements say it must refuse.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Cited by

Data, models/identity-access/codes, models/identity-access/concepts, models/identity-access/mod

Titles, headings, exports, tables, columns and requirements. Esc closes.