auth

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: BSD-3-Clause Imports: 7 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 IsAllowedResolver

func IsAllowedResolver(ctx context.Context, tt *tasktemplate.TaskTemplate, extendedResolverUsernames []string) error

IsAllowedResolver asserts that identity data found in context represents an authorized resolver user, for a given template and task

func IsGlobalResolverUser

func IsGlobalResolverUser(u string) bool

IsGlobalResolverUser asserts that a given user is universally allowed to resolve any task

func IsResolver

func IsResolver(ctx context.Context, r *resolution.Resolution) error

IsResolver asserts that identity data found in context is the actual resolver of a given resolution

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