grant

package
v0.2.45 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 6 Imported by: 73

Documentation

Index

Constants

View Source
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 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.

Types

type GrantOption

type GrantOption func(*v2.Grant) error

func WithAnnotation

func WithAnnotation(msgs ...proto.Message) GrantOption

func WithExternalPrincipalID added in v0.1.15

func WithExternalPrincipalID(externalID *v2.ExternalId) GrantOption

func WithGrantMetadata added in v0.1.1

func WithGrantMetadata(metadata map[string]interface{}) GrantOption

type GrantPrincipal added in v0.0.20

type GrantPrincipal interface {
	proto.Message
	GetBatonResource() bool
}

Jump to

Keyboard shortcuts

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