mcl_core_org_member (mcl_core v1.0.0)

View Source

Is this node an admitted member of this org? Cached, for a subscriber.

macula verifies who SIGNED a publication (the publisher in a delivery's meta), not who may publish on a topic: any node in the realm can publish on any topic, whatever org its name carries. A service that must hear only an org's own nodes (a keeper hearing its speakers, a mind hearing the news sensor) asks this about the delivery's publisher. The answer is the realm's own: macula:org_member/4 reads the chain a Providers-desk admission publishes and a revocation tombstones.

A MEMBER IS CACHED UNTIL THE CHAIN EXPIRES, AND NO LONGER. The realm reissues a delegation every 10 minutes with a 30-minute life, so a revoked node is heard for at most that long, and a node on the hot path costs no lookup per fact.

A REFUSAL IS CACHED TOO, BRIEFLY. Without it a stranger publishing in a loop would turn each of its facts into two DHT lookups by this service: the filter would be the amplifier. One minute, and at most ?MAX_ENTRIES entries, so a crowd of strangers cannot grow the table without bound; past the cap a refusal is simply not remembered.

"COULD NOT FIND OUT" IS NEVER CACHED and never reads as a refusal: a station roll empties the record stores for under a minute, and a service that read that as a revocation would go deaf to its own org during every roll.

Summary

Functions

The cached check, with the lookup passed in, so the cache's rules are tested without a mesh. Lookup(Org, NodeId) answers as macula:org_member/4.

Whether NodeId (the 32-byte node id a delivery names as publisher) is an admitted member of Org in this service's realm.

Types

answer/0

-type answer() :: {ok, non_neg_integer()} | {error, {not_a_member | unavailable, term()}}.

Functions

checked(Org, NodeId, Now, Lookup)

-spec checked(binary(), <<_:256>>, integer(), fun((binary(), <<_:256>>) -> answer())) -> answer().

The cached check, with the lookup passed in, so the cache's rules are tested without a mesh. Lookup(Org, NodeId) answers as macula:org_member/4.

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Other, State)

init(_)

org_member(Org, NodeId)

-spec org_member(binary(), <<_:256>>) -> answer().

Whether NodeId (the 32-byte node id a delivery names as publisher) is an admitted member of Org in this service's realm.

start_link()