Documentation
¶
Index ¶
- Variables
- func ErrorInvalidAuthorization(format string, args ...interface{}) *errors.Error
- func ErrorInvalidBearerToken(format string, args ...interface{}) *errors.Error
- func ErrorInvalidClaims(format string, args ...interface{}) *errors.Error
- func ErrorInvalidCredentials(format string, args ...interface{}) *errors.Error
- func ErrorSecurityErrorReasonUnspecified(format string, args ...interface{}) *errors.Error
- func ErrorSignTokenFailed(format string, args ...interface{}) *errors.Error
- func ErrorTokenExpired(format string, args ...interface{}) *errors.Error
- func ErrorTokenInvalid(format string, args ...interface{}) *errors.Error
- func ErrorTokenMissing(format string, args ...interface{}) *errors.Error
- func ErrorUnsupportedSigningMethod(format string, args ...interface{}) *errors.Error
- func IsInvalidAuthorization(err error) bool
- func IsInvalidBearerToken(err error) bool
- func IsInvalidClaims(err error) bool
- func IsInvalidCredentials(err error) bool
- func IsSecurityErrorReasonUnspecified(err error) bool
- func IsSignTokenFailed(err error) bool
- func IsTokenExpired(err error) bool
- func IsTokenInvalid(err error) bool
- func IsTokenMissing(err error) bool
- func IsUnsupportedSigningMethod(err error) bool
- type SecurityErrorReason
- func (SecurityErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x SecurityErrorReason) Enum() *SecurityErrorReason
- func (SecurityErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x SecurityErrorReason) Number() protoreflect.EnumNumber
- func (x SecurityErrorReason) String() string
- func (SecurityErrorReason) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( SecurityErrorReason_name = map[int32]string{ 0: "SECURITY_ERROR_REASON_UNSPECIFIED", 1002: "INVALID_CREDENTIALS", 1003: "TOKEN_EXPIRED", 1004: "TOKEN_INVALID", 1005: "TOKEN_MISSING", 1006: "INVALID_CLAIMS", 1007: "INVALID_BEARER_TOKEN", 1008: "UNSUPPORTED_SIGNING_METHOD", 1009: "SIGN_TOKEN_FAILED", 2000: "INVALID_AUTHORIZATION", } SecurityErrorReason_value = map[string]int32{ "SECURITY_ERROR_REASON_UNSPECIFIED": 0, "INVALID_CREDENTIALS": 1002, "TOKEN_EXPIRED": 1003, "TOKEN_INVALID": 1004, "TOKEN_MISSING": 1005, "INVALID_CLAIMS": 1006, "INVALID_BEARER_TOKEN": 1007, "UNSUPPORTED_SIGNING_METHOD": 1008, "SIGN_TOKEN_FAILED": 1009, "INVALID_AUTHORIZATION": 2000, } )
Enum value maps for SecurityErrorReason.
var File_runtime_security_v1_error_proto protoreflect.FileDescriptor
Functions ¶
func ErrorInvalidAuthorization ¶
The user is authenticated but does not have permission for the specific resource or action.
func ErrorInvalidBearerToken ¶
The bearer token is specifically invalid or malformed.
func ErrorInvalidClaims ¶
The claims within the token are invalid.
func ErrorInvalidCredentials ¶
The provided credentials (e.g., username/password) are invalid.
func ErrorSecurityErrorReasonUnspecified ¶
The default, unspecified reason. This is required by proto3 syntax.
func ErrorSignTokenFailed ¶
Failed to sign a new token.
func ErrorTokenExpired ¶
The authentication token has expired.
func ErrorTokenInvalid ¶
The authentication token is malformed or invalid.
func ErrorTokenMissing ¶
The authentication token is missing from the request.
func ErrorUnsupportedSigningMethod ¶
The signing method used in the token is not supported.
func IsInvalidAuthorization ¶
The user is authenticated but does not have permission for the specific resource or action.
func IsInvalidBearerToken ¶
The bearer token is specifically invalid or malformed.
func IsInvalidClaims ¶
The claims within the token are invalid.
func IsInvalidCredentials ¶
The provided credentials (e.g., username/password) are invalid.
func IsSecurityErrorReasonUnspecified ¶
The default, unspecified reason. This is required by proto3 syntax.
func IsTokenInvalid ¶
The authentication token is malformed or invalid.
func IsTokenMissing ¶
The authentication token is missing from the request.
func IsUnsupportedSigningMethod ¶
The signing method used in the token is not supported.
Types ¶
type SecurityErrorReason ¶
type SecurityErrorReason int32
SecurityErrorReason defines the application's specific security error codes. These codes supplement the common error codes and provide more specific details for authentication and authorization failures.
const ( // The default, unspecified reason. This is required by proto3 syntax. SecurityErrorReason_SECURITY_ERROR_REASON_UNSPECIFIED SecurityErrorReason = 0 // The provided credentials (e.g., username/password) are invalid. SecurityErrorReason_INVALID_CREDENTIALS SecurityErrorReason = 1002 // The authentication token has expired. SecurityErrorReason_TOKEN_EXPIRED SecurityErrorReason = 1003 // The authentication token is malformed or invalid. SecurityErrorReason_TOKEN_INVALID SecurityErrorReason = 1004 // The authentication token is missing from the request. SecurityErrorReason_TOKEN_MISSING SecurityErrorReason = 1005 // The claims within the token are invalid. SecurityErrorReason_INVALID_CLAIMS SecurityErrorReason = 1006 // The bearer token is specifically invalid or malformed. SecurityErrorReason_INVALID_BEARER_TOKEN SecurityErrorReason = 1007 // The signing method used in the token is not supported. SecurityErrorReason_UNSUPPORTED_SIGNING_METHOD SecurityErrorReason = 1008 // Failed to sign a new token. SecurityErrorReason_SIGN_TOKEN_FAILED SecurityErrorReason = 1009 // The user is authenticated but does not have permission for the specific resource or action. SecurityErrorReason_INVALID_AUTHORIZATION SecurityErrorReason = 2000 )
func (SecurityErrorReason) Descriptor ¶
func (SecurityErrorReason) Descriptor() protoreflect.EnumDescriptor
func (SecurityErrorReason) Enum ¶
func (x SecurityErrorReason) Enum() *SecurityErrorReason
func (SecurityErrorReason) EnumDescriptor
deprecated
func (SecurityErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use SecurityErrorReason.Descriptor instead.
func (SecurityErrorReason) Number ¶
func (x SecurityErrorReason) Number() protoreflect.EnumNumber
func (SecurityErrorReason) String ¶
func (x SecurityErrorReason) String() string
func (SecurityErrorReason) Type ¶
func (SecurityErrorReason) Type() protoreflect.EnumType