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 service is exactly what it can use.
A service 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 service’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 service, 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 service’s view hash is v-anon-<hex> for the anonymous
view and v-<hex> for a caller’s. PERF-21: the service lists its children
by namespace, so a view hash is the same at every start of the same build,
and a cache keeps its schema across a restart.
A service without a gate never builds a view on the wire: _info and
every schema answer exactly as before. DynamicHub::view
there returns the whole service as a ViewKind::Caller view whose hash is
the service’s own.
Kept, not rebuilt (PERF-15). Building a view asks every activation for
its schema and the gate for every method — 150–520 ms on menger, on every
_info, hash and schema. A service keeps instead ([Cache]): what its
schemas show whoever asks ([Described]), built once per schema
generation — moved by every change to the service while it is built (a
mount) and by DynamicHub::schema_moved
after; and each view of it ([Shaped]), built once per view key — the
caller’s grants’ Fingerprint, or anonymous — and grants generation,
which every write that could change one of the gate’s answers moves
(BIDIR-8). Callers holding the same share one view. A view is kept as what
it decided — which methods, each held_on, and the hashes — not as copies
of the schemas, and is rebuilt from [Described] exactly as it was built.
A caller’s sign-in is asked whether it still stands on every ask (AUTH-11):
one that ended is anonymous at once.
Structs§
- View
- The service as one caller may see it (AUTH-4).