securityv1

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2025 License: MIT Imports: 21 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
View Source
var File_runtime_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 added in v0.2.8

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 added in v0.2.8

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

Deprecated: Use AuthNConfigs.ProtoReflect.Descriptor instead.

func (*AuthNConfigs) GetActive added in v0.2.8

func (x *AuthNConfigs) GetActive() string

func (*AuthNConfigs) GetConfigs added in v0.2.8

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

func (*AuthNConfigs) GetDefault added in v0.2.8

func (x *AuthNConfigs) GetDefault() string

func (*AuthNConfigs) ProtoMessage added in v0.2.8

func (*AuthNConfigs) ProtoMessage()

func (*AuthNConfigs) ProtoReflect added in v0.2.8

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

func (*AuthNConfigs) Reset added in v0.2.8

func (x *AuthNConfigs) Reset()

func (*AuthNConfigs) String added in v0.2.8

func (x *AuthNConfigs) String() string

func (*AuthNConfigs) Validate added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

func (m AuthNConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthNConfigsMultiError) Error added in v0.2.8

func (m AuthNConfigsMultiError) Error() string

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

type AuthNConfigsValidationError added in v0.2.8

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 added in v0.2.8

Cause function returns cause value.

func (AuthNConfigsValidationError) Error added in v0.2.8

Error satisfies the builtin error interface

func (AuthNConfigsValidationError) ErrorName added in v0.2.8

func (e AuthNConfigsValidationError) ErrorName() string

ErrorName returns error name.

func (AuthNConfigsValidationError) Field added in v0.2.8

Field function returns field value.

func (AuthNConfigsValidationError) Key added in v0.2.8

Key function returns key value.

func (AuthNConfigsValidationError) Reason added in v0.2.8

Reason function returns reason value.

type AuthZConfigs added in v0.2.8

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 added in v0.2.8

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

Deprecated: Use AuthZConfigs.ProtoReflect.Descriptor instead.

func (*AuthZConfigs) GetActive added in v0.2.8

func (x *AuthZConfigs) GetActive() string

func (*AuthZConfigs) GetConfigs added in v0.2.8

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

func (*AuthZConfigs) GetDefault added in v0.2.8

func (x *AuthZConfigs) GetDefault() string

func (*AuthZConfigs) ProtoMessage added in v0.2.8

func (*AuthZConfigs) ProtoMessage()

func (*AuthZConfigs) ProtoReflect added in v0.2.8

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

func (*AuthZConfigs) Reset added in v0.2.8

func (x *AuthZConfigs) Reset()

func (*AuthZConfigs) String added in v0.2.8

func (x *AuthZConfigs) String() string

func (*AuthZConfigs) Validate added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

func (m AuthZConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthZConfigsMultiError) Error added in v0.2.8

func (m AuthZConfigsMultiError) Error() string

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

type AuthZConfigsValidationError added in v0.2.8

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 added in v0.2.8

Cause function returns cause value.

func (AuthZConfigsValidationError) Error added in v0.2.8

Error satisfies the builtin error interface

func (AuthZConfigsValidationError) ErrorName added in v0.2.8

func (e AuthZConfigsValidationError) ErrorName() string

ErrorName returns error name.

func (AuthZConfigsValidationError) Field added in v0.2.8

Field function returns field value.

func (AuthZConfigsValidationError) Key added in v0.2.8

Key function returns key value.

func (AuthZConfigsValidationError) Reason added in v0.2.8

Reason function returns reason value.

type Security added in v0.2.8

type Security struct {

	// List of authentication configurations.
	AuthnConfigs *AuthNConfigs `protobuf:"bytes,1,opt,name=authn_configs,json=authnConfigs,proto3" json:"authn_configs,omitempty"`
	// List of authorization configurations.
	AuthzConfigs *AuthZConfigs `protobuf:"bytes,2,opt,name=authz_configs,json=authzConfigs,proto3" json:"authz_configs,omitempty"`
	// List of transport layer security (TLS) configurations.
	TransportSecurityConfigs *TransportSecurityConfigs `` /* 135-byte string literal not displayed */
	// contains filtered or unexported fields
}

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

func (*Security) Descriptor deprecated added in v0.2.8

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

Deprecated: Use Security.ProtoReflect.Descriptor instead.

func (*Security) GetAuthnConfigs added in v0.2.8

func (x *Security) GetAuthnConfigs() *AuthNConfigs

func (*Security) GetAuthzConfigs added in v0.2.8

func (x *Security) GetAuthzConfigs() *AuthZConfigs

func (*Security) GetTransportSecurityConfigs added in v0.2.8

func (x *Security) GetTransportSecurityConfigs() *TransportSecurityConfigs

func (*Security) ProtoMessage added in v0.2.8

func (*Security) ProtoMessage()

func (*Security) ProtoReflect added in v0.2.8

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

func (*Security) Reset added in v0.2.8

func (x *Security) Reset()

func (*Security) String added in v0.2.8

func (x *Security) String() string

func (*Security) Validate added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

func (m SecurityMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SecurityMultiError) Error added in v0.2.8

func (m SecurityMultiError) Error() string

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

type SecurityValidationError added in v0.2.8

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 added in v0.2.8

func (e SecurityValidationError) Cause() error

Cause function returns cause value.

func (SecurityValidationError) Error added in v0.2.8

func (e SecurityValidationError) Error() string

Error satisfies the builtin error interface

func (SecurityValidationError) ErrorName added in v0.2.8

func (e SecurityValidationError) ErrorName() string

ErrorName returns error name.

func (SecurityValidationError) Field added in v0.2.8

func (e SecurityValidationError) Field() string

Field function returns field value.

func (SecurityValidationError) Key added in v0.2.8

func (e SecurityValidationError) Key() bool

Key function returns key value.

func (SecurityValidationError) Reason added in v0.2.8

func (e SecurityValidationError) Reason() string

Reason function returns reason value.

type TransportSecurityConfigs added in v0.2.8

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 added in v0.2.8

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

Deprecated: Use TransportSecurityConfigs.ProtoReflect.Descriptor instead.

func (*TransportSecurityConfigs) GetActive added in v0.2.8

func (x *TransportSecurityConfigs) GetActive() string

func (*TransportSecurityConfigs) GetConfigs added in v0.2.8

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

func (*TransportSecurityConfigs) GetDefault added in v0.2.8

func (x *TransportSecurityConfigs) GetDefault() string

func (*TransportSecurityConfigs) ProtoMessage added in v0.2.8

func (*TransportSecurityConfigs) ProtoMessage()

func (*TransportSecurityConfigs) ProtoReflect added in v0.2.8

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

func (*TransportSecurityConfigs) Reset added in v0.2.8

func (x *TransportSecurityConfigs) Reset()

func (*TransportSecurityConfigs) String added in v0.2.8

func (x *TransportSecurityConfigs) String() string

func (*TransportSecurityConfigs) Validate added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

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 added in v0.2.8

func (m TransportSecurityConfigsMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransportSecurityConfigsMultiError) Error added in v0.2.8

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

type TransportSecurityConfigsValidationError added in v0.2.8

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 added in v0.2.8

Cause function returns cause value.

func (TransportSecurityConfigsValidationError) Error added in v0.2.8

Error satisfies the builtin error interface

func (TransportSecurityConfigsValidationError) ErrorName added in v0.2.8

ErrorName returns error name.

func (TransportSecurityConfigsValidationError) Field added in v0.2.8

Field function returns field value.

func (TransportSecurityConfigsValidationError) Key added in v0.2.8

Key function returns key value.

func (TransportSecurityConfigsValidationError) Reason added in v0.2.8

Reason function returns reason value.

Jump to

Keyboard shortcuts

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