Documentation
¶
Index ¶
- Variables
- type AuthConfig
- func (*AuthConfig) Descriptor() ([]byte, []int)deprecated
- func (x *AuthConfig) GetAccessTokenLifetime() int64
- func (x *AuthConfig) GetAudience() []string
- func (x *AuthConfig) GetIssuer() string
- func (x *AuthConfig) GetRefreshTokenLifetime() int64
- func (x *AuthConfig) GetSecondarySigningKey() string
- func (x *AuthConfig) GetSigningKey() string
- func (x *AuthConfig) GetSigningMethod() string
- func (x *AuthConfig) GetTokenSource() string
- func (*AuthConfig) ProtoMessage()
- func (x *AuthConfig) ProtoReflect() protoreflect.Message
- func (x *AuthConfig) Reset()
- func (x *AuthConfig) String() string
- func (m *AuthConfig) Validate() error
- func (m *AuthConfig) ValidateAll() error
- type AuthConfigMultiError
- type AuthConfigValidationError
- type JWT
- func (*JWT) Descriptor() ([]byte, []int)deprecated
- func (x *JWT) GetClaimType() string
- func (x *JWT) GetConfig() *AuthConfig
- func (x *JWT) GetTokenHeader() *structpb.Struct
- func (*JWT) ProtoMessage()
- func (x *JWT) ProtoReflect() protoreflect.Message
- func (x *JWT) Reset()
- func (x *JWT) String() string
- func (m *JWT) Validate() error
- func (m *JWT) ValidateAll() error
- type JWTMultiError
- type JWTValidationError
Constants ¶
This section is empty.
Variables ¶
var File_config_middleware_jwt_v1_jwt_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶ added in v0.2.13
type AuthConfig struct {
SigningMethod string `protobuf:"bytes,1,opt,name=signing_method,proto3" json:"signing_method,omitempty"`
SigningKey string `protobuf:"bytes,2,opt,name=signing_key,proto3" json:"signing_key,omitempty"`
SecondarySigningKey string `protobuf:"bytes,3,opt,name=secondary_signing_key,proto3" json:"secondary_signing_key,omitempty"`
AccessTokenLifetime int64 `protobuf:"varint,4,opt,name=access_token_lifetime,proto3" json:"access_token_lifetime,omitempty"`
RefreshTokenLifetime int64 `protobuf:"varint,5,opt,name=refresh_token_lifetime,proto3" json:"refresh_token_lifetime,omitempty"`
Issuer string `protobuf:"bytes,6,opt,name=issuer,proto3" json:"issuer,omitempty"`
Audience []string `protobuf:"bytes,7,rep,name=audience,proto3" json:"audience,omitempty"` // Audience
// Optional: Defines how to extract the token from the request.
// Defaults to "header:Authorization" with "Bearer " prefix.
// Example: "cookie:access_token"
TokenSource *string `protobuf:"bytes,8,opt,name=token_source,proto3,oneof" json:"token_source,omitempty"`
// contains filtered or unexported fields
}
AuthConfig contains configuration parameters for creating and validating a JWT.
func (*AuthConfig) Descriptor
deprecated
added in
v0.2.13
func (*AuthConfig) Descriptor() ([]byte, []int)
Deprecated: Use AuthConfig.ProtoReflect.Descriptor instead.
func (*AuthConfig) GetAccessTokenLifetime ¶ added in v0.2.13
func (x *AuthConfig) GetAccessTokenLifetime() int64
func (*AuthConfig) GetAudience ¶ added in v0.2.13
func (x *AuthConfig) GetAudience() []string
func (*AuthConfig) GetIssuer ¶ added in v0.2.13
func (x *AuthConfig) GetIssuer() string
func (*AuthConfig) GetRefreshTokenLifetime ¶ added in v0.2.13
func (x *AuthConfig) GetRefreshTokenLifetime() int64
func (*AuthConfig) GetSecondarySigningKey ¶ added in v0.2.13
func (x *AuthConfig) GetSecondarySigningKey() string
func (*AuthConfig) GetSigningKey ¶ added in v0.2.13
func (x *AuthConfig) GetSigningKey() string
func (*AuthConfig) GetSigningMethod ¶ added in v0.2.13
func (x *AuthConfig) GetSigningMethod() string
func (*AuthConfig) GetTokenSource ¶ added in v0.2.13
func (x *AuthConfig) GetTokenSource() string
func (*AuthConfig) ProtoMessage ¶ added in v0.2.13
func (*AuthConfig) ProtoMessage()
func (*AuthConfig) ProtoReflect ¶ added in v0.2.13
func (x *AuthConfig) ProtoReflect() protoreflect.Message
func (*AuthConfig) Reset ¶ added in v0.2.13
func (x *AuthConfig) Reset()
func (*AuthConfig) String ¶ added in v0.2.13
func (x *AuthConfig) String() string
func (*AuthConfig) Validate ¶ added in v0.2.13
func (m *AuthConfig) Validate() error
Validate checks the field values on AuthConfig 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 (*AuthConfig) ValidateAll ¶ added in v0.2.13
func (m *AuthConfig) ValidateAll() error
ValidateAll checks the field values on AuthConfig 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 AuthConfigMultiError, or nil if none found.
type AuthConfigMultiError ¶ added in v0.2.13
type AuthConfigMultiError []error
AuthConfigMultiError is an error wrapping multiple validation errors returned by AuthConfig.ValidateAll() if the designated constraints aren't met.
func (AuthConfigMultiError) AllErrors ¶ added in v0.2.13
func (m AuthConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (AuthConfigMultiError) Error ¶ added in v0.2.13
func (m AuthConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type AuthConfigValidationError ¶ added in v0.2.13
type AuthConfigValidationError struct {
// contains filtered or unexported fields
}
AuthConfigValidationError is the validation error returned by AuthConfig.Validate if the designated constraints aren't met.
func (AuthConfigValidationError) Cause ¶ added in v0.2.13
func (e AuthConfigValidationError) Cause() error
Cause function returns cause value.
func (AuthConfigValidationError) Error ¶ added in v0.2.13
func (e AuthConfigValidationError) Error() string
Error satisfies the builtin error interface
func (AuthConfigValidationError) ErrorName ¶ added in v0.2.13
func (e AuthConfigValidationError) ErrorName() string
ErrorName returns error name.
func (AuthConfigValidationError) Field ¶ added in v0.2.13
func (e AuthConfigValidationError) Field() string
Field function returns field value.
func (AuthConfigValidationError) Key ¶ added in v0.2.13
func (e AuthConfigValidationError) Key() bool
Key function returns key value.
func (AuthConfigValidationError) Reason ¶ added in v0.2.13
func (e AuthConfigValidationError) Reason() string
Reason function returns reason value.
type JWT ¶
type JWT struct {
ClaimType string `protobuf:"bytes,1,opt,name=claim_type,proto3" json:"claim_type,omitempty"`
TokenHeader *structpb.Struct `protobuf:"bytes,2,opt,name=token_header,proto3" json:"token_header,omitempty"`
// The configuration for creating and validating a JWT.
Config *AuthConfig `protobuf:"bytes,100,opt,name=config,proto3" json:"config,omitempty"`
// contains filtered or unexported fields
}
JSON Web Token
func (*JWT) Descriptor
deprecated
func (*JWT) GetClaimType ¶
func (*JWT) GetConfig ¶
func (x *JWT) GetConfig() *AuthConfig
func (*JWT) GetTokenHeader ¶
func (*JWT) ProtoMessage ¶
func (*JWT) ProtoMessage()
func (*JWT) ProtoReflect ¶
func (x *JWT) ProtoReflect() protoreflect.Message
func (*JWT) Validate ¶
Validate checks the field values on JWT 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 (*JWT) ValidateAll ¶
ValidateAll checks the field values on JWT 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 JWTMultiError, or nil if none found.
type JWTMultiError ¶
type JWTMultiError []error
JWTMultiError is an error wrapping multiple validation errors returned by JWT.ValidateAll() if the designated constraints aren't met.
func (JWTMultiError) AllErrors ¶
func (m JWTMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (JWTMultiError) Error ¶
func (m JWTMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type JWTValidationError ¶
type JWTValidationError struct {
// contains filtered or unexported fields
}
JWTValidationError is the validation error returned by JWT.Validate if the designated constraints aren't met.
func (JWTValidationError) Cause ¶
func (e JWTValidationError) Cause() error
Cause function returns cause value.
func (JWTValidationError) Error ¶
func (e JWTValidationError) Error() string
Error satisfies the builtin error interface
func (JWTValidationError) ErrorName ¶
func (e JWTValidationError) ErrorName() string
ErrorName returns error name.
func (JWTValidationError) Field ¶
func (e JWTValidationError) Field() string
Field function returns field value.
func (JWTValidationError) Key ¶
func (e JWTValidationError) Key() bool
Key function returns key value.
func (JWTValidationError) Reason ¶
func (e JWTValidationError) Reason() string
Reason function returns reason value.