authz

package
v1.20240717.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_ID_LENGTH = 4096

Variables

View Source
var (
	ErrBadUserMapLine = errors.New("bad user map line")
	ErrBadUserId      = errors.New("bad user ID")
	ErrBadGroupId     = errors.New("bad group ID")
)

Functions

func IsPrintString

func IsPrintString(id string) bool

func IsValidId

func IsValidId(id []byte) bool

func IsValidIdString

func IsValidIdString(id string) bool

func VerifyAuthzType

func VerifyAuthzType(tn_str string, use_owner bool) bool

Types

type UserMap

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

func NewUserMap

func NewUserMap(file string, cfg *UserMapConfig) (*UserMap, error)

func NewUserMapFS

func NewUserMapFS(fsys fs.FS, file string, cfg *UserMapConfig) (*UserMap, error)

func (*UserMap) Authz

func (az *UserMap) Authz(tn_str string, user string) bool

func (*UserMap) AuthzWithOwner

func (az *UserMap) AuthzWithOwner(tn_str string, user string, owner string) bool

func (*UserMap) InGroup

func (az *UserMap) InGroup(user string, group string) bool

func (*UserMap) InUser

func (az *UserMap) InUser(user string) bool

func (*UserMap) IsGroupString

func (az *UserMap) IsGroupString(grp string) bool

func (*UserMap) IsUserString

func (az *UserMap) IsUserString(user string) bool

type UserMapConfig

type UserMapConfig struct {
	UserRegex  *regexp.Regexp
	GroupRegex *regexp.Regexp
}

func NewUserMapConfig

func NewUserMapConfig(file string) (*UserMapConfig, error)

func NewUserMapConfigFS

func NewUserMapConfigFS(fsys fs.FS, file string) (*UserMapConfig, error)

func (*UserMapConfig) IsGroup

func (cfg *UserMapConfig) IsGroup(grp []byte) bool

func (*UserMapConfig) IsGroupString

func (cfg *UserMapConfig) IsGroupString(grp string) bool

func (*UserMapConfig) IsUser

func (cfg *UserMapConfig) IsUser(user []byte) bool

func (*UserMapConfig) IsUserString

func (cfg *UserMapConfig) IsUserString(user string) bool

func (*UserMapConfig) SplitLine

func (cfg *UserMapConfig) SplitLine(ln string) (string, []string, error)

func (*UserMapConfig) UnmarshalTOML

func (cfg *UserMapConfig) UnmarshalTOML(decode func(interface{}) error) error

Jump to

Keyboard shortcuts

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