errors

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StandardError

type StandardError string

StandardError is a standard error.

const (
	ErrAPIKeyPayloadEmpty     StandardError = "api key payload is empty"
	ErrAPIKeyUsageEmpty       StandardError = "api key usage type is empty"
	ErrAPIKeyCommentEmpty     StandardError = "api key comment is empty"
	ErrAPIKeyUsageUnsupported StandardError = "api key usage type %q is unsupported"

	ErrLookupAPIKeyPayloadEmpty     StandardError = "api key payload is empty"
	ErrLookupAPIKeyFailed           StandardError = "api key lookup failed"
	ErrLookupAPIKeyMalformedPayload StandardError = "api key payload is malformed"
)

API key errors.

const (
	ErrNewDatabase                StandardError = "failed initializing database at %q: %v"
	ErrNewDatabaseInvalidUser     StandardError = "failed initializing database: found invalid user %v, %v"
	ErrNewDatabaseDuplicateUser   StandardError = "failed initializing database: found duplicate user %s %v"
	ErrNewDatabaseDuplicateUserID StandardError = "failed initializing database: found duplicate user id %s %v"
	ErrNewDatabaseDuplicateEmail  StandardError = "failed initializing database: found duplicate email address %s, %v"
	ErrNewDatabaseDuplicateAPIKey StandardError = "failed initializing database: found duplicate api key %s, %v"

	ErrDatabaseCommit       StandardError = "failed database commit to %q: %v"
	ErrDatabaseOperation    StandardError = "database operation failed: %v"
	ErrDatabaseInvalidUser  StandardError = "username and email point to a different identity in the database"
	ErrDatabaseUserNotFound StandardError = "user not found"
	// ErrDatabaseInvalidUserPassword StandardError = "invalid password"
	ErrAuthFailed StandardError = "user authentication failed: %v"

	ErrAddPublicKey    StandardError = "failed adding %s public key: %v"
	ErrDeletePublicKey StandardError = "failed deleting %q key: %v"
	ErrGetPublicKeys   StandardError = "failed getting %q keys: %v"

	ErrAddAPIKey    StandardError = "failed adding %s key: %v"
	ErrDeleteAPIKey StandardError = "failed deleting %q key: %v"
	ErrGetAPIKeys   StandardError = "failed getting %q keys: %v"

	ErrChangeUserPassword   StandardError = "failed change user password: %v"
	ErrUserPasswordNotFound StandardError = "user password not set"
	ErrUserPasswordInvalid  StandardError = "user password is invalid"

	ErrUserPolicyCompliance     StandardError = "username policy compliance check failed"
	ErrPasswordPolicyCompliance StandardError = "user password policy compliance check failed"

	ErrAddUser    StandardError = "failed adding user %q: %v"
	ErrDeleteUser StandardError = "failed deleting user %q: %v"
	ErrGetUsers   StandardError = "failed retrieving users: %v"
	ErrGetUser    StandardError = "failed retrieving user %q: %v"

	ErrPasswordEmpty                StandardError = "empty password"
	ErrPasswordEmptyAlgorithm       StandardError = "empty password hash algorithm"
	ErrPasswordGenerate             StandardError = "password generation error: %v"
	ErrPasswordUnsupportedAlgorithm StandardError = "unsupported password hash algorithm: %v"

	ErrUserIDInvalidLength StandardError = "invalid user id length: %d"
	ErrUsernameEmpty       StandardError = "username is empty"

	ErrEmailAddressInvalid StandardError = "invalid email address"
	ErrRoleEmpty           StandardError = "role name is empty"

	ErrParseNameFailed StandardError = "failed to parse name: %s"

	ErrCreditCardUnsupportedIssuer      StandardError = "unsupported credit card issuer: %v"
	ErrCreditCardUnsupportedAssociation StandardError = "unsupported credit card association: %v"
)

Database errors.

const (
	ErrAddMfaToken    StandardError = "failed adding MFA token: %v"
	ErrDeleteMfaToken StandardError = "failed deleting MFA token %q: %v"
	ErrGetMfaTokens   StandardError = "failed getting MFA tokens: %v"

	ErrDuplicateMfaTokenSecret  StandardError = "duplicate MFA token secret"
	ErrDuplicateMfaTokenComment StandardError = "duplicate MFA token comment"

	ErrMfaTokenEmptyAlgorithm   StandardError = "empty MFA token algorithm"
	ErrMfaTokenTypeEmpty        StandardError = "empty MFA token type"
	ErrMfaTokenInvalidType      StandardError = "invalid MFA token type: %s"
	ErrMfaTokenInvalidAlgorithm StandardError = "invalid MFA token algorithm: %s"
	ErrMfaTokenInvalidPeriod    StandardError = "invalid MFA token period: %d"
	ErrMfaTokenInvalidDigits    StandardError = "invalid MFA token digits: %d"
	ErrMfaTokenInvalidPasscode  StandardError = "invalid MFA token passcode: %v"

	ErrWebAuthnRegisterNotFound                          StandardError = "webauthn register not found"
	ErrWebAuthnChallengeNotFound                         StandardError = "webauthn challenge not found"
	ErrWebAuthnParse                                     StandardError = "failed parsing webauthn request: %v"
	ErrWebAuthnEmptyRegisterID                           StandardError = "webauthn register id is empty"
	ErrWebAuthnEmptyRegisterKeyType                      StandardError = "webauthn register key type is empty"
	ErrWebAuthnInvalidRegisterKeyType                    StandardError = "invalid webauthn register key type: %v"
	ErrWebAuthnEmptyRegisterTransport                    StandardError = "webauthn register key transport is empty"
	ErrWebAuthnInvalidRegisterTransport                  StandardError = "invalid webauthn register key transport: %v"
	ErrWebAuthnRegisterAttestationObjectNotFound         StandardError = "webauthn register attestation object not found"
	ErrWebAuthnRegisterAuthDataNotFound                  StandardError = "webauthn register attestation object auth data not found"
	ErrWebAuthnRegisterCredentialDataNotFound            StandardError = "webauthn register attestation object auth data credential not found"
	ErrWebAuthnRegisterEmptyRelyingPartyID               StandardError = "webauthn register attestation object auth data rpIdHash empty"
	ErrWebAuthnRegisterEmptyFlags                        StandardError = "webauthn register attestation object auth data flags empty"
	ErrWebAuthnRegisterPublicKeyNotFound                 StandardError = "webauthn register attestation object auth data credential public key not found"
	ErrWebAuthnRegisterPublicKeyUnsupported              StandardError = "webauthn register attestation object auth data credential public key type %v is unsupported"
	ErrWebAuthnRegisterPublicKeyTypeNotFound             StandardError = "webauthn register attestation object auth data credential public key type not found"
	ErrWebAuthnRegisterPublicKeyAlgorithmUnsupported     StandardError = "webauthn register attestation object auth data credential public key algorithm %v is unsupported"
	ErrWebAuthnRegisterPublicKeyAlgorithmNotFound        StandardError = "webauthn register attestation object auth data credential public key algorithm not found"
	ErrWebAuthnRegisterPublicKeyCurveUnsupported         StandardError = "webauthn register attestation object auth data credential public key curve_type %v is unsupported"
	ErrWebAuthnRegisterPublicKeyTypeAlgorithmUnsupported StandardError = "webauthn register attestation object auth data credential public key type %q and algorithm %q are unsupported"
	ErrWebAuthnRegisterPublicKeyCurveCoord               StandardError = "webauthn register attestation object auth data credential public key curve %v coordinate error: %v"
	ErrWebAuthnRequest                                   StandardError = "webauthn request failed: %v"
	ErrWebAuthnVerifyRequest                             StandardError = "webauthn authentication request failed: %v"
)

MFA token errors.

const (
	ErrPublicKeyEmptyPayload         StandardError = "public key payload is empty"
	ErrPublicKeyInvalidUsage         StandardError = "public key usage %q is invalid"
	ErrPublicKeyUsagePayloadMismatch StandardError = "public key usage %q does not match its payload"
	ErrPublicKeyBlockType            StandardError = "public key block type %q is invalid"
	ErrPublicKeyParse                StandardError = "public key parse failed: %v"
	ErrPublicKeyUsageUnsupported     StandardError = "public key usage %q is unsupported"
	ErrPublicKeyTypeUnsupported      StandardError = "public key type %q is unsupported"
)

Public key errors.

func (StandardError) Error

func (e StandardError) Error() string

func (StandardError) WithArgs

func (e StandardError) WithArgs(v ...interface{}) error

WithArgs accepts errors with parameters.

Jump to

Keyboard shortcuts

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