Malachi. Auth. AclRegistry
(malachi v0.22.7)
View Source
The pure state of per-topic ACLs (P5, decision 5-1A/2A/3A): allow-only grants of an operation on a
topic resource, keyed by username. The deterministic core replicated by Malachi.Auth.AclMachine over a
dedicated ra cluster, mirroring Malachi.Auth.UserRegistry.
A grant is {username, operation, resource} where operation is :produce or :consume and resource
is {:literal, topic} (an exact topic) or {:prefix, prefix} (any topic starting with prefix, the
Kafka prefixed-ACL model). Grants only allow: there are no deny rules; absence is denial (enforced in
strict mode by Malachi.Auth.Authorization). Pure: no clock, no config.
Summary
Functions
Applies a command, returning {new_state, reply}. Deterministic; ACLs need no time input.
Whether username has a grant for operation on topic (a matching literal or prefix resource).
Every command shape, mapped to the machine version that introduced it (see Malachi.Cluster.MachineVersion).
Every grant across all users as {username, operation, resource}.
The grants for username as {operation, resource} (empty if none).
An empty registry.
Parses a resource pattern string into a resource: a trailing * marks a prefix ("orders.*" →
{:prefix, "orders."}, "*" → {:prefix, ""} = all topics), otherwise a literal exact topic.
Renders a resource back to its pattern string (inverse of parse_resource/1).
Types
@type operation() :: :produce | :consume
Functions
Applies a command, returning {new_state, reply}. Deterministic; ACLs need no time input.
Whether username has a grant for operation on topic (a matching literal or prefix resource).
Every command shape, mapped to the machine version that introduced it (see Malachi.Cluster.MachineVersion).
Every grant across all users as {username, operation, resource}.
The grants for username as {operation, resource} (empty if none).
@spec new() :: t()
An empty registry.
Parses a resource pattern string into a resource: a trailing * marks a prefix ("orders.*" →
{:prefix, "orders."}, "*" → {:prefix, ""} = all topics), otherwise a literal exact topic.
Renders a resource back to its pattern string (inverse of parse_resource/1).