Expand description
AUTH-4: the caller’s view of a gated hub. AUTH-4 — the caller’s view: what a caller can discover of a gated hub is exactly what it can use.
A hub with a gate (DynamicHub::with_gate)
answers _info, its own schema / hash / hashes, and every
<activation>.schema from the caller’s View:
- anonymous (no principal): only the
publicmethods — the auth activation’s door (auth.providers,auth.login,auth.signup); - caller (signed in): only the methods whose grant some role the
caller holds lists (within its session’s ceiling), each with
held_on— where it is held; plus the public methods, and the methods every signed-in caller reaches (the auth activation’swhoami,logout,requires). A method the caller cannot use is absent, not marked; an activation left with none is absent too.
The hub’s own methods (call, hash, hashes, schema) are in every
view: they are how a client reaches anything at all. Each activation’s
schema entry stays beside its visible methods (introspection is open).
An activation’s declared roles are left out of a gated view (they name
methods the caller may not see); auth.roles answers them to whoever
holds it.
Hashes. Every schema in a view carries a hash of what it shows —
its methods (with held_on) and, for the hub, its children’s view
hashes — so two callers with identical holdings share a view hash, and
a client’s schema cache (synapse keeps IR by hash) never mixes two
callers’ views. The hub’s view hash is v-anon-<hex> for the anonymous
view and v-<hex> for a caller’s.
A hub without a gate never builds a view on the wire: _info and
every schema answer exactly as before. DynamicHub::view
there returns the whole hub as a ViewKind::Caller view whose hash is
the hub’s own.
Structs§
- View
- The hub as one caller may see it (AUTH-4).