Expand description
Local group membership: GroupGraph, the DB-backed store, and closure resolution
Local group membership: the groups/group_members tables (migration v10,
rust/ingestion/src/sql_migration.rs), a whole-table snapshot cache (crate::groups::DbGroupsSource)
mirroring crate::db_audience_grants::DbAudienceGrantsSource, and crate::groups::GroupGraph, the
in-memory closure resolver over a loaded snapshot.
A group_members.member row is a selector in exactly the vocabulary
audience_grants.selector uses (*, user:<email>, group:<name>), so nesting is the
group: arm of the same predicate rather than a special case – see crate::groups::GroupGraph::closure.
Structs§
- DbGroups
Config - Cache-TTL knob for
DbGroupsSource, read from env with a default. - Group
Graph - A loaded, in-memory snapshot of the
groups/group_memberstables, and the closure resolver over it. Sync and infallible once built: every method here is a walk over an already-loaded snapshot, never a query. - Groups
Loader SnapshotLoaderfor thegroups/group_memberstables.
Constants§
- ADMINS_
GROUP - The reserved group whose membership is admin-ness –
AuthContext::is_adminis exactly “does this caller’s closure contain this name”.
Functions§
- is_
valid_ group_ name trueifnameis a valid group name:[A-Za-z0-9_-]{1,255}– the same charsetis_valid_audienceuses, checked in bytes, so a group name is URL-safe and a distinct kind of thing from an email.
Type Aliases§
- DbGroups
Source - The whole-table snapshot cache described in the module doc comment.