server

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowAllChecker

type AllowAllChecker struct{}

AllowAllChecker is a simple auth checker that allows all requests.

func NewAllowAllChecker

func NewAllowAllChecker() *AllowAllChecker

NewAllowAllChecker creates a new AllowAllChecker.

func (*AllowAllChecker) Check

Check is an implementation of AuthChecker.Check that allows all check requests.

type AuthListMode

type AuthListMode bool

AuthListMode indicates the list checking mode

const (
	// AuthBlackList indicates that the list should work as a black list
	AuthBlackList AuthListMode = false

	// AuthWhiteList indicates that the list should work as a white list
	AuthWhiteList AuthListMode = true
)

type ListAuthChecker

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

ListAuthChecker implements AuthChecker function and is backed by a set of ids.

func NewListAuthChecker

func NewListAuthChecker(options *ListAuthCheckerOptions) *ListAuthChecker

NewListAuthChecker returns a new instance of ListAuthChecker

func (*ListAuthChecker) Add

func (l *ListAuthChecker) Add(id string)

Add the provided id to the list of ids.

func (*ListAuthChecker) Allowed

func (l *ListAuthChecker) Allowed(id string) bool

Allowed checks whether the given id is allowed.

func (*ListAuthChecker) Check

func (l *ListAuthChecker) Check(authInfo credentials.AuthInfo) error

func (*ListAuthChecker) Remove

func (l *ListAuthChecker) Remove(id string)

Remove the provided id from the list of ids.

func (*ListAuthChecker) Set

func (l *ListAuthChecker) Set(ids ...string)

Set new sets of ids. Previous ones are removed.

func (*ListAuthChecker) SetMode

func (l *ListAuthChecker) SetMode(mode AuthListMode)

SetMode sets the list-checking mode for this list.

func (*ListAuthChecker) String

func (l *ListAuthChecker) String() string

String is an implementation of Stringer.String.

type ListAuthCheckerOptions

type ListAuthCheckerOptions struct {
	// For the purposes of logging rate limiting authz failures, this controls how
	// many authz failures are logged in a burst every AuthzFailureLogFreq.
	AuthzFailureLogBurstSize int

	// For the purposes of logging rate limiting authz failures, this controls how
	// frequently bursts of authz failures are logged.
	AuthzFailureLogFreq time.Duration

	// AuthMode indicates the list checking mode
	AuthMode AuthListMode
}

func DefaultListAuthCheckerOptions

func DefaultListAuthCheckerOptions() *ListAuthCheckerOptions

Jump to

Keyboard shortcuts

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