Documentation ¶
Index ¶
- type AllowAllChecker
- type AuthListMode
- type ListAuthChecker
- func (l *ListAuthChecker) Add(id string)
- func (l *ListAuthChecker) Allowed(id string) bool
- func (l *ListAuthChecker) Check(authInfo credentials.AuthInfo) error
- func (l *ListAuthChecker) Remove(id string)
- func (l *ListAuthChecker) Set(ids ...string)
- func (l *ListAuthChecker) SetMode(mode AuthListMode)
- func (l *ListAuthChecker) String() string
- type ListAuthCheckerOptions
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 ¶
func (*AllowAllChecker) Check(credentials.AuthInfo) error
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