Skip to main content

Module resolver

Module resolver 

Source
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_label mappings, reading from ctx.args.
  • WebappResolver: reads from an AuthSession extension and/or matches a RequestUrl extension against {name} URL templates.
  • EventResolver: reads from an Event extension via dot-separated JSON paths.
  • CompositeResolver: dispatches to per-target resolvers, with an optional default for unknown targets.

Structs§

ArgsResolver
A resolver that pulls designation values from a JSON args object on the DesignationContext, mapping arg field names to designation labels per target.
ArgsResolverBuilder
Staged builder for ArgsResolver. Call .for_target(id) to scope subsequent .map() calls to that target.
AuthSession
A flat string-keyed map of session fields a webapp wants to expose to resolvers, inserted into DesignationContext as a typed extension.
CompositeResolver
A resolver that dispatches to per-target resolvers, with an optional default for unknown targets.
CompositeResolverBuilder
Builder for CompositeResolver.
DesignationContext
Per-call context handed to a DesignationResolver.
Event
An event payload (typically an inbound webhook or gateway message) inserted into DesignationContext as a typed extension. The EventResolver reads fields from this value to produce designations.
EventResolver
A resolver for event-driven principals: pulls designation values from a JSON Event in the context, mapping event field names to designation labels per target.
EventResolverBuilder
Builder for EventResolver.
NoopResolver
Default resolver. Returns no designations regardless of input.
RequestUrl
The current request’s URL, inserted into DesignationContext when the webapp wants WebappResolver to extract designations from it via URL patterns.
WebappResolver
A resolver designed for the webapp pattern. Pulls designation values from two sources, both supplied via context extensions:
WebappResolverBuilder
Builder for WebappResolver.

Enums§

ResolverError
Errors a DesignationResolver can return.

Traits§

DesignationResolver
A resolver that turns a (target, operation, context) triple into the designations the engine will attach to the minted capability.