Expand description
Designation resolvers turn runtime context into the designations the engine attaches at mint time.
A DesignationResolver is consulted by
crate::CapabilityEngine::mint_with_context after policy evaluation:
the engine asks the resolver for designation values for the current
(target, operation) given a DesignationContext, merges the result
with any policy-declared static designations, and validates the union
against the schema’s required_designations.
Stock implementations:
NoopResolver: returns no designations. Default if no resolver is attached to the engine.ArgsResolver: declarative(target, arg_field) -> designation_labelmappings, reading fromctx.args.WebappResolver: reads from anAuthSessionextension and/or matches aRequestUrlextension against{name}URL templates.EventResolver: reads from anEventextension via dot-separated JSON paths.CompositeResolver: dispatches to per-target resolvers, with an optional default for unknown targets.
Structs§
- Args
Resolver - A resolver that pulls designation values from a JSON
argsobject on theDesignationContext, mapping arg field names to designation labels per target. - Args
Resolver Builder - Staged builder for
ArgsResolver. Call.for_target(id)to scope subsequent.map()calls to that target. - Auth
Session - A flat string-keyed map of session fields a webapp wants to expose to
resolvers, inserted into
DesignationContextas a typed extension. - Composite
Resolver - A resolver that dispatches to per-target resolvers, with an optional default for unknown targets.
- Composite
Resolver Builder - Builder for
CompositeResolver. - Designation
Context - Per-call context handed to a
DesignationResolver. - Event
- An event payload (typically an inbound webhook or gateway message)
inserted into
DesignationContextas a typed extension. TheEventResolverreads fields from this value to produce designations. - Event
Resolver - A resolver for event-driven principals: pulls designation values from a
JSON
Eventin the context, mapping event field names to designation labels per target. - Event
Resolver Builder - Builder for
EventResolver. - Noop
Resolver - Default resolver. Returns no designations regardless of input.
- Request
Url - The current request’s URL, inserted into
DesignationContextwhen the webapp wantsWebappResolverto extract designations from it via URL patterns. - Webapp
Resolver - A resolver designed for the webapp pattern. Pulls designation values from two sources, both supplied via context extensions:
- Webapp
Resolver Builder - Builder for
WebappResolver.
Enums§
- Resolver
Error - Errors a
DesignationResolvercan return.
Traits§
- Designation
Resolver - A resolver that turns a
(target, operation, context)triple into the designations the engine will attach to the minted capability.