auth

package
v0.0.0-...-25ebc3d Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(ctx context.Context, object string, action Action) error

func EmailFromContext

func EmailFromContext(ctx context.Context) string

func GroupsFromContext

func GroupsFromContext(ctx context.Context) map[string]bool

Types

type Action

type Action int
const (
	CREATE Action = iota
	READ
	UPDATE
	DELETE
)

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context) (context.Context, error)
}

func NewAuthenticator

func NewAuthenticator(cfg *config.Config, gg GroupGetter) (Authenticator, error)

type GroupCache

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

func NewCache

func NewCache(gg GroupGetter) *GroupCache

func (*GroupCache) GroupsForUser

func (gc *GroupCache) GroupsForUser(username string) (map[string]bool, error)

type GroupGetter

type GroupGetter interface {
	GroupsForUser(username string) (map[string]bool, error)
}

Jump to

Keyboard shortcuts

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