github.com/greenpau/go-authcrunch@v1.1.4/pkg/errors/identity_provider.go (about) 1 // Copyright 2022 Paul Greenberg greenpau@outlook.com 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package errors 16 17 // Identity Provider Errors 18 const ( 19 ErrIdentityProviderConfigInvalid StandardError = "invalid identity provider config: %v" 20 21 // Generic Errors. 22 ErrIdentityProviderRequest StandardError = "%s failed: %v" 23 24 // Config Errors. 25 ErrIdentityProviderConfigureEmptyConfig StandardError = "identity provider configuration is empty" 26 ErrIdentityProviderConfigureLoggerNotFound StandardError = "identity provider configuration has no logger" 27 ErrIdentityProviderConfigureNameEmpty StandardError = "identity provider configuration has empty name" 28 ErrIdentityProviderConfigureRealmEmpty StandardError = "identity provider configuration has empty realm" 29 ErrIdentityProviderNewConfig StandardError = "identity provider config %v error: %v" 30 ErrIdentityProviderConfig StandardError = "identity provider config error: %v" 31 32 // OAuth Errors. 33 ErrIdentityProviderOauthAuthorizationStateNotFound StandardError = "OAuth 2.0 authorization state not found" 34 ErrIdentityProviderOauthAuthorizationFailedDetailed StandardError = "failed OAuth 2.0 authorization flow, error: %s, description: %s" 35 ErrIdentityProviderOauthAuthorizationFailed StandardError = "failed OAuth 2.0 authorization flow, error: %s" 36 ErrIdentityProviderOauthFetchAccessTokenFailed StandardError = "failed fetching OAuth 2.0 access token: %s" 37 ErrIdentityProviderOauthFetchClaimsFailed StandardError = "failed fetching OAuth 2.0 claims: %s" 38 ErrIdentityProviderOauthFetchUserInfoFailed StandardError = "failed fetching OAuth 2.0 user info: %v" 39 ErrIdentityProviderOauthFetchUserGroupsFailed StandardError = "failed fetching OAuth 2.0 user groups: %v" 40 ErrIdentityProviderOauthValidateAccessTokenFailed StandardError = "failed validating OAuth 2.0 access token: %s" 41 ErrIdentityProviderOauthResponseProcessingFailed StandardError = "unable to process OAuth 2.0 response" 42 ErrIdentityProviderOauthGetAccessTokenFailedDetailed StandardError = "failed obtaining OAuth 2.0 access token, error: %v, description: %q" 43 44 ErrIdentityProviderOauthKeyFetchFailed StandardError = "failed to fetch jwt keys for OAuth 2.0 authorization server: %s" 45 ErrIdentityProviderOauthMetadataFieldNotFound StandardError = "metadata %s field not found for provider %s" 46 ErrIdentityProviderOauthJwksResponseKeysNotFound StandardError = "jwks response has no keys field" 47 ErrIdentityProviderOauthJwksKeysParseFailed StandardError = "failed to compile jwks keys into JSON: %v" 48 ErrIdentityProviderOauthJwksKeysNotFound StandardError = "no jwks keys found" 49 ErrIdentityProviderOauthJwksKeysTooManyAttempts StandardError = "too many attemps to fetch jwks keys" 50 51 ErrIdentityProviderOauthJwksInvalidKey StandardError = "invalid jwks key: %v" 52 ErrIdentityProviderOAuthAccessTokenNotFound StandardError = "OAuth 2.0 %s not found" 53 ErrIdentityProviderOAuthAccessTokenSignMethodNotSupported StandardError = "OAuth 2.0 %s signed with unsupported algorithm: %v" 54 ErrIdentityProviderOAuthAccessTokenKeyIDNotFound StandardError = "OAuth 2.0 kid not found in %s" 55 ErrIdentityProviderOAuthAccessTokenKeyIDNotRegistered StandardError = "OAuth 2.0 %s has unregisted key id %v" 56 ErrIdentityProviderOAuthParseToken StandardError = "OAuth 2.0 failed to parse %s: %v" 57 58 ErrIdentityProviderOAuthInvalidToken StandardError = "OAuth 2.0 %s is invalid: %v" 59 ErrIdentityProviderOAuthNonceValidationFailed StandardError = "OAuth 2.0 %s nonce claim validation failed: %v" 60 ErrIdentityProviderOAuthEmailNotFound StandardError = "OAuth 2.0 %s email claim not found" 61 62 ErrIdentityProviderOauthMetadataFetchFailed StandardError = "failed to fetch metadata for OAuth 2.0 authorization server: %s" 63 ErrIdentityProviderOauthGetAccessTokenFailed StandardError = "failed obtaining OAuth 2.0 access token, error: %v" 64 ErrIdentityProviderAuthorizationServerResponseFieldNotFound StandardError = "authorization server response has no %q field" 65 )