rbac

package
v0.0.0-...-df8c4e2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CtxKeyValidator

type CtxKeyValidator struct{}

type Validator

type Validator interface {
	IsAdmin() bool
	IsAPITokenCall() bool
	IsUser() bool
	Subject() string
	Groups() []string
}

func NewValidator

func NewValidator(ctx context.Context) (Validator, error)

NewValidator returns a new instance of validator. The function requires that the application config has been initialized.

func ValidatorFromContext

func ValidatorFromContext(ctx context.Context) (Validator, error)

ValidatorFromContext returns a validator from the context. If the context doesn't contain a validator instance, a new instance will be returned instead.

Jump to

Keyboard shortcuts

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