errors

package
v0.0.0-...-5d0e1a3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: Apache-2.0 Imports: 1 Imported by: 8

Documentation

Index

Constants

View Source
const (
	None = iota
	NotImplemented

	KeyNotFound
	CommonStateFieldsMissing
	InvalidCall
	ReadingFromStore

	Unauthorized
	IllegalArguments
	UnsupportedType
	ParsingToken
	Internal
	ParsingRequest
	UnmarshalingBody
	UpdateAuthorization
	PartialFailureToAddAuthz
	PartialFailureToUpdateAuthz
	StateDriverNotCreated
	KeyExists
	IllegalOperation
	AccessDenied

	UserNotFound
	LDAPConfigurationNotFound
	LDAPConnectionFailed
	LDAPAccessDenied
	LDAPGroupsNotFound
	LDAPMultipleEntries
	LocalAuthenticationFailed

	// N.B. Add all new error codes above this line.  All error codes >=
	// LastError are invalid.
	LastError
)

Error codes

Variables

View Source
var ErrAccessDenied = NewError(AccessDenied, "Access Denied")

ErrAccessDenied is used when the user access is denied

View Source
var ErrCommonStateFieldsMissing = NewError(CommonStateFieldsMissing, "expected fields missing")

ErrCommonStateFieldsMissing indicates an error condition when the expected fields defined by the struct core.CommonState were not found as expected

View Source
var ErrIllegalArguments = NewError(IllegalArguments, "illegal arguments")

ErrIllegalArguments indicates that illegal arguments were received for an API call

View Source
var ErrIllegalOperation = NewError(IllegalOperation, "illegal operation")

ErrIllegalOperation is used when the user performs an operation which is not permitted in our system e.g. updating/deleting built-in users

View Source
var ErrInternal = NewError(Internal, "an internal error has occurred")

ErrInternal is returned from functions where internal logic runs into inconsistency issues.

View Source
var ErrInvalidCall = NewError(InvalidCall, "invalid method or function call")

ErrInvalidCall indicates an error condition when an invalid call to a method or function is being made

View Source
var ErrKeyExists = NewError(KeyExists, "key exists already in data store")

ErrKeyExists is used when the key already exists in the data store during insertion

View Source
var ErrKeyNotFound = NewError(KeyNotFound, "key not found")

ErrKeyNotFound indicates the error condition when a key is not found in the state store (which could be etcd or consul)

View Source
var ErrLDAPAccessDenied = NewError(LDAPAccessDenied, "LDAP/AD access denied")

ErrLDAPAccessDenied used when LDAP/AD access is denied

View Source
var ErrLDAPConfigurationNotFound = NewError(LDAPConfigurationNotFound, "LDAP/AD settings not found")

ErrLDAPConfigurationNotFound used when LDAP/AD configuration is not found from the data store

View Source
var ErrLDAPConnectionFailed = NewError(LDAPConnectionFailed, "LDAP/AD connection failed")

ErrLDAPConnectionFailed used when connection couldn't be established with `LDAP/Active Directory`

View Source
var ErrLDAPGroupsNotFound = NewError(LDAPGroupsNotFound, "No groups found, cannot process")

ErrLDAPGroupsNotFound used when LDAP/AD user is associated with just primary group

View Source
var ErrLDAPMultipleEntries = NewError(LDAPMultipleEntries, "Expected single entry; found multiple entries in AD")

ErrLDAPMultipleEntries used when LDAP/AD search returns multiple results when 1 is expected

View Source
var ErrLocalAuthenticationFailed = NewError(LocalAuthenticationFailed, "Local authentication failed")

ErrLocalAuthenticationFailed used when local authentication fails

View Source
var ErrNotImplemented = NewError(NotImplemented, "not implemented")

ErrNotImplemented indicates that the function desired is not implemented

View Source
var ErrParsingRequest = NewError(ParsingRequest, "failed to parse HTTP request body")

ErrParsingRequest indicates an error parsing the incoming HTTP request

View Source
var ErrParsingToken = NewError(ParsingToken, "failed to parse authz token")

ErrParsingToken indicates an error when trying to parse an authorization token

View Source
var ErrPartialFailureToAddAuthz = NewError(PartialFailureToAddAuthz, "failed to add authorization")

ErrPartialFailureToAddAuthz indicates an error when a new authorization is being added

View Source
var ErrPartialFailureToUpdateAuthz = NewError(PartialFailureToUpdateAuthz, "failed to update authorization")

ErrPartialFailureToUpdateAuthz indicates an error when an authorization is being updated

View Source
var ErrReadingFromStore = NewError(ReadingFromStore, "error reading from KV store")

ErrReadingFromStore indicates an error condition while reading from the KV store

View Source
var ErrStateDriverNotCreated = NewError(StateDriverNotCreated, "state driver not created")

ErrStateDriverNotCreated is used when the state driver is not initialized

View Source
var ErrUnauthorized = NewError(Unauthorized, "unauthorized access")

ErrUnauthorized indicates that an authorization doesn't have a claim

View Source
var ErrUnmarshalingBody = NewError(UnmarshalingBody, "failed to unmarshall request body")

ErrUnmarshalingBody indicates an error unmarshalling request body

View Source
var ErrUnsupportedType = NewError(UnsupportedType, "Unsupported object type")

ErrUnsupportedType indicates that an unsupported object type was used in a function or method call, e.g. checkAccessClaim

View Source
var ErrUpdateAuthorization = NewError(UpdateAuthorization, "failed to update authorization")

ErrUpdateAuthorization indicates an error when updating an authorization

View Source
var ErrUserNotFound = NewError(UserNotFound, "User not found")

ErrUserNotFound used when the user is found

Functions

func NewError

func NewError(code int, message string) error

NewError creates a new AuthError with the supplied parameters

Parameters:

code: error code of this AuthError
message: string representation of this AuthError

Return values:

AuthError: a new AuthError object providing the desired error
    message and error code

Types

type AuthError

type AuthError struct {
	Code    int
	Message string
}

AuthError describes an error response message

Field:

code: error code
message: Textual description of the error

func (*AuthError) Error

func (ae *AuthError) Error() string

Error returns a textual representation of a AuthError

Parameters:

(Receiver): AuthError to which this function applies

Return values:

string: string representation of this AuthError

Jump to

Keyboard shortcuts

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