errors

package
v1.3.24 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: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtendedError

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

ExtendedError is an error with parameters.

func (ExtendedError) Error

func (e ExtendedError) Error() string

Error returns error string.

func (ExtendedError) Unwrap

func (e ExtendedError) Unwrap() error

Unwrap returns unwrapped error.

type StandardError

type StandardError string

StandardError is a standard error.

const (
	ErrAccessListRuleConfig          StandardError = "acl rule configuration error: %v: %v"
	ErrAccessListRuleConditionConfig StandardError = "acl rule condition configuration error: %v: %v"
	ErrAccessListNoRules             StandardError = "acl has no rules"
)

ACL Errors

const (
	ErrInvalidSecretLength     StandardError = "secrets less than 16 characters in length are not allowed"
	ErrUnexpectedKID           StandardError = "the kid specified in the header was not found"
	ErrNoRSAKeyFound           StandardError = "no RSA key found"
	ErrNoECDSAKeyFound         StandardError = "no ECDSA key found"
	ErrUnsupportedRSAKeyType   StandardError = "unsupported RSA key type %T"
	ErrUnsupportedECDSAKeyType StandardError = "unsupported ECDSA key type %T"

	ErrUnexpectedSigningMethod StandardError = "signing method mismatch: %v (expected) vs. %v (received)"
)

Errors associated with backend package.

const (
	ErrCacheEmptyToken StandardError = "cache: user token is empty"
	ErrCacheNilUser    StandardError = "cache: user is nil"
)

Cache Errors

const (
	ErrEmptyACLAction                     StandardError = "empty access list action"
	ErrEmptyACLClaim                      StandardError = "empty access list claim"
	ErrEmptyMethod                        StandardError = "empty http method"
	ErrEmptyPath                          StandardError = "empty http path"
	ErrEmptyClaim                         StandardError = "empty claim value"
	ErrEmptyValue                         StandardError = "empty value"
	ErrNoValues                           StandardError = "no acl.Values"
	ErrUnsupportedACLAction               StandardError = "unsupported access list action: %s"
	ErrUnsupportedClaim                   StandardError = "access list does not support %s claim, only audiences, roles, scopes"
	ErrUnsupportedMethod                  StandardError = "unsupported http method: %s"
	ErrKeyIDNotFound                      StandardError = "key ID not found"
	ErrUnsupportedKeyType                 StandardError = "unsupported key type %T for key ID %s"
	ErrRSAKeysNotFound                    StandardError = "no RSA keys found"
	ErrECDSAKeysNotFound                  StandardError = "no ECDSA keys found"
	ErrPrivateKeysNotFound                StandardError = "no private keys found"
	ErrUnknownConfigSource                StandardError = "sig key config source is not found"
	ErrReadPEMFile                        StandardError = "(source: %s): read PEM file: %v"
	ErrWalkDir                            StandardError = "walking directory: %v"
	ErrProvisonFailed                     StandardError = "authorization provider provisioning error"
	ErrEmptyProviderName                  StandardError = "authorization provider name is empty"
	ErrNoMemberReference                  StandardError = "no member reference found"
	ErrTooManyPrimaryInstances            StandardError = "found more than one primaryInstance instance of the plugin for %s context"
	ErrUndefinedSecret                    StandardError = "%s: token keys and secrets must be defined either via environment variables or via token_ configuration element"
	ErrInvalidConfiguration               StandardError = "%s: configuration error: %v"
	ErrTokenAlreadyConfigured             StandardError = "token already configured"
	ErrLoadCryptoKeyConfig                StandardError = "%s: failed loading token in %s context: %v"
	ErrUnsupportedSignatureMethod         StandardError = "%s: unsupported token sign/verify method: %s"
	ErrUnsupportedTokenSource             StandardError = "%s: unsupported token source: %s"
	ErrInvalidBackendConfiguration        StandardError = "%s: token validator configuration error: %s"
	ErrUnknownProvider                    StandardError = "authorization provider %s not found"
	ErrInvalidProvider                    StandardError = "authorization provider %s is nil"
	ErrNoPrimaryInstanceProvider          StandardError = "no primaryInstance authorization provider found in %s context when configuring %s"
	ErrNoCryptoKeysFound                  StandardError = "no crypto keys found in %s context"
	ErrLoadingKeys                        StandardError = "loading %s keys: %v"
	ErrInvalidClaimExpiresAt              StandardError = "invalid exp type: %T"
	ErrInvalidClaimIssuedAt               StandardError = "invalid iat type: %T"
	ErrInvalidClaimNotBefore              StandardError = "invalid nbf type: %T"
	ErrInvalidSigningMethod               StandardError = "unsupported signing method"
	ErrEmptySecret                        StandardError = "empty secrets are not supported"
	ErrInvalidAudience                    StandardError = "invalid audience type %T in audience"
	ErrInvalidAudienceType                StandardError = "invalid audience type %T"
	ErrInvalidRole                        StandardError = "invalid role type %T in roles"
	ErrInvalidRoleType                    StandardError = "invalid roles type %T"
	ErrInvalidScope                       StandardError = "invalid scope type %T in scopes"
	ErrInvalidScopeType                   StandardError = "invalid scopes type %T"
	ErrInvalidOrg                         StandardError = "invalid org type %T in orgs"
	ErrInvalidOrgType                     StandardError = "invalid orgs type %T"
	ErrInvalidAppMetadataRoleType         StandardError = "invalid roles type %T in app_metadata-authorization"
	ErrInvalidAddrType                    StandardError = "invalid ip address type %T in addr"
	ErrInvalidAccessListPath              StandardError = "invalid acl path type %T in paths"
	ErrInvalidIDClaimType                 StandardError = "invalid jti claim value type %T"
	ErrInvalidIssuerClaimType             StandardError = "invalid iss claim value type %T"
	ErrInvalidSubjectClaimType            StandardError = "invalid sub claim value type %T"
	ErrInvalidEmailClaimType              StandardError = "invalid %s claim value type %T"
	ErrInvalidNameClaimType               StandardError = "invalid name claim value type %T"
	ErrInvalidOriginClaimType             StandardError = "invalid origin claim value type %T"
	ErrInvalidPictureClaimType            StandardError = "invalid picture claim value type %T"
	ErrInvalidMetadataClaimType           StandardError = "invalid metadata claim value type %T"
	ErrSigningOptionsNotFound             StandardError = "signing options not found"
	ErrSigningMethodNotFound              StandardError = "signing method not found"
	ErrSharedSigningKeyNotFound           StandardError = "shared secret for signing not found"
	ErrPrivateSigningKeyNotFound          StandardError = "private key for signing not found"
	ErrNoBackends                         StandardError = "no token backends available"
	ErrExpiredToken                       StandardError = "expired token"
	ErrNoAccessList                       StandardError = "user role is valid, but denied by default deny on empty access list"
	ErrAccessNotAllowed                   StandardError = "user role is valid, but not allowed by access list"
	ErrAccessNotAllowedByPathACL          StandardError = "user role is valid, but not allowed by path access list"
	ErrSourceAddressNotFound              StandardError = "source ip validation is enabled, but no ip address claim found"
	ErrSourceAddressMismatch              StandardError = "source ip address mismatch between the claim %s and request %s"
	ErrNoParsedClaims                     StandardError = "failed to extract claims"
	ErrNoTokenFound                       StandardError = "no token found"
	ErrInvalidParsedClaims                StandardError = "failed to extract claims: %s"
	ErrInvalidSecret                      StandardError = "secret key backend error: %s"
	ErrInvalid                            StandardError = "%v"
	ErrMixedAlgorithms                    StandardError = "mixed key algorithms found in %s: %v"
	ErrFoundDuplicateKeyID                StandardError = "duplicate kid %s for %s keys found in %s"
	ErrMixedConfigKeyType                 StandardError = "failed adding key to %s config, key type %s"
	ErrUnsupportedConfigKeyType           StandardError = "unsupported key type in token config: %T"
	ErrNotECDSAPrivatePEMEncodedKey       StandardError = "the key is not ECDSA private PEM-encoded key: %s"
	ErrNotPEMEncodedKey                   StandardError = "the key is not PEM-encoded key"
	ErrNotECDSAPrivateKey                 StandardError = "the key is not ECDSA private key"
	ErrNotECDSAPublicKey                  StandardError = "the key is not ECDSA public key"
	ErrNotECDSAPublicKeyType              StandardError = "the key is not ECDSA public key: %T"
	ErrEmptyCryptoKeyConfigOrigin         StandardError = "empty token config origin"
	ErrUnsupportedCryptoKeyConfigOrigin   StandardError = "unsupported token config origin: %s"
	ErrPrimaryRegistrationFailed          StandardError = "primary instance registration for %s context failed"
	ErrRegistrationTimeout                StandardError = "non-primary instance registration in %s context timed out"
	ErrAuthorizerFailed                   StandardError = "authorizer %s in %s context failed"
	ErrContextNotFound                    StandardError = "authorizer %s in %s context not found"
	ErrContextFailed                      StandardError = "authorizer %s in failed %s context"
	ErrPrimaryInstanceNotFound            StandardError = "authorizer %s has not primary instance in %s context"
	ErrPrimaryInstanceNotInitialized      StandardError = "authorizer %s has uninitialized primary instance in %s context"
	ErrPrimaryInstanceFailed              StandardError = "authorizer %s has failed primary instance in %s context"
	ErrInstanceValidatationTimeout        StandardError = "authorizer %s in %s context failed to due to timeout"
	ErrMultipleSigningKeys                StandardError = "multiple signing keys found"
	ErrSigningKeyNotFound                 StandardError = "signing key not found for %v"
	ErrSigningKeyNil                      StandardError = "signing key is nil"
	ErrSigningKeyTooShort                 StandardError = "signing key is too short"
	ErrDataSigningFailed                  StandardError = "data signing failed for %v: %v"
	ErrGetSignedTokenEmpty                StandardError = "token signing failed for %v: empty signed token"
	ErrSigningKeyMethodPrivateKeyConflict StandardError = "token signing failed: method and private key conflict %s vs. %s"
	ErrParsePrivateRSAKey                 StandardError = "failed to parse private RSA key: %v"
	ErrParsePrivateECDSAKey               StandardError = "failed to parse private ECDSA key: %v"
	ErrParsePublicRSAKey                  StandardError = "failed to parse public RSA key: %v"
	ErrParsePublicECDSAKey                StandardError = "failed to parse public ECDSA key: %v"
	ErrECDSAPrivateKeyCurveNotSupported   StandardError = "the private ECDSA key has unsupported curve: %s"
	ErrUnsupportedECDSACurve              StandardError = "found unsupported ECDSA curve: %s"
	ErrEmptyECDSACurve                    StandardError = "found empty ECDSA curve"
	ErrNoECDSACurveParamsFound            StandardError = "no ECDSA curve parameters found"
	ErrParseEnvVar                        StandardError = "failed to parse environment variable %s: %v"
	ErrEncryptionKeysNotFound             StandardError = "encryption keys not found"
	ErrKeyOverwriteFailed                 StandardError = "failed to overwrite used key id %s"
	ErrKeyNil                             StandardError = "key is nil"
	ErrCryptoKeyConfigNil                 StandardError = "token configuration is nil"
	ErrFailed                             StandardError = "encountered error: %v"

	// InstanceManager errors.
	ErrInstanceManagerValidate StandardError = "instance %q validation failed: %v"
)

Generic Errors

const (
	ErrTokenGrantorNoSigningKeysFound     StandardError = "token grantor: signing keys not found"
	ErrTokenGrantorUnsupportedAlgo        StandardError = "token grantor: unsupported algo: %s"
	ErrTokenGrantorNoClaimsFound          StandardError = "token grantor: claims not provided"
	ErrTokenGrantorKeyNoSigningCapability StandardError = "token grantor: key has no signing capability"
	ErrTokenGrantorKeyTokenNameNotSet     StandardError = "token grantor: key has no token name set"
	ErrTokenGrantorKeyMaxLifetimeNotSet   StandardError = "token grantor: key has no max token lifetime set"
)

Token Grantor Errors

const (
	// CryptoKeyConfig
	ErrCryptoKeyConfigNewInvalidArgs            StandardError = "kms: invalid token config arguments: %v"
	ErrCryptoKeyConfigNewArgTypeInvalid         StandardError = "kms: invalid token config argument type: %T"
	ErrCryptoKeyConfigNewFailedUnmarshal        StandardError = "kms: failed unmarshal token config: %v"
	ErrCryptoKeyConfigNewEmptyArg               StandardError = "kms: emtpy token config arguments"
	ErrCryptoKeyConfigReadFile                  StandardError = "kms: failed to open file %q referenced in token config: %v"
	ErrCryptoKeyConfigFileNotSupported          StandardError = "kms: file %q is not supported due to extension type"
	ErrCryptoKeyConfigFileKeyNotFound           StandardError = "kms: file %q has no keys"
	ErrCryptoKeyConfigUnsupportedPrivateKeyAlgo StandardError = "unsupported private key algo %T"
	ErrCryptoKeyConfigUnsupportedPublicKeyAlgo  StandardError = "unsupported public key algo %T"
	ErrCryptoKeyConfigEmptyEnvVar               StandardError = "environment variable %s has empty value"
	ErrCryptoKeyConfigEntryInvalid              StandardError = "key config entry %q is invalid: %v"
	ErrCryptoKeyConfigNoConfigFound             StandardError = "no key configs found"
	ErrCryptoKeyConfigKeyInvalid                StandardError = "key config %d is invalid: %v"

	// KeyManager
	ErrKeyManagerAddKeyNil                  StandardError = "kms: failed adding nil key to key manager"
	ErrKeyManagerCryptoKeyConfigInvalidType StandardError = "kms: failed key manager with invalid token config type: %T"
	// Keystore
	ErrKeystoreAddKeyNil                      StandardError = "keystore: failed adding nil key to keystore"
	ErrCryptoKeyStoreAddKeyNil                StandardError = "keystore: failed adding nil key to keystore"
	ErrCryptoKeyStoreParseTokenFailed         StandardError = "keystore: failed to parse token"
	ErrCryptoKeyStoreSignTokenFailed          StandardError = "keystore: failed to sign token"
	ErrCryptoKeyStoreNoVerifyKeysFound        StandardError = "keystore: no verification keys found"
	ErrCryptoKeyStoreNoSignKeysFound          StandardError = "keystore: no signing keys found"
	ErrCryptoKeyStoreAutoGenerateNotAvailable StandardError = "auto-generate not available when keystore is not empty"
	ErrCryptoKeyStoreAutoGenerateFailed       StandardError = "failed to auto-generate keystore keypair: %v"
	ErrCryptoKeyStoreAutoGenerateAlgo         StandardError = "auto-generate does not support %q algorithm"
	// Signing
	ErrUnsupportedSigningMethod StandardError = "kms: grantor does not support %s token signing method"
)

Key Management System Errors

const (
	ErrProviderCatalogRegisterContextNotRegistered StandardError = "idp catalog: provider context does not registered"
	ErrIdentityProviderConfigInvalid               StandardError = "invalid idp config: %v"
	ErrBasicAuthFailed                             StandardError = "basic auth failed"
	ErrAPIKeyAuthFailed                            StandardError = "api key auth failed"
)

Identity Provider Catalog Errors

const (
	ErrClaimNil                StandardError = "user claim is nil"
	ErrInvalidUserDataType     StandardError = "user data type is invalid"
	ErrCheckpointInvalidType   StandardError = "failed creating checkpoint with %T data type: %v"
	ErrCheckpointInvalidInput  StandardError = "failed creating checkpoint for %v: %v"
	ErrCheckpointEmpty         StandardError = "failed creating checkpoint: empty input"
	ErrFrontendLinkInvalidType StandardError = "failed creating frontend link with %T data type: %v"
)

User Errors

const (
	ErrValidatorCryptoKeyStoreNoKeys       StandardError = "token validator: no keys found when adding to keystore"
	ErrValidatorCryptoKeyStoreNoVerifyKeys StandardError = "token validator: no verification keys found when adding to keystore"
	ErrValidatorInvalidToken               StandardError = "token validator: invalid token: %v"
	ErrInvalidSourcePriority               StandardError = "token validator: invalid token source priority"
	ErrInvalidSourceName                   StandardError = "token validator: invalid token source name: %s"
	ErrDuplicateSourceName                 StandardError = "token validator: duplicate token source name: %s"
	ErrTokenNamesNotFound                  StandardError = "token validator: allowed token names not provided"
	ErrEmptyTokenName                      StandardError = "token validator: a token name is empty"
	ErrDuplicateTokenName                  StandardError = "token validator: duplicate allowed token name: %s"
	ErrTokenValidatorOptionsNotFound       StandardError = "token validator: options not found"
	ErrValidatorIdentityProvider           StandardError = "token validator: identity provider config is nil"
)

Token Validator 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