Documentation ¶
Index ¶
- func IsAdmin(format string, v ...interface{}) isAdmin
- func IsAuthenticated(format string, v ...interface{}) isAuthenticated
- func IsAuthorizationError(err error) bool
- func IsNotResourceOwner(resourceOwner api.Identifier, format string, v ...interface{}) isNotResourceOwner
- func IsResourceOwner(resourceOwner api.Identifier, format string, v ...interface{}) isResourceOwner
- func IsUser(format string, v ...interface{}) isUser
- type AuthorizationError
- type Authorizer
- type Condition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAdmin ¶
func IsAdmin(format string, v ...interface{}) isAdmin
IsAdmin creates a new condition
func IsAuthenticated ¶
func IsAuthenticated(format string, v ...interface{}) isAuthenticated
IsAuthenticated creates a new condition
func IsAuthorizationError ¶
IsAuthorizationError returns true if the given error represents an authorization error and originates from an authorizer module
func IsNotResourceOwner ¶
func IsNotResourceOwner( resourceOwner api.Identifier, format string, v ...interface{}, ) isNotResourceOwner
IsNotResourceOwner creates a new condition
func IsResourceOwner ¶
func IsResourceOwner( resourceOwner api.Identifier, format string, v ...interface{}, ) isResourceOwner
IsResourceOwner creates a new condition
Types ¶
type AuthorizationError ¶
type AuthorizationError struct {
// contains filtered or unexported fields
}
AuthorizationError represents an authorization error
func Errorf ¶
func Errorf(format string, v ...interface{}) AuthorizationError
Errorf creates a new formatted validator error
func (AuthorizationError) Error ¶
func (err AuthorizationError) Error() string
Error implements the standard Go error interface
type Authorizer ¶
type Authorizer interface { // MeetsAll returns an error if either of the given conditions don't apply. // If all of the given conditions apply collectively then nil is returned MeetsAll( sessionInfo *sessinfo.SessionInfo, conditions ...Condition, ) error // MeetsEitherOf returns an error if all of the given conditions // don't apply. // If at least one of the given conditions applies then nil is returned MeetsEitherOf( sessionInfo *sessinfo.SessionInfo, conditions ...Condition, ) error }
Authorizer defines the interface of the authorizer module
type Condition ¶
type Condition interface {
Validate(sessionInfo *sessinfo.SessionInfo) error
}
Condition represents an authorization condition interface
Click to show internal directories.
Click to hide internal directories.