pub enum AdminRequestKind {
Show 14 variants
AgentCreate {
name: String,
groups: Vec<String>,
grants: Vec<String>,
},
AgentDelete {
principal: PrincipalId,
},
AgentEnable {
principal: PrincipalId,
},
AgentDisable {
principal: PrincipalId,
},
AgentList,
AgentModify {
principal: PrincipalId,
add_groups: Vec<String>,
remove_groups: Vec<String>,
},
QuotaSet {
principal: PrincipalId,
quotas: Quotas,
},
QuotaGet {
principal: PrincipalId,
},
GroupCreate {
name: String,
capabilities: Vec<String>,
description: Option<String>,
unsafe_admin: bool,
},
GroupDelete {
name: String,
},
GroupModify {
name: String,
capabilities: Option<Vec<String>>,
description: Option<Option<String>>,
unsafe_admin: Option<bool>,
},
GroupList,
CapsGrant {
principal: PrincipalId,
capabilities: Vec<String>,
unsafe_admin: bool,
},
CapsRevoke {
principal: PrincipalId,
capabilities: Vec<String>,
},
}Expand description
Typed admin request body — flattened into AdminKernelRequest on
the wire as { "method": "...", "params": {...} }.
Every variant is gated by the Layer 5 capability-enforcement preamble
through a sibling of
required_capability —
see required_capability_for_admin_request for the exact mapping.
Mutating variants are serialized through the kernel’s admin write lock
so concurrent callers cannot interleave on groups.toml / profile.toml.
Variants§
AgentCreate
Create a new agent identity. name must pass
PrincipalId::new. Defaults to
the built-in agent group when groups is empty.
Fields
AgentDelete
Delete an existing agent identity. The default principal is
rejected unconditionally. The principal’s home directory is NOT
scrubbed — reclamation is an ops concern.
Fields
principal: PrincipalIdPrincipal to delete.
AgentEnable
Set enabled = true on the target principal’s profile.
Fields
principal: PrincipalIdPrincipal to enable.
AgentDisable
Set enabled = false on the target principal’s profile.
In-flight invocations finish under the old value; new invocations
are refused.
Fields
principal: PrincipalIdPrincipal to disable.
AgentList
List every agent principal with a profile on disk.
AgentModify
Partial-update an existing agent’s group memberships. Built-in
group names (admin, agent, restricted) and custom groups
loaded from groups.toml are both accepted as identifiers;
validation that the named groups exist happens at the new
profile’s validate step. Mutations are idempotent — adding an
already-present group or removing an absent one is a no-op.
Fields
principal: PrincipalIdPrincipal to modify.
QuotaSet
Replace the target principal’s Quotas block. Values are
validated before the atomic profile write.
Fields
principal: PrincipalIdPrincipal whose quotas are being set.
QuotaGet
Read the target principal’s current Quotas block.
Fields
principal: PrincipalIdPrincipal whose quotas are being read.
GroupCreate
Create a custom group, validated through the same rules the boot
loader applies to groups.toml.
Fields
GroupDelete
Remove a custom group. Built-in groups (admin, agent,
restricted) are rejected.
GroupModify
Partial-update a custom group. Every provided field replaces the corresponding field on the existing group. Built-ins are rejected.
Fields
GroupList
List every group (built-in + custom) with its capability set.
CapsGrant
Append capability patterns to the principal’s grants vec. Does
NOT clear matching revokes — revoke precedence is preserved.
Fields
principal: PrincipalIdPrincipal receiving the grants.
unsafe_admin: boolRequired when capabilities contains the universal *
pattern. Mirrors the unsafe_admin rail on
Self::GroupCreate / Self::GroupModify so an
individual grant cannot escalate a principal to universal
admin without an explicit acknowledgement.
CapsRevoke
Append capability patterns to the principal’s revokes vec. Safe
to call on caps the principal does not currently hold
(pre-emptive revoke).
Fields
principal: PrincipalIdPrincipal losing the capabilities.
Trait Implementations§
Source§impl Clone for AdminRequestKind
impl Clone for AdminRequestKind
Source§fn clone(&self) -> AdminRequestKind
fn clone(&self) -> AdminRequestKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more