Documentation
¶
Index ¶
- func NewAssignmentEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
- func NewEntitlement(resource *v2.Resource, name, purposeStr string, ...) *v2.Entitlement
- func NewEntitlementID(resource *v2.Resource, permission string) string
- func NewOwnershipEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
- func NewPermissionEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
- type EntitlementOption
- func WithAnnotation(msgs ...proto.Message) EntitlementOption
- func WithDescription(description string) EntitlementOption
- func WithDisplayName(displayName string) EntitlementOption
- func WithDuties(mappings ...*v2.DutyMapping) EntitlementOption
- func WithExclusionGroup(exclusionGroupID string) EntitlementOption
- func WithExclusionGroupDefault(exclusionGroupID string, order uint32) EntitlementOption
- func WithExclusionGroupOrder(exclusionGroupID string, order uint32) EntitlementOption
- func WithGrantableTo(grantableTo ...*v2.ResourceType) EntitlementOption
- func WithSlug(slug string) EntitlementOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAssignmentEntitlement ¶
func NewAssignmentEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
func NewEntitlement ¶ added in v0.3.9
func NewEntitlement(resource *v2.Resource, name, purposeStr string, entitlementOptions ...EntitlementOption) *v2.Entitlement
func NewEntitlementID ¶
NewEntitlementID returns the public entitlement id for a resource and permission. The raw ":"-join is an external-consumer contract: ids must stay byte-identical across SDK versions (C1 carries configuration keyed on them), so this join is deliberately lossy and MUST NOT be used as an internal identity — storage keys derive from the structured resource fields instead (see pkg/dotc1z/engine/pebble/identity.go).
func NewOwnershipEntitlement ¶ added in v0.6.17
func NewOwnershipEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
func NewPermissionEntitlement ¶
func NewPermissionEntitlement(resource *v2.Resource, name string, entitlementOptions ...EntitlementOption) *v2.Entitlement
Types ¶
type EntitlementOption ¶
type EntitlementOption func(*v2.Entitlement)
func WithAnnotation ¶
func WithAnnotation(msgs ...proto.Message) EntitlementOption
func WithDescription ¶
func WithDescription(description string) EntitlementOption
func WithDisplayName ¶
func WithDisplayName(displayName string) EntitlementOption
func WithDuties ¶ added in v0.46.0
func WithDuties(mappings ...*v2.DutyMapping) EntitlementOption
WithDuties attaches one DutyMappingsAnnotation holding the mappings in the order given. Build mappings with duty.Exact and duty.Inclusive. With no mappings it does nothing. Call it once per entitlement with all of the entitlement's duties: each call appends its own annotation, mappings are not merged or de-duplicated, and a second annotation breaks the at-most-one rule and fails dutytest.AssertEntitlement.
func WithExclusionGroup ¶ added in v0.9.12
func WithExclusionGroup(exclusionGroupID string) EntitlementOption
WithExclusionGroup marks this entitlement as belonging to a mutually exclusive group. Two entitlements on the same resource with the same exclusionGroupID cannot be simultaneously granted to the same principal.
func WithExclusionGroupDefault ¶ added in v0.9.12
func WithExclusionGroupDefault(exclusionGroupID string, order uint32) EntitlementOption
WithExclusionGroupDefault marks this entitlement as the default for a mandatory exclusion group. When another entitlement in the group is revoked without an explicit replacement, this entitlement is granted as the fallback.
Setting is_default on any entitlement in a group signals to ConductorOne that the group is mandatory (a principal must always hold exactly one).
func WithExclusionGroupOrder ¶ added in v0.9.12
func WithExclusionGroupOrder(exclusionGroupID string, order uint32) EntitlementOption
WithExclusionGroupOrder is like WithExclusionGroup but also sets an ordering hint. Higher order values indicate higher privilege levels.
func WithGrantableTo ¶
func WithGrantableTo(grantableTo ...*v2.ResourceType) EntitlementOption
func WithSlug ¶ added in v0.6.19
func WithSlug(slug string) EntitlementOption