Wardrik. Statement
(wardrik_protocol v0.1.0-rc.1)
Copy Markdown
Allows actions on the resources its patterns match, like an IAM statement.
Wardrik.Statement.new(roles: [:reader, :messenger], resources: ["acme/agent/*"])
Wardrik.Statement.new(actions: ["agent.*"], resources: ["acme/@jon/*"])In a pattern, * matches any run of characters, including /. ? matches one character.
Roles
A role is a named set of actions:
| Role | Actions |
|---|---|
:reader | agent.read, agent.events, connection.read, mcp_server.read, ceiling.read |
:messenger | agent.ask, agent.cancel, agent.clear |
:approver | agent.decide |
:definer | agent.define, agent.spawn, agent.stop, agent.forget, connection.connect, mcp_server.add |
:worker | agent.serve, offering tools to the agents it covers |
:owner | every action |
Summary
Functions
Builds a statement from the protocol's JSON.
Builds a statement.
Returns {:ok, role} for a role's name, as :reader for "reader", or :error.
Returns the statement as the protocol's JSON.
Types
Functions
Builds a statement from the protocol's JSON.
Builds a statement.
Wardrik.Statement.new(roles: [:reader], actions: ["agent.ask"], resources: ["acme/agent/*"])Options
:resources- patterns of the resources it covers.:actions- actions it allows.[]unless set.:roles- roles whose actions it allows too.[]unless set.
Raises ArgumentError for an unknown option, and KeyError for an unknown role.
Returns {:ok, role} for a role's name, as :reader for "reader", or :error.
Returns the statement as the protocol's JSON.