middlewares

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_runtime_middlewares_cors_proto protoreflect.FileDescriptor
View Source
var File_runtime_middlewares_logger_proto protoreflect.FileDescriptor
View Source
var File_runtime_middlewares_metrics_proto protoreflect.FileDescriptor
View Source
var File_runtime_middlewares_security_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type AuthorizationConfig

type AuthorizationConfig struct {
	Enabled            bool                 `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	AllowedMethodPaths []string             `protobuf:"bytes,2,rep,name=allowed_method_paths,proto3" json:"allowed_method_paths,omitempty"` // Direct release method paths
	SigningMethod      string               `protobuf:"bytes,3,opt,name=signing_method,proto3" json:"signing_method,omitempty"`
	SigningKey         string               `protobuf:"bytes,4,opt,name=signing_key,proto3" json:"signing_key,omitempty"`
	OldSigningKey      string               `protobuf:"bytes,5,opt,name=old_signing_key,proto3" json:"old_signing_key,omitempty"`
	ExpiredTime        *durationpb.Duration `protobuf:"bytes,6,opt,name=expired_time,proto3" json:"expired_time,omitempty"` // Expired time
	// contains filtered or unexported fields
}

func (*AuthorizationConfig) Descriptor deprecated

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

Deprecated: Use AuthorizationConfig.ProtoReflect.Descriptor instead.

func (*AuthorizationConfig) GetAllowedMethodPaths

func (x *AuthorizationConfig) GetAllowedMethodPaths() []string

func (*AuthorizationConfig) GetEnabled

func (x *AuthorizationConfig) GetEnabled() bool

func (*AuthorizationConfig) GetExpiredTime

func (x *AuthorizationConfig) GetExpiredTime() *durationpb.Duration

func (*AuthorizationConfig) GetOldSigningKey

func (x *AuthorizationConfig) GetOldSigningKey() string

func (*AuthorizationConfig) GetSigningKey

func (x *AuthorizationConfig) GetSigningKey() string

func (*AuthorizationConfig) GetSigningMethod

func (x *AuthorizationConfig) GetSigningMethod() string

func (*AuthorizationConfig) ProtoMessage

func (*AuthorizationConfig) ProtoMessage()

func (*AuthorizationConfig) ProtoReflect

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

func (*AuthorizationConfig) Reset

func (x *AuthorizationConfig) Reset()

func (*AuthorizationConfig) String

func (x *AuthorizationConfig) String() string

func (*AuthorizationConfig) Validate

func (m *AuthorizationConfig) Validate() error

Validate checks the field values on AuthorizationConfig 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 (*AuthorizationConfig) ValidateAll

func (m *AuthorizationConfig) ValidateAll() error

ValidateAll checks the field values on AuthorizationConfig 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 AuthorizationConfigMultiError, or nil if none found.

type AuthorizationConfigMultiError

type AuthorizationConfigMultiError []error

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

func (AuthorizationConfigMultiError) AllErrors

func (m AuthorizationConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AuthorizationConfigMultiError) Error

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

type AuthorizationConfigValidationError

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

AuthorizationConfigValidationError is the validation error returned by AuthorizationConfig.Validate if the designated constraints aren't met.

func (AuthorizationConfigValidationError) Cause

Cause function returns cause value.

func (AuthorizationConfigValidationError) Error

Error satisfies the builtin error interface

func (AuthorizationConfigValidationError) ErrorName

ErrorName returns error name.

func (AuthorizationConfigValidationError) Field

Field function returns field value.

func (AuthorizationConfigValidationError) Key

Key function returns key value.

func (AuthorizationConfigValidationError) Reason

Reason function returns reason value.

type CasbinConfig

type CasbinConfig struct {
	Enabled            bool     `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	AllowedMethodPaths []string `protobuf:"bytes,2,rep,name=allowed_method_paths,proto3" json:"allowed_method_paths,omitempty"` // Direct release method paths
	PolicyFile         string   `protobuf:"bytes,3,opt,name=policy_file,proto3" json:"policy_file,omitempty"`
	ModelFile          string   `protobuf:"bytes,4,opt,name=model_file,proto3" json:"model_file,omitempty"`
	// contains filtered or unexported fields
}

func (*CasbinConfig) Descriptor deprecated

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

Deprecated: Use CasbinConfig.ProtoReflect.Descriptor instead.

func (*CasbinConfig) GetAllowedMethodPaths

func (x *CasbinConfig) GetAllowedMethodPaths() []string

func (*CasbinConfig) GetEnabled

func (x *CasbinConfig) GetEnabled() bool

func (*CasbinConfig) GetModelFile

func (x *CasbinConfig) GetModelFile() string

func (*CasbinConfig) GetPolicyFile

func (x *CasbinConfig) GetPolicyFile() string

func (*CasbinConfig) ProtoMessage

func (*CasbinConfig) ProtoMessage()

func (*CasbinConfig) ProtoReflect

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

func (*CasbinConfig) Reset

func (x *CasbinConfig) Reset()

func (*CasbinConfig) String

func (x *CasbinConfig) String() string

func (*CasbinConfig) Validate

func (m *CasbinConfig) Validate() error

Validate checks the field values on CasbinConfig 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 (*CasbinConfig) ValidateAll

func (m *CasbinConfig) ValidateAll() error

ValidateAll checks the field values on CasbinConfig 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 CasbinConfigMultiError, or nil if none found.

type CasbinConfigMultiError

type CasbinConfigMultiError []error

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

func (CasbinConfigMultiError) AllErrors

func (m CasbinConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CasbinConfigMultiError) Error

func (m CasbinConfigMultiError) Error() string

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

type CasbinConfigValidationError

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

CasbinConfigValidationError is the validation error returned by CasbinConfig.Validate if the designated constraints aren't met.

func (CasbinConfigValidationError) Cause

Cause function returns cause value.

func (CasbinConfigValidationError) Error

Error satisfies the builtin error interface

func (CasbinConfigValidationError) ErrorName

func (e CasbinConfigValidationError) ErrorName() string

ErrorName returns error name.

func (CasbinConfigValidationError) Field

Field function returns field value.

func (CasbinConfigValidationError) Key

Key function returns key value.

func (CasbinConfigValidationError) Reason

Reason function returns reason value.

type CorsConfig

type CorsConfig struct {
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// AllowCredentials indicates whether the request can include user credentials like
	// cookies, HTTP authentication or client side SSL certificates.
	AllowCredentials bool `protobuf:"varint,2,opt,name=allow_credentials,proto3" json:"allow_credentials,omitempty"`
	// AllowOrigins is a list of origins a cross-domain request can be executed from.
	// If the special "*" value is present in the list, all origins will be allowed.
	// Default value is [*]
	AllowOrigins []string `protobuf:"bytes,3,rep,name=allow_origins,proto3" json:"allow_origins,omitempty"`
	// AllowMethods is a list of methods the client is allowed to use with
	// cross-domain requests. Default value is simple methods (GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS)
	AllowMethods []string `protobuf:"bytes,4,rep,name=allow_methods,proto3" json:"allow_methods,omitempty"`
	// AllowHeaders is list of non simple headers the client is allowed to use with
	// cross-domain requests.
	AllowHeaders []string `protobuf:"bytes,5,rep,name=allow_headers,proto3" json:"allow_headers,omitempty"`
	// ExposeHeaders indicates which headers are safe to expose to the API of a CORS
	// API specification
	ExposeHeaders []string `protobuf:"bytes,6,rep,name=expose_headers,proto3" json:"expose_headers,omitempty"`
	// MaxAge indicates how long (with second-precision) the results of a preflight request
	// can be cached
	MaxAge *durationpb.Duration `protobuf:"bytes,7,opt,name=max_age,proto3" json:"max_age,omitempty"`
	// Allows to add origins like http://some-domain/*, https://api.* or http://some.*.subdomain.com
	AllowWildcard bool `protobuf:"varint,8,opt,name=allow_wildcard,proto3" json:"allow_wildcard,omitempty"`
	// Allows usage of popular browser extensions schemas
	AllowBrowserExtensions bool `protobuf:"varint,9,opt,name=allow_browser_extensions,proto3" json:"allow_browser_extensions,omitempty"`
	// Allows usage of WebSocket protocol
	AllowWebSockets bool `protobuf:"varint,10,opt,name=allow_web_sockets,proto3" json:"allow_web_sockets,omitempty"`
	// Allows usage of private network addresses (127.0.0.1, [::1], localhost)
	AllowPrivateNetwork bool `protobuf:"varint,11,opt,name=allow_private_network,proto3" json:"allow_private_network,omitempty"`
	// Allows usage of file:// schema (dangerous!) use it only when you 100% sure it's needed
	AllowFiles bool `protobuf:"varint,12,opt,name=allow_files,proto3" json:"allow_files,omitempty"`
	// contains filtered or unexported fields
}

Cors middleware config.

func (*CorsConfig) Descriptor deprecated

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

Deprecated: Use CorsConfig.ProtoReflect.Descriptor instead.

func (*CorsConfig) GetAllowBrowserExtensions

func (x *CorsConfig) GetAllowBrowserExtensions() bool

func (*CorsConfig) GetAllowCredentials

func (x *CorsConfig) GetAllowCredentials() bool

func (*CorsConfig) GetAllowFiles

func (x *CorsConfig) GetAllowFiles() bool

func (*CorsConfig) GetAllowHeaders

func (x *CorsConfig) GetAllowHeaders() []string

func (*CorsConfig) GetAllowMethods

func (x *CorsConfig) GetAllowMethods() []string

func (*CorsConfig) GetAllowOrigins

func (x *CorsConfig) GetAllowOrigins() []string

func (*CorsConfig) GetAllowPrivateNetwork

func (x *CorsConfig) GetAllowPrivateNetwork() bool

func (*CorsConfig) GetAllowWebSockets

func (x *CorsConfig) GetAllowWebSockets() bool

func (*CorsConfig) GetAllowWildcard

func (x *CorsConfig) GetAllowWildcard() bool

func (*CorsConfig) GetEnabled

func (x *CorsConfig) GetEnabled() bool

func (*CorsConfig) GetExposeHeaders

func (x *CorsConfig) GetExposeHeaders() []string

func (*CorsConfig) GetMaxAge

func (x *CorsConfig) GetMaxAge() *durationpb.Duration

func (*CorsConfig) ProtoMessage

func (*CorsConfig) ProtoMessage()

func (*CorsConfig) ProtoReflect

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

func (*CorsConfig) Reset

func (x *CorsConfig) Reset()

func (*CorsConfig) String

func (x *CorsConfig) String() string

func (*CorsConfig) Validate

func (m *CorsConfig) Validate() error

Validate checks the field values on CorsConfig 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 (*CorsConfig) ValidateAll

func (m *CorsConfig) ValidateAll() error

ValidateAll checks the field values on CorsConfig 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 CorsConfigMultiError, or nil if none found.

type CorsConfigMultiError

type CorsConfigMultiError []error

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

func (CorsConfigMultiError) AllErrors

func (m CorsConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (CorsConfigMultiError) Error

func (m CorsConfigMultiError) Error() string

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

type CorsConfigValidationError

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

CorsConfigValidationError is the validation error returned by CorsConfig.Validate if the designated constraints aren't met.

func (CorsConfigValidationError) Cause

func (e CorsConfigValidationError) Cause() error

Cause function returns cause value.

func (CorsConfigValidationError) Error

Error satisfies the builtin error interface

func (CorsConfigValidationError) ErrorName

func (e CorsConfigValidationError) ErrorName() string

ErrorName returns error name.

func (CorsConfigValidationError) Field

Field function returns field value.

func (CorsConfigValidationError) Key

Key function returns key value.

func (CorsConfigValidationError) Reason

func (e CorsConfigValidationError) Reason() string

Reason function returns reason value.

type LoggerConfig

type LoggerConfig struct {
	Enabled bool   `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Name    string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Logger middleware config.

func (*LoggerConfig) Descriptor deprecated

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

Deprecated: Use LoggerConfig.ProtoReflect.Descriptor instead.

func (*LoggerConfig) GetEnabled

func (x *LoggerConfig) GetEnabled() bool

func (*LoggerConfig) GetName

func (x *LoggerConfig) GetName() string

func (*LoggerConfig) ProtoMessage

func (*LoggerConfig) ProtoMessage()

func (*LoggerConfig) ProtoReflect

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

func (*LoggerConfig) Reset

func (x *LoggerConfig) Reset()

func (*LoggerConfig) String

func (x *LoggerConfig) String() string

func (*LoggerConfig) Validate

func (m *LoggerConfig) Validate() error

Validate checks the field values on LoggerConfig 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 (*LoggerConfig) ValidateAll

func (m *LoggerConfig) ValidateAll() error

ValidateAll checks the field values on LoggerConfig 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 LoggerConfigMultiError, or nil if none found.

type LoggerConfigMultiError

type LoggerConfigMultiError []error

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

func (LoggerConfigMultiError) AllErrors

func (m LoggerConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (LoggerConfigMultiError) Error

func (m LoggerConfigMultiError) Error() string

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

type LoggerConfigValidationError

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

LoggerConfigValidationError is the validation error returned by LoggerConfig.Validate if the designated constraints aren't met.

func (LoggerConfigValidationError) Cause

Cause function returns cause value.

func (LoggerConfigValidationError) Error

Error satisfies the builtin error interface

func (LoggerConfigValidationError) ErrorName

func (e LoggerConfigValidationError) ErrorName() string

ErrorName returns error name.

func (LoggerConfigValidationError) Field

Field function returns field value.

func (LoggerConfigValidationError) Key

Key function returns key value.

func (LoggerConfigValidationError) Reason

Reason function returns reason value.

type MetricConfig

type MetricConfig struct {
	Enabled  bool     `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	Includes []string `protobuf:"bytes,2,rep,name=includes,proto3" json:"includes,omitempty"`
	Name     string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

Metric middleware config.

func (*MetricConfig) Descriptor deprecated

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

Deprecated: Use MetricConfig.ProtoReflect.Descriptor instead.

func (*MetricConfig) GetEnabled

func (x *MetricConfig) GetEnabled() bool

func (*MetricConfig) GetIncludes

func (x *MetricConfig) GetIncludes() []string

func (*MetricConfig) GetName

func (x *MetricConfig) GetName() string

func (*MetricConfig) ProtoMessage

func (*MetricConfig) ProtoMessage()

func (*MetricConfig) ProtoReflect

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

func (*MetricConfig) Reset

func (x *MetricConfig) Reset()

func (*MetricConfig) String

func (x *MetricConfig) String() string

func (*MetricConfig) Validate

func (m *MetricConfig) Validate() error

Validate checks the field values on MetricConfig 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 (*MetricConfig) ValidateAll

func (m *MetricConfig) ValidateAll() error

ValidateAll checks the field values on MetricConfig 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 MetricConfigMultiError, or nil if none found.

type MetricConfigMultiError

type MetricConfigMultiError []error

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

func (MetricConfigMultiError) AllErrors

func (m MetricConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (MetricConfigMultiError) Error

func (m MetricConfigMultiError) Error() string

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

type MetricConfigValidationError

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

MetricConfigValidationError is the validation error returned by MetricConfig.Validate if the designated constraints aren't met.

func (MetricConfigValidationError) Cause

Cause function returns cause value.

func (MetricConfigValidationError) Error

Error satisfies the builtin error interface

func (MetricConfigValidationError) ErrorName

func (e MetricConfigValidationError) ErrorName() string

ErrorName returns error name.

func (MetricConfigValidationError) Field

Field function returns field value.

func (MetricConfigValidationError) Key

Key function returns key value.

func (MetricConfigValidationError) Reason

Reason function returns reason value.

type SecurityConfig

type SecurityConfig struct {
	AllowedMethodPaths []string             `protobuf:"bytes,2,rep,name=allowed_method_paths,json=allowedMethodPaths,proto3" json:"allowed_method_paths,omitempty"` // Direct release method paths
	Authorization      *AuthorizationConfig `protobuf:"bytes,5,opt,name=authorization,proto3" json:"authorization,omitempty"`                                       // AuthorizationConfig
	Casbin             *CasbinConfig        `protobuf:"bytes,6,opt,name=casbin,proto3" json:"casbin,omitempty"`
	// contains filtered or unexported fields
}

Security middleware config.

func (*SecurityConfig) Descriptor deprecated

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

Deprecated: Use SecurityConfig.ProtoReflect.Descriptor instead.

func (*SecurityConfig) GetAllowedMethodPaths

func (x *SecurityConfig) GetAllowedMethodPaths() []string

func (*SecurityConfig) GetAuthorization

func (x *SecurityConfig) GetAuthorization() *AuthorizationConfig

func (*SecurityConfig) GetCasbin

func (x *SecurityConfig) GetCasbin() *CasbinConfig

func (*SecurityConfig) ProtoMessage

func (*SecurityConfig) ProtoMessage()

func (*SecurityConfig) ProtoReflect

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

func (*SecurityConfig) Reset

func (x *SecurityConfig) Reset()

func (*SecurityConfig) String

func (x *SecurityConfig) String() string

func (*SecurityConfig) Validate

func (m *SecurityConfig) Validate() error

Validate checks the field values on SecurityConfig 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 (*SecurityConfig) ValidateAll

func (m *SecurityConfig) ValidateAll() error

ValidateAll checks the field values on SecurityConfig 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 SecurityConfigMultiError, or nil if none found.

type SecurityConfigMultiError

type SecurityConfigMultiError []error

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

func (SecurityConfigMultiError) AllErrors

func (m SecurityConfigMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (SecurityConfigMultiError) Error

func (m SecurityConfigMultiError) Error() string

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

type SecurityConfigValidationError

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

SecurityConfigValidationError is the validation error returned by SecurityConfig.Validate if the designated constraints aren't met.

func (SecurityConfigValidationError) Cause

Cause function returns cause value.

func (SecurityConfigValidationError) Error

Error satisfies the builtin error interface

func (SecurityConfigValidationError) ErrorName

func (e SecurityConfigValidationError) ErrorName() string

ErrorName returns error name.

func (SecurityConfigValidationError) Field

Field function returns field value.

func (SecurityConfigValidationError) Key

Key function returns key value.

func (SecurityConfigValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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