duty

package
v0.46.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL