acl

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMiddleware

func CheckMiddleware(next http.Handler) http.Handler

HTTPMiddleware

func Match

func Match(route []string, topic []string) bool

Match compare an selector route with an given topic

func MatchRoute

func MatchRoute(route string, topic string) (match bool)

MatchRoute compare an route with an topic

func Patch added in v2.2.0

func Patch(newConfig ConfigStruct)

func Set added in v2.2.0

func Set(newConfig ConfigStruct)

Types

type ConfigStruct

type ConfigStruct struct {
	Rules map[string][]string `yaml:"rules" json:"rules"`
}

func Get added in v2.2.0

func Get() (currentConfig ConfigStruct)

func (*ConfigStruct) MarshalZerologObject added in v2.2.0

func (c *ConfigStruct) MarshalZerologObject(e *zerolog.Event)

type Middleware

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

func (*Middleware) Get added in v2.2.0

func (mdw *Middleware) Get() (currentConfig ConfigStruct)

func (Middleware) HasAccess

func (mdw Middleware) HasAccess(username string, route string) (hasAccess bool)

HasAccess check if the given user has access to this route

func (*Middleware) Init

func (mdw *Middleware) Init()

func (*Middleware) Patch added in v2.2.0

func (mdw *Middleware) Patch(newConfig ConfigStruct)

func (*Middleware) Set added in v2.2.0

func (mdw *Middleware) Set(newConfig ConfigStruct)

Jump to

Keyboard shortcuts

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