Mediate.Rbac.Version (mediate_rbac v0.1.0)

Copy Markdown View Source

The policy version of RBAC in code. Its identifier is the version: the policy module gave, or the content hash. The content hash is a digest of the policy module and every module a predicate or a hop filter lives in. So a change to a rule is a new version whether or not anyone said so. The content is the role table and the module list as text when under the configured cap, and a pointer to the modules otherwise. the events document under "Policy version" has the event and the cap.

Mediate.Rbac.publish/0 builds the version and emits telemetry_event/0 with it, one event per call. It stores nothing, so the consumer that keeps a record of deployments handles that event.

Summary

Functions

The role table and the module list as text.

The digest of the policy module and every predicate and hop filter module.

The version of adapter as an event carries it, with the content by value when under the cap.

The version identifier a decision names.

The telemetry event Mediate.Rbac.publish/0 emits.

Functions

content(policy)

@spec content(Mediate.Rbac.Policy.t()) :: String.t()

The role table and the module list as text.

content_hash(policy)

@spec content_hash(Mediate.Rbac.Policy.t()) :: String.t()

The digest of the policy module and every predicate and hop filter module.

of(adapter, policy, config, at)

The version of adapter as an event carries it, with the content by value when under the cap.

ref(policy)

The version identifier a decision names.

telemetry_event()

@spec telemetry_event() :: [atom()]

The telemetry event Mediate.Rbac.publish/0 emits.