auth

package
v1.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GroupProviderCtxKey = "__group_provider_key"

GroupProviderCtxKey is the key used to store/retrieve group data from Context

View Source
const IdentityProviderCtxKey = "__identity_provider_key"

IdentityProviderCtxKey is the key used to store/retrieve identity data from Context

Variables

This section is empty.

Functions

func GetGroups added in v1.19.0

func GetGroups(ctx context.Context) []string

GetGroups returns group data stored in context

func GetIdentity

func GetIdentity(ctx context.Context) string

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 IsAdmin

func IsAdmin(ctx context.Context) error

IsAdmin asserts that identity data found in context represents an admin user

func IsRequester added in v1.4.0

func IsRequester(ctx context.Context, t *task.Task) error

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

func IsWatcher(ctx context.Context, t *task.Task) error

IsWatcher asserts that identity data found in context represents a watcher of the given task

func WithGroups added in v1.19.0

func WithGroups(ctx context.Context, groups []string) context.Context

WithIdentity adds identity data to a context

func WithIdentity

func WithIdentity(ctx context.Context, id string) context.Context

WithIdentity adds identity data to a context

Types

This section is empty.

Jump to

Keyboard shortcuts

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