Expand description
Static group-to-capability configuration (issue #670).
A GroupConfig names a small set of built-in groups
(BUILTIN_ADMIN, BUILTIN_AGENT, BUILTIN_RESTRICTED) and
optionally merges operator-defined custom groups from
$ASTRID_HOME/etc/groups.toml. Each group confers a set of capability
patterns, evaluated left-to-right against the colon-delimited grammar
in crate::capability_grammar.
§Design contract
- Built-in groups are baked in. Attempting to redefine them in
groups.tomlis a hard error at load time. - Custom groups go through
validate_capabilityfor every entry. - The universal
*pattern is reserved for the built-inadmingroup. Custom groups may grant it only by explicitly opting in viaunsafe_admin = trueon that group; otherwise it’s rejected at load. - Missing
groups.toml→ built-ins only (the single-tenant default). - Malformed TOML, unknown fields, or duplicate group names are hard errors — this fails the kernel boot, which is intentional.
GroupConfig::getreturningNonefor a name referenced by a principal profile is not an error here; the caller (CapabilityCheck) treats it as fail-closed and logs awarn!.
Structs§
- Group
- A named set of capability patterns.
- Group
Config - The frozen group-to-capability map consumed by
CapabilityCheck.
Enums§
- Group
Config Error - Errors raised when loading or validating a
GroupConfig.
Constants§
- BUILTIN_
ADMIN - Canonical name of the built-in administrator group.
- BUILTIN_
AGENT - Canonical name of the built-in agent group (self-scoped capabilities).
- BUILTIN_
RESTRICTED - Canonical name of the built-in restricted group (no capabilities).
Type Aliases§
- Group
Config Result - Result alias for
GroupConfigoperations.