permissions

package
v0.0.0-...-2d60b20 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Read     = "read"
	Append   = "append"
	Scan     = "scan"
	Wildcard = "*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	K8s        k8s.K8sConfig `yaml:"k8s,omitempty"`
	Jwt        jwt.JwtConfig `yaml:"jwt,omitempty"`
	Repository Repository    `yaml:"repository,omitempty"`
}

func (*Config) Validator

func (c *Config) Validator() Validator

type Error

type Error string

func (Error) Error

func (err Error) Error() string

type NotAuthorized

type NotAuthorized struct {
	Cause error
}

func (NotAuthorized) Error

func (n NotAuthorized) Error() string

type Repository

type Repository struct {
	Users []User `yaml:"users"`
}

func (*Repository) FindUser

func (r *Repository) FindUser(token jwt.Token) *User

type User

type User struct {
	Subject string   `yaml:"subject"`
	Read    []string `yaml:"read"`
	Append  []string `yaml:"append"`
	Scan    []string `yaml:"scan"`
}

func (User) CheckPermission

func (u User) CheckPermission(permission string, aggregate string) error

type Validator

type Validator interface {
	ValidToken(token string) (jwt.Token, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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