auth

package
v1.14.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

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 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) - a task resolver (resolver_usernames) - 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

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 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