Documentation ¶
Index ¶
- Constants
- func GetGroups(ctx context.Context) []string
- func GetIdentity(ctx context.Context) string
- func Init(store *configstore.Store) error
- func IsAdmin(ctx context.Context) error
- func IsRequester(ctx context.Context, t *task.Task) error
- func IsResolutionManager(ctx context.Context, tt *tasktemplate.TaskTemplate, t *task.Task, ...) error
- func IsTemplateOwner(ctx context.Context, tt *tasktemplate.TaskTemplate) error
- func IsWatcher(ctx context.Context, t *task.Task) error
- func WithGroups(ctx context.Context, groups []string) context.Context
- func WithIdentity(ctx context.Context, id string) context.Context
Constants ¶
const GroupProviderCtxKey = "__group_provider_key"
GroupProviderCtxKey is the key used to store/retrieve group data from Context
const IdentityProviderCtxKey = "__identity_provider_key"
IdentityProviderCtxKey is the key used to store/retrieve identity data from Context
Variables ¶
This section is empty.
Functions ¶
func GetIdentity ¶
GetIdentity returns identity data stored in context
func Init ¶
func Init(store *configstore.Store) error
Init reads authorization from configstore, bootstraps values used to handle authorization
func IsRequester ¶ added in v1.4.0
IsRequester asserts that identity data found in context represents the requester of the given task
func IsResolutionManager ¶ added in v1.4.0
func IsResolutionManager(ctx context.Context, tt *tasktemplate.TaskTemplate, t *task.Task, r *resolution.Resolution) error
IsResolutionManager asserts that identity data found in context is either: - a template owner (allowed_resolver_usernames or allowed_resolver_groups) - a task resolver (resolver_usernames or resolver_groups) - this task resolver (resolver_username)
func IsTemplateOwner ¶ added in v1.4.0
func IsTemplateOwner(ctx context.Context, tt *tasktemplate.TaskTemplate) error
IsTemplateOwner asserts that: - identity data found in context is a template allowed_resolver_usernames - or group data found in context is a template allowed_resolver_groups
func IsWatcher ¶ added in v1.4.0
IsWatcher asserts that identity data found in context represents a watcher of the given task
func WithGroups ¶ added in v1.19.0
WithIdentity adds identity data to a context
Types ¶
This section is empty.