auth

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserRoles = struct {

	// Base role required for any interaction with the bot.
	Base,

	KubernetesAdmin,

	KubernetesUser UserRole
}{
	"Base",
	"KubernetesAdmin",
	"KubernetesUser",
}

UserRoles enumerates available UserRole.

Functions

This section is empty.

Types

type Authorizer

type Authorizer struct {
	// contains filtered or unexported fields
}

Authorizer ...

func New

func New(cfg *config.SlackConfig, logger log.Logger) (*Authorizer, error)

New returns a new Authorizer or an error.

func (*Authorizer) IsUserAuthorized

func (a *Authorizer) IsUserAuthorized(userID string, requiredUserRole UserRole) bool

IsUserAuthorized checks whether the given user is authorized to run the bot command.

func (*Authorizer) Run

func (a *Authorizer) Run(stop <-chan struct{})

Run starts the continuous synchronization in the background.

type UserRole

type UserRole string

UserRole ...

Jump to

Keyboard shortcuts

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