Documentation
¶
Overview ¶
Package duty holds the builders connectors use to declare which duties an entitlement allows. Attach the mappings with entitlement.WithDuties.
Duty IDs are plain strings defined by ConductorOne's duty catalog, named <object>.<action> in lowercase, such as "payment.release". A list of duty names will be added to this package in a later release once they are settled; until then pass the ID as a string.
Exact and Inclusive return the wire message and take an optional description:
entitlement.WithDuties(
duty.Exact("payment.release"),
duty.Inclusive("payment.authorize", "Finance Administrator role"),
)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exact ¶
func Exact[T ~string](id T, description ...string) *v2.DutyMapping
Exact returns a mapping for an entitlement that exists to grant this one duty. The optional description is a plain-English note shown to people and is never matched on; if more than one is passed, the first is used, and with none the description is empty. It accepts any string type so typed duty-name constants can be added in a later release without an API change.
func Inclusive ¶
func Inclusive[T ~string](id T, description ...string) *v2.DutyMapping
Inclusive returns a mapping for a broad entitlement that allows this duty among others. The optional description is a plain-English note shown to people and is never matched on; if more than one is passed, the first is used, and with none the description is empty. It accepts any string type so typed duty-name constants can be added in a later release without an API change.
func Validate ¶
func Validate(a *v2.DutyMappingsAnnotation) error
Validate checks the annotation's wire rules, rejects a duty ID listed twice, and requires every duty ID to follow the <object>.<action> naming convention: 1 to 64 characters, lowercase letters, digits and '_', each part starting with a letter, and exactly one '.'.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dutytest checks duty annotations in connector tests, without a ConductorOne instance, and exports the DutyMappingsAnnotation wire-contract cases through Cases.
|
Package dutytest checks duty annotations in connector tests, without a ConductorOne instance, and exports the DutyMappingsAnnotation wire-contract cases through Cases. |