securityv1

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_runtime_security_v1_error_proto protoreflect.FileDescriptor

Functions

func ErrorInvalidAuthorization

func ErrorInvalidAuthorization(format string, args ...interface{}) *errors.Error

The user is authenticated but does not have permission for the specific resource or action.

func ErrorInvalidBearerToken

func ErrorInvalidBearerToken(format string, args ...interface{}) *errors.Error

The bearer token is specifically invalid or malformed.

func ErrorInvalidClaims

func ErrorInvalidClaims(format string, args ...interface{}) *errors.Error

The claims within the token are invalid.

func ErrorInvalidCredentials

func ErrorInvalidCredentials(format string, args ...interface{}) *errors.Error

The provided credentials (e.g., username/password) are invalid.

func ErrorSecurityErrorReasonUnspecified

func ErrorSecurityErrorReasonUnspecified(format string, args ...interface{}) *errors.Error

The default, unspecified reason. This is required by proto3 syntax.

func ErrorSignTokenFailed

func ErrorSignTokenFailed(format string, args ...interface{}) *errors.Error

Failed to sign a new token.

func ErrorTokenExpired

func ErrorTokenExpired(format string, args ...interface{}) *errors.Error

The authentication token has expired.

func ErrorTokenInvalid

func ErrorTokenInvalid(format string, args ...interface{}) *errors.Error

The authentication token is malformed or invalid.

func ErrorTokenMissing

func ErrorTokenMissing(format string, args ...interface{}) *errors.Error

The authentication token is missing from the request.

func ErrorUnsupportedSigningMethod

func ErrorUnsupportedSigningMethod(format string, args ...interface{}) *errors.Error

The signing method used in the token is not supported.

func IsInvalidAuthorization

func IsInvalidAuthorization(err error) bool

The user is authenticated but does not have permission for the specific resource or action.

func IsInvalidBearerToken

func IsInvalidBearerToken(err error) bool

The bearer token is specifically invalid or malformed.

func IsInvalidClaims

func IsInvalidClaims(err error) bool

The claims within the token are invalid.

func IsInvalidCredentials

func IsInvalidCredentials(err error) bool

The provided credentials (e.g., username/password) are invalid.

func IsSecurityErrorReasonUnspecified

func IsSecurityErrorReasonUnspecified(err error) bool

The default, unspecified reason. This is required by proto3 syntax.

func IsSignTokenFailed

func IsSignTokenFailed(err error) bool

Failed to sign a new token.

func IsTokenExpired

func IsTokenExpired(err error) bool

The authentication token has expired.

func IsTokenInvalid

func IsTokenInvalid(err error) bool

The authentication token is malformed or invalid.

func IsTokenMissing

func IsTokenMissing(err error) bool

The authentication token is missing from the request.

func IsUnsupportedSigningMethod

func IsUnsupportedSigningMethod(err error) bool

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) Enum

func (SecurityErrorReason) EnumDescriptor deprecated

func (SecurityErrorReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use SecurityErrorReason.Descriptor instead.

func (SecurityErrorReason) Number

func (SecurityErrorReason) String

func (x SecurityErrorReason) String() string

func (SecurityErrorReason) Type

Jump to

Keyboard shortcuts

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