Skip to main content

Module member_ref

Module member_ref 

Source
Expand description

MemberRef: the only way a member identity reaches Joy’s output (ADR-042).

In anonymous mode the at-rest member key is an opaque id (m-<short>). The concept (Pseudonyme Identitäten und Löschrecht) requires that this id is never user-visible: every Joy output that names a member resolves it to a name (if members.yaml carries one) or the e-mail, and a path that cannot resolve requests authentication instead of printing the id.

The guarantee is bound to the type, not to each output path. A member id is wrapped in MemberRef; its [Display] and (in presentation mode) its Serialize yield the resolved value, never the raw id. Code that needs the raw id for an internal purpose (map lookup, verifier math) reaches for the explicit MemberRef::id. A forgotten output path therefore fails safe: it shows the resolved value (or an auth request), never the id.

Resolution reads from a thread-local MemberResolver installed once per command (see install). In open mode the resolver is a pass-through (the key is the e-mail). In anonymous mode it carries the decrypted members.yaml, or None when the viewer is not authenticated.

Structs§

MemberRef
A member identity that resolves to a display value on output and never exposes the raw at-rest id except via MemberRef::id.
MemberResolver
Resolves opaque member ids to a display value for the current command.

Constants§

AUTH_REQUIRED
Marker rendered when an opaque id cannot be resolved because members.yaml is not unlocked. Never the raw id (fail-safe direction).

Functions§

install
Install the resolver for the current command (call once at dispatch).
presentation_active
Whether serialization is currently in presentation mode (--json output). Lets a serialize_with on a map keyed by raw ids resolve its keys for output while keeping them raw on disk.
resolve_str
Resolve a raw member string for display against the installed resolver.
uninstall
Remove any installed resolver (mainly for tests).
with_presentation
Run f with serialization in presentation mode, so MemberRef serializes the resolved value instead of the raw id. Used by the --json emitter.