Documentation
¶
Index ¶
- Constants
- func AppendGrantReplaced(annos annotations.Annotations, replacedGrantID string) annotations.Annotations
- func NewGrant(resource *v2.Resource, entitlementName string, principal GrantPrincipal, ...) *v2.Grant
- func NewGrantID(principal GrantPrincipal, entitlement *v2.Entitlement) string
- func NewGrantReplaced(replacedGrantID string) *v2.GrantReplaced
- type GrantOption
- type GrantPrincipal
Constants ¶
const UnknownGrantId string = "🧸_UNKNOWN_GRANT_ID"
Sometimes C1 doesn't have the grant ID, but does have the principal and entitlement.
Variables ¶
This section is empty.
Functions ¶
func AppendGrantReplaced ¶ added in v0.9.12
func AppendGrantReplaced(annos annotations.Annotations, replacedGrantID string) annotations.Annotations
AppendGrantReplaced appends a GrantReplaced annotation to the given annotations slice and returns the updated slice. Convenience wrapper around NewGrantReplaced for the common case where the caller is building a response annotations slice inline.
func NewGrant ¶
func NewGrant(resource *v2.Resource, entitlementName string, principal GrantPrincipal, grantOptions ...GrantOption) *v2.Grant
NewGrant returns a new grant for the given entitlement on the resource for the provided principal resource ID.
func NewGrantID ¶ added in v0.2.84
func NewGrantID(principal GrantPrincipal, entitlement *v2.Entitlement) string
func NewGrantReplaced ¶ added in v0.9.12
func NewGrantReplaced(replacedGrantID string) *v2.GrantReplaced
NewGrantReplaced returns a GrantReplaced annotation suitable for appending to the annotations slice returned from a Grant provisioning call.
replacedGrantID is the ID of the grant that the new grant atomically replaced. ConductorOne marks it revoked without dispatching a separate Revoke RPC.
Typical use:
annos := annotations.Annotations{}
annos.Append(grant.NewGrantReplaced(currentGrant.GetId()))
return newGrants, annos, nil
Types ¶
type GrantOption ¶
func WithAnnotation ¶
func WithAnnotation(msgs ...proto.Message) GrantOption
func WithExternalPrincipalID ¶ added in v0.1.15
func WithExternalPrincipalID(externalID *v2.ExternalId) GrantOption
WithExternalPrincipalID: Deprecated. This field is no longer used.
func WithGrantMetadata ¶ added in v0.1.1
func WithGrantMetadata(metadata map[string]interface{}) GrantOption