RFC-0048 · Reference catalog
Versioned draft snapshot
RFCs, reference catalogs, and evidence reflect Spec 3b2e3e7a114fb826b1445d39a48756b8fff629cd. Counts and pending/status notes belong to that snapshot. Read the dated project update for later progress.
Source repositories are private during staging. Links marked “repository access required” need access to the linked repository.
Generated reference catalog. This page renders structured Lean data for RFC-0048: defined terms, diagnostics, dependencies, and invariants. It does not establish proof coverage or runtime conformance. The authored narrative lives in
RFC-0048.This page is generated from the
lean/Gnomon/Spec/module for RFC-0048. Edit that source and regenerate this catalog.
Title: Principal and Session Model
Status: draft
Owners: Runtime, Security
Diagnostic range: M48000-M48099
Depends on: RFC-0001, RFC-0006, RFC-0007, RFC-0008, RFC-0010, RFC-0024, RFC-0033, RFC-0036, RFC-0037, RFC-0038, RFC-0039, RFC-0040, RFC-0042
Proof citations in source: 16 / 16. Standalone proof verification is pending.
Definitions
| Term | Meaning |
|---|---|
| Anonymous principal | The well-known Principal representing unauthenticated calls. |
| Authentication | The process that resolves an inbound request’s credentials to a Principal. |
| Authorization | The process that checks whether a Principal’s Session permits a specific operation. |
| Principal | The stable identity of a caller. A user, service account, internal system component, or the special anonymous identity. |
| Session | A bound runtime context: a Principal + tenant + capabilities + timing + scope. The unit of authentication state. |
| Session token | An opaque or signed string that lets a caller resume a previously-authenticated Session across requests. |
Diagnostics
| Code | Severity | Description |
|---|---|---|
M48010 | Error | Attempt to create a system-kind principal from user code; reserved kind |
M48011 | Error | Principal id is malformed (not opaque text) or empty |
M48020 | Error | Cross-tenant session escalation attempted |
M48021 | Error | Session tenantId does not match the request’s claimed tenant |
M48030 | Error | Operation requires capabilities not in the session’s scopes; access denied |
M48031 | Error | Sub-session attenuation produced empty scope set; invocation cannot proceed |
M48040 | Error | Inbound credential of unsupported kind |
M48041 | Error | Authentication failed: credential does not resolve to any active Principal |
M48050 | Error | Inbound request missing credential and API does not permit anonymous access |
M48051 | Error | Inbound credential present but malformed; reject without anonymous fallback |
M48060 | Error | Refresh attempted on a session past its refreshableUntil deadline |
M48061 | Error | Refresh attempted with widening scopes; refresh MUST NOT widen |
M48070 | Defect | Session token equals a Principal id; tokens MUST NOT be principal handles |
M48080 | Warning | Session bound to an inactive Principal; treating session as expired |
M48090 | Error | Anonymous principal modification attempted (anonymous is immutable) |
Dependency neighborhood
graph LR
nRFC_0048["RFC-0048"]
nRFC_0001["RFC-0001"]
nRFC_0048 --> nRFC_0001
nRFC_0006["RFC-0006"]
nRFC_0048 --> nRFC_0006
nRFC_0007["RFC-0007"]
nRFC_0048 --> nRFC_0007
nRFC_0008["RFC-0008"]
nRFC_0048 --> nRFC_0008
nRFC_0010["RFC-0010"]
nRFC_0048 --> nRFC_0010
nRFC_0024["RFC-0024"]
nRFC_0048 --> nRFC_0024
nRFC_0033["RFC-0033"]
nRFC_0048 --> nRFC_0033
nRFC_0036["RFC-0036"]
nRFC_0048 --> nRFC_0036
nRFC_0037["RFC-0037"]
nRFC_0048 --> nRFC_0037
nRFC_0038["RFC-0038"]
nRFC_0048 --> nRFC_0038
nRFC_0039["RFC-0039"]
nRFC_0048 --> nRFC_0039
nRFC_0040["RFC-0040"]
nRFC_0048 --> nRFC_0040
nRFC_0042["RFC-0042"]
nRFC_0048 --> nRFC_0042
Invariants
- Anonymous sessions are not persisted and live only for the duration of the request. (enforced by: runtime)
- Cross-tenant session escalation is prohibited; a different tenant requires a new authentication. (enforced by: runtime)
- Refresh MUST NOT widen scopes; it only extends expiresAt. (enforced by: runtime)
- Session scopes MUST NOT be widened during the session’s lifetime. (enforced by: runtime)
- Session scopes MUST be a subset of the bound principal’s scopes. (enforced by: runtime)
- Session tokens MUST NOT be the same as principal ids. (enforced by: runtime)
- Sub-session authority is the intersection of resolved parent capabilities and the called operation’s required capabilities. (enforced by: runtime)
- The anonymous principal has stable id anonymous and only the kernel-owned public scope across runtime restarts. (enforced by: runtime)
- The audit log MUST record principalId, tenantId, and authMethod for every operation. (enforced by: runtime)
- system-kind principals MUST NOT be created from user code. (enforced by: runtime)
Normative Statements
Statements are structured source data. Proof citations, where present, have not passed a standalone Gnomon proof gate.
Authentication
- MUST — A recognized invalid credential MUST stop authenticator dispatch without anonymous fallback.
- MUST — Inbound credentials of an unsupported kind MUST produce M48040. (proof citation:
rfc0048_b20_grounded; verification pending) - MUST_NOT — User code MUST NOT use the system installer principal at runtime. (proof citation:
rfc0048_b36_grounded; verification pending)
Capability Attenuation
- MUST — Every capability resolution MUST be filtered through the active session. (proof citation:
rfc0048_b3_grounded; verification pending) - MUST_NOT — Once attenuated, a session’s scopes MUST NOT be widened without fresh authentication. (proof citation:
rfc0048_b0_grounded; verification pending)
Compatibility and Migration
- MUST — Runtime image MUST seed the system.installer Principal during boot before any module install runs. (proof citation:
rfc0048_b23_grounded; verification pending) - MUST — Sessions MUST record authMethod. (proof citation:
rfc0048_b11_grounded; verification pending)
Invariants
- MUST — Audit log MUST record principalId, tenantId, and authMethod for every operation. (proof citation:
rfc0048_b14_grounded; verification pending) - MUST — The anonymous principal MUST retain the stable id anonymous and only the kernel-owned public scope across runtime restarts.
- MUST_NOT — system-kind principals MUST NOT be user-created.
Principal
- MUST — Anonymous principals MUST hold only the kernel-owned public scope.
- MUST_NOT — Public capabilities MUST NOT authorize mutating or tenant-scoped operations.
- MUST_NOT — Runtime MUST NOT impose a structural format on Principal id. (proof citation:
rfc0048_b27_grounded; verification pending) - MUST_NOT — User code MUST NOT create system-kind principals.
Session
- MUST_NOT — Session scope MUST NOT be widened during the session’s lifetime. (proof citation:
rfc0048_b9_grounded; verification pending) - MUST — Session scope MUST be recorded at creation. (proof citation:
rfc0048_b34_grounded; verification pending) - MUST — Session scopes MUST be a subset of the bound principal’s scopes. (proof citation:
rfc0048_b31_grounded; verification pending) - MUST_NOT — Sub-session expiresAt MUST NOT exceed the parent’s expiresAt.
- MUST — Sub-session scopes MUST be a subset of the parent’s scopes. (proof citation:
rfc0048_b16_grounded; verification pending)
Session Lifecycle
- MUST — Every privileged request MUST consult authoritative session or revocation state.
- MUST — Expired sessions MUST be rejected with core.errors.Unauthorized. (proof citation:
rfc0048_b18_grounded; verification pending) - MUST_NOT — Refresh MUST NOT widen scopes. (proof citation:
rfc0048_b25_grounded; verification pending) - MUST — Refresh attempts on expired sessions MUST produce M48060. (proof citation:
rfc0048_b29_grounded; verification pending) - MUST — Requests with no token to APIs not permitting anonymous access MUST be rejected (M48050). (proof citation:
rfc0048_b39_grounded; verification pending)
Session Token
- MUST_NOT — Session tokens MUST NOT be principal IDs.
- MUST — Token lifetime MUST be bounded by the session’s expiresAt.
- MUST — Token modification MUST be detectable (signed or opaque server-side reference).
Linked References
| Direction | Target |
|---|---|
| Depends on | RFC-0001 |
| Depends on | RFC-0006 |
| Depends on | RFC-0007 |
| Depends on | RFC-0008 |
| Depends on | RFC-0010 |
| Depends on | RFC-0024 |
| Depends on | RFC-0033 |
| Depends on | RFC-0036 |
| Depends on | RFC-0037 |
| Depends on | RFC-0038 |
| Depends on | RFC-0039 |
| Depends on | RFC-0040 |
| Depends on | RFC-0042 |