securityv1

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 22 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_config_security_v1_error_proto protoreflect.FileDescriptor
View Source
var File_config_security_v1_security_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 AuthNConfigs

type AuthNConfigs struct {
	Default *string     `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"`
	Active  *string     `protobuf:"bytes,2,opt,name=active,proto3,oneof" json:"active,omitempty"`
	Configs []*v1.AuthN `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthNConfigs) Descriptor deprecated

func (*AuthNConfigs) Descriptor() ([]byte, []int)

Deprecated: Use AuthNConfigs.ProtoReflect.Descriptor instead.

func (*AuthNConfigs) GetActive

func (x *AuthNConfigs) GetActive() string

func (*AuthNConfigs) GetConfigs

func (x *AuthNConfigs) GetConfigs() []*v1.AuthN

func (*AuthNConfigs) GetDefault

func (x *AuthNConfigs) GetDefault() string

func (*AuthNConfigs) ProtoMessage

func (*AuthNConfigs) ProtoMessage()

func (*AuthNConfigs) ProtoReflect

func (x *AuthNConfigs) ProtoReflect() protoreflect.Message

func (*AuthNConfigs) Reset

func (x *AuthNConfigs) Reset()

func (*AuthNConfigs) String

func (x *AuthNConfigs) String() string

func (*AuthNConfigs) Validate

func (m *AuthNConfigs) Validate() error

Validate checks the field values on AuthNConfigs with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AuthNConfigs) ValidateAll

func (m *AuthNConfigs) ValidateAll() error

ValidateAll checks the field values on AuthNConfigs with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AuthNConfigsMultiError, or nil if none found.

type AuthNConfigsMultiError

type AuthNConfigsMultiError []error

AuthNConfigsMultiError is an error wrapping multiple validation errors returned by AuthNConfigs.ValidateAll() if the designated constraints aren't met.

func (AuthNConfigsMultiError) AllErrors

func (m AuthNConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthNConfigsMultiError) Error

func (m AuthNConfigsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AuthNConfigsValidationError

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

AuthNConfigsValidationError is the validation error returned by AuthNConfigs.Validate if the designated constraints aren't met.

func (AuthNConfigsValidationError) Cause

Cause function returns cause value.

func (AuthNConfigsValidationError) Error

Error satisfies the builtin error interface

func (AuthNConfigsValidationError) ErrorName

func (e AuthNConfigsValidationError) ErrorName() string

ErrorName returns error name.

func (AuthNConfigsValidationError) Field

Field function returns field value.

func (AuthNConfigsValidationError) Key

Key function returns key value.

func (AuthNConfigsValidationError) Reason

Reason function returns reason value.

type AuthZConfigs

type AuthZConfigs struct {
	Default *string      `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"`
	Active  *string      `protobuf:"bytes,2,opt,name=active,proto3,oneof" json:"active,omitempty"`
	Configs []*v11.AuthZ `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthZConfigs) Descriptor deprecated

func (*AuthZConfigs) Descriptor() ([]byte, []int)

Deprecated: Use AuthZConfigs.ProtoReflect.Descriptor instead.

func (*AuthZConfigs) GetActive

func (x *AuthZConfigs) GetActive() string

func (*AuthZConfigs) GetConfigs

func (x *AuthZConfigs) GetConfigs() []*v11.AuthZ

func (*AuthZConfigs) GetDefault

func (x *AuthZConfigs) GetDefault() string

func (*AuthZConfigs) ProtoMessage

func (*AuthZConfigs) ProtoMessage()

func (*AuthZConfigs) ProtoReflect

func (x *AuthZConfigs) ProtoReflect() protoreflect.Message

func (*AuthZConfigs) Reset

func (x *AuthZConfigs) Reset()

func (*AuthZConfigs) String

func (x *AuthZConfigs) String() string

func (*AuthZConfigs) Validate

func (m *AuthZConfigs) Validate() error

Validate checks the field values on AuthZConfigs with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AuthZConfigs) ValidateAll

func (m *AuthZConfigs) ValidateAll() error

ValidateAll checks the field values on AuthZConfigs with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AuthZConfigsMultiError, or nil if none found.

type AuthZConfigsMultiError

type AuthZConfigsMultiError []error

AuthZConfigsMultiError is an error wrapping multiple validation errors returned by AuthZConfigs.ValidateAll() if the designated constraints aren't met.

func (AuthZConfigsMultiError) AllErrors

func (m AuthZConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthZConfigsMultiError) Error

func (m AuthZConfigsMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type AuthZConfigsValidationError

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

AuthZConfigsValidationError is the validation error returned by AuthZConfigs.Validate if the designated constraints aren't met.

func (AuthZConfigsValidationError) Cause

Cause function returns cause value.

func (AuthZConfigsValidationError) Error

Error satisfies the builtin error interface

func (AuthZConfigsValidationError) ErrorName

func (e AuthZConfigsValidationError) ErrorName() string

ErrorName returns error name.

func (AuthZConfigsValidationError) Field

Field function returns field value.

func (AuthZConfigsValidationError) Key

Key function returns key value.

func (AuthZConfigsValidationError) Reason

Reason function returns reason value.

type Security

type Security struct {

	// List of authentication configurations.
	AuthnConfigs *AuthNConfigs `protobuf:"bytes,1,opt,name=authn_configs,proto3" json:"authn_configs,omitempty"`
	// List of authorization configurations.
	AuthzConfigs *AuthZConfigs `protobuf:"bytes,2,opt,name=authz_configs,proto3" json:"authz_configs,omitempty"`
	// List of transport layer security (TLS) configurations.
	TransportSecurityConfigs *TransportSecurityConfigs `protobuf:"bytes,3,opt,name=transport_security_configs,proto3" json:"transport_security_configs,omitempty"`
	// contains filtered or unexported fields
}

Security defines the top-level configuration for all security-related components.

func (*Security) Descriptor deprecated

func (*Security) Descriptor() ([]byte, []int)

Deprecated: Use Security.ProtoReflect.Descriptor instead.

func (*Security) GetAuthnConfigs

func (x *Security) GetAuthnConfigs() *AuthNConfigs

func (*Security) GetAuthzConfigs

func (x *Security) GetAuthzConfigs() *AuthZConfigs

func (*Security) GetTransportSecurityConfigs

func (x *Security) GetTransportSecurityConfigs() *TransportSecurityConfigs

func (*Security) ProtoMessage

func (*Security) ProtoMessage()

func (*Security) ProtoReflect

func (x *Security) ProtoReflect() protoreflect.Message

func (*Security) Reset

func (x *Security) Reset()

func (*Security) String

func (x *Security) String() string

func (*Security) Validate

func (m *Security) Validate() error

Validate checks the field values on Security with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Security) ValidateAll

func (m *Security) ValidateAll() error

ValidateAll checks the field values on Security with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SecurityMultiError, or nil if none found.

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

type SecurityMultiError

type SecurityMultiError []error

SecurityMultiError is an error wrapping multiple validation errors returned by Security.ValidateAll() if the designated constraints aren't met.

func (SecurityMultiError) AllErrors

func (m SecurityMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SecurityMultiError) Error

func (m SecurityMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type SecurityValidationError

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

SecurityValidationError is the validation error returned by Security.Validate if the designated constraints aren't met.

func (SecurityValidationError) Cause

func (e SecurityValidationError) Cause() error

Cause function returns cause value.

func (SecurityValidationError) Error

func (e SecurityValidationError) Error() string

Error satisfies the builtin error interface

func (SecurityValidationError) ErrorName

func (e SecurityValidationError) ErrorName() string

ErrorName returns error name.

func (SecurityValidationError) Field

func (e SecurityValidationError) Field() string

Field function returns field value.

func (SecurityValidationError) Key

func (e SecurityValidationError) Key() bool

Key function returns key value.

func (SecurityValidationError) Reason

func (e SecurityValidationError) Reason() string

Reason function returns reason value.

type TransportSecurityConfigs

type TransportSecurityConfigs struct {
	Default *string          `protobuf:"bytes,1,opt,name=default,proto3,oneof" json:"default,omitempty"`
	Active  *string          `protobuf:"bytes,2,opt,name=active,proto3,oneof" json:"active,omitempty"`
	Configs []*v12.TLSConfig `protobuf:"bytes,3,rep,name=configs,proto3" json:"configs,omitempty"`
	// contains filtered or unexported fields
}

func (*TransportSecurityConfigs) Descriptor deprecated

func (*TransportSecurityConfigs) Descriptor() ([]byte, []int)

Deprecated: Use TransportSecurityConfigs.ProtoReflect.Descriptor instead.

func (*TransportSecurityConfigs) GetActive

func (x *TransportSecurityConfigs) GetActive() string

func (*TransportSecurityConfigs) GetConfigs

func (x *TransportSecurityConfigs) GetConfigs() []*v12.TLSConfig

func (*TransportSecurityConfigs) GetDefault

func (x *TransportSecurityConfigs) GetDefault() string

func (*TransportSecurityConfigs) ProtoMessage

func (*TransportSecurityConfigs) ProtoMessage()

func (*TransportSecurityConfigs) ProtoReflect

func (x *TransportSecurityConfigs) ProtoReflect() protoreflect.Message

func (*TransportSecurityConfigs) Reset

func (x *TransportSecurityConfigs) Reset()

func (*TransportSecurityConfigs) String

func (x *TransportSecurityConfigs) String() string

func (*TransportSecurityConfigs) Validate

func (m *TransportSecurityConfigs) Validate() error

Validate checks the field values on TransportSecurityConfigs with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*TransportSecurityConfigs) ValidateAll

func (m *TransportSecurityConfigs) ValidateAll() error

ValidateAll checks the field values on TransportSecurityConfigs with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in TransportSecurityConfigsMultiError, or nil if none found.

type TransportSecurityConfigsMultiError

type TransportSecurityConfigsMultiError []error

TransportSecurityConfigsMultiError is an error wrapping multiple validation errors returned by TransportSecurityConfigs.ValidateAll() if the designated constraints aren't met.

func (TransportSecurityConfigsMultiError) AllErrors

func (m TransportSecurityConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransportSecurityConfigsMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type TransportSecurityConfigsValidationError

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

TransportSecurityConfigsValidationError is the validation error returned by TransportSecurityConfigs.Validate if the designated constraints aren't met.

func (TransportSecurityConfigsValidationError) Cause

Cause function returns cause value.

func (TransportSecurityConfigsValidationError) Error

Error satisfies the builtin error interface

func (TransportSecurityConfigsValidationError) ErrorName

ErrorName returns error name.

func (TransportSecurityConfigsValidationError) Field

Field function returns field value.

func (TransportSecurityConfigsValidationError) Key

Key function returns key value.

func (TransportSecurityConfigsValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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