authorization

package
v1.0.12-0...-3a330c3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authorizer

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

Authorizer the component in charge of checking whether a user can access a given resource.

func NewAuthorizer

func NewAuthorizer(configuration schema.AccessControlConfiguration) *Authorizer

NewAuthorizer create an instance of authorizer with a given access control configuration.

func (*Authorizer) GetRequiredLevel

func (p *Authorizer) GetRequiredLevel(subject Subject, requestURL url.URL) Level

GetRequiredLevel retrieve the required level of authorization to access the object.

type Level

type Level int

Level is the type representing an authorization level.

const (
	// Bypass bypass level.
	Bypass Level = iota
	// OneFactor one factor level.
	OneFactor Level = iota
	// TwoFactor two factor level.
	TwoFactor Level = iota
	// Denied denied level.
	Denied Level = iota
)

type Object

type Object struct {
	Domain string
	Path   string
}

Object object to check access control for

type Subject

type Subject struct {
	Username string
	Groups   []string
	IP       net.IP
}

Subject subject who to check access control for.

Jump to

Keyboard shortcuts

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