Documentation ¶
Index ¶
- Constants
- Variables
- type Algorithm
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAccessKeyHeader() string
- func (x *Config) GetDateHeader() string
- func (x *Config) GetSignatureHeader() string
- func (*Config) ProtoMessage()
- func (x *Config) ProtoReflect() protoreflect.Message
- func (x *Config) Reset()
- func (x *Config) String() string
- func (m *Config) Validate() error
- func (m *Config) ValidateAll() error
- type ConfigMultiError
- type ConfigValidationError
- type ConsumerConfig
- func (*ConsumerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ConsumerConfig) GetAccessKey() string
- func (x *ConsumerConfig) GetAlgorithm() Algorithm
- func (x *ConsumerConfig) GetSecretKey() string
- func (x *ConsumerConfig) GetSignedHeaders() []string
- func (conf *ConsumerConfig) Index() string
- func (*ConsumerConfig) ProtoMessage()
- func (x *ConsumerConfig) ProtoReflect() protoreflect.Message
- func (x *ConsumerConfig) Reset()
- func (x *ConsumerConfig) String() string
- func (m *ConsumerConfig) Validate() error
- func (m *ConsumerConfig) ValidateAll() error
- type ConsumerConfigMultiError
- type ConsumerConfigValidationError
- func (e ConsumerConfigValidationError) Cause() error
- func (e ConsumerConfigValidationError) Error() string
- func (e ConsumerConfigValidationError) ErrorName() string
- func (e ConsumerConfigValidationError) Field() string
- func (e ConsumerConfigValidationError) Key() bool
- func (e ConsumerConfigValidationError) Reason() string
Constants ¶
const ( DateHeader = "date" SignatureHeader = "x-hmac-signature" AccessKeyHeader = "x-hmac-access-key" )
This plugin uses the same hmac auth scheme as APISIX: https://apisix.apache.org/docs/apisix/plugins/hmac-auth/#generating-the-signature
const (
Name = "hmacAuth"
)
Variables ¶
var ( Algorithm_name = map[int32]string{ 0: "HMAC_SHA256", 1: "HMAC_SHA384", 2: "HMAC_SHA512", } Algorithm_value = map[string]int32{ "HMAC_SHA256": 0, "HMAC_SHA384": 1, "HMAC_SHA512": 2, } )
Enum value maps for Algorithm.
var File_plugins_hmac_auth_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm int32
func (Algorithm) Descriptor ¶
func (Algorithm) Descriptor() protoreflect.EnumDescriptor
func (Algorithm) EnumDescriptor
deprecated
func (Algorithm) Number ¶
func (x Algorithm) Number() protoreflect.EnumNumber
func (Algorithm) Type ¶
func (Algorithm) Type() protoreflect.EnumType
type Config ¶
type Config struct { SignatureHeader string `protobuf:"bytes,1,opt,name=signature_header,json=signatureHeader,proto3" json:"signature_header,omitempty"` AccessKeyHeader string `protobuf:"bytes,2,opt,name=access_key_header,json=accessKeyHeader,proto3" json:"access_key_header,omitempty"` DateHeader string `protobuf:"bytes,3,opt,name=date_header,json=dateHeader,proto3" json:"date_header,omitempty"` // contains filtered or unexported fields }
func (*Config) Descriptor
deprecated
func (*Config) GetAccessKeyHeader ¶
func (*Config) GetDateHeader ¶
func (*Config) GetSignatureHeader ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Validate ¶
Validate checks the field values on Config 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 (*Config) ValidateAll ¶
ValidateAll checks the field values on Config 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 ConfigMultiError, or nil if none found.
type ConfigMultiError ¶
type ConfigMultiError []error
ConfigMultiError is an error wrapping multiple validation errors returned by Config.ValidateAll() if the designated constraints aren't met.
func (ConfigMultiError) AllErrors ¶
func (m ConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigMultiError) Error ¶
func (m ConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigValidationError ¶
type ConfigValidationError struct {
// contains filtered or unexported fields
}
ConfigValidationError is the validation error returned by Config.Validate if the designated constraints aren't met.
func (ConfigValidationError) Cause ¶
func (e ConfigValidationError) Cause() error
Cause function returns cause value.
func (ConfigValidationError) Error ¶
func (e ConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigValidationError) ErrorName ¶
func (e ConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigValidationError) Field ¶
func (e ConfigValidationError) Field() string
Field function returns field value.
func (ConfigValidationError) Key ¶
func (e ConfigValidationError) Key() bool
Key function returns key value.
func (ConfigValidationError) Reason ¶
func (e ConfigValidationError) Reason() string
Reason function returns reason value.
type ConsumerConfig ¶
type ConsumerConfig struct { AccessKey string `protobuf:"bytes,1,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` SecretKey string `protobuf:"bytes,2,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` // default to HMAC_SHA256 Algorithm Algorithm `protobuf:"varint,3,opt,name=algorithm,proto3,enum=plugins.hmac_auth.Algorithm" json:"algorithm,omitempty"` SignedHeaders []string `protobuf:"bytes,4,rep,name=signed_headers,json=signedHeaders,proto3" json:"signed_headers,omitempty"` // contains filtered or unexported fields }
func (*ConsumerConfig) Descriptor
deprecated
func (*ConsumerConfig) Descriptor() ([]byte, []int)
Deprecated: Use ConsumerConfig.ProtoReflect.Descriptor instead.
func (*ConsumerConfig) GetAccessKey ¶
func (x *ConsumerConfig) GetAccessKey() string
func (*ConsumerConfig) GetAlgorithm ¶
func (x *ConsumerConfig) GetAlgorithm() Algorithm
func (*ConsumerConfig) GetSecretKey ¶
func (x *ConsumerConfig) GetSecretKey() string
func (*ConsumerConfig) GetSignedHeaders ¶
func (x *ConsumerConfig) GetSignedHeaders() []string
func (*ConsumerConfig) Index ¶
func (conf *ConsumerConfig) Index() string
func (*ConsumerConfig) ProtoMessage ¶
func (*ConsumerConfig) ProtoMessage()
func (*ConsumerConfig) ProtoReflect ¶
func (x *ConsumerConfig) ProtoReflect() protoreflect.Message
func (*ConsumerConfig) Reset ¶
func (x *ConsumerConfig) Reset()
func (*ConsumerConfig) String ¶
func (x *ConsumerConfig) String() string
func (*ConsumerConfig) Validate ¶
func (m *ConsumerConfig) Validate() error
Validate checks the field values on ConsumerConfig 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 (*ConsumerConfig) ValidateAll ¶
func (m *ConsumerConfig) ValidateAll() error
ValidateAll checks the field values on ConsumerConfig 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 ConsumerConfigMultiError, or nil if none found.
type ConsumerConfigMultiError ¶
type ConsumerConfigMultiError []error
ConsumerConfigMultiError is an error wrapping multiple validation errors returned by ConsumerConfig.ValidateAll() if the designated constraints aren't met.
func (ConsumerConfigMultiError) AllErrors ¶
func (m ConsumerConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConsumerConfigMultiError) Error ¶
func (m ConsumerConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConsumerConfigValidationError ¶
type ConsumerConfigValidationError struct {
// contains filtered or unexported fields
}
ConsumerConfigValidationError is the validation error returned by ConsumerConfig.Validate if the designated constraints aren't met.
func (ConsumerConfigValidationError) Cause ¶
func (e ConsumerConfigValidationError) Cause() error
Cause function returns cause value.
func (ConsumerConfigValidationError) Error ¶
func (e ConsumerConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConsumerConfigValidationError) ErrorName ¶
func (e ConsumerConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConsumerConfigValidationError) Field ¶
func (e ConsumerConfigValidationError) Field() string
Field function returns field value.
func (ConsumerConfigValidationError) Key ¶
func (e ConsumerConfigValidationError) Key() bool
Key function returns key value.
func (ConsumerConfigValidationError) Reason ¶
func (e ConsumerConfigValidationError) Reason() string
Reason function returns reason value.