Documentation ¶
Index ¶
- Variables
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAccessTokenLifetime() int64
- func (x *Config) GetAudience() []string
- func (x *Config) GetIssuer() string
- func (x *Config) GetKey() string
- func (x *Config) GetKey2() string
- func (x *Config) GetRefreshTokenLifetime() int64
- func (x *Config) GetSigningMethod() string
- func (x *Config) GetTokenType() 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 Token
- func (*Token) Descriptor() ([]byte, []int)deprecated
- func (x *Token) GetAccessToken() string
- func (x *Token) GetClientId() string
- func (x *Token) GetExpirationTime() int64
- func (x *Token) GetRefreshToken() string
- func (x *Token) GetUserId() string
- func (*Token) ProtoMessage()
- func (x *Token) ProtoReflect() protoreflect.Message
- func (x *Token) Reset()
- func (x *Token) String() string
- func (m *Token) Validate() error
- func (m *Token) ValidateAll() error
- type TokenMultiError
- type TokenValidationError
Constants ¶
This section is empty.
Variables ¶
var File_security_jwt_v1_config_proto protoreflect.FileDescriptor
var File_security_jwt_v1_token_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SigningMethod string `protobuf:"bytes,1,opt,name=signing_method,proto3" json:"signing_method,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Key2 string `protobuf:"bytes,3,opt,name=key2,proto3" json:"key2,omitempty"` AccessTokenLifetime int64 `protobuf:"varint,5,opt,name=access_token_lifetime,proto3" json:"access_token_lifetime,omitempty"` RefreshTokenLifetime int64 `protobuf:"varint,6,opt,name=refresh_token_lifetime,proto3" json:"refresh_token_lifetime,omitempty"` Issuer string `protobuf:"bytes,7,opt,name=issuer,proto3" json:"issuer,omitempty"` Audience []string `protobuf:"bytes,8,rep,name=audience,proto3" json:"audience,omitempty"` // Audience TokenType string `protobuf:"bytes,9,opt,name=token_type,proto3" json:"token_type,omitempty"` // contains filtered or unexported fields }
Config contains configuration parameters for creating and validating a JWT.
func (*Config) Descriptor
deprecated
func (*Config) GetAccessTokenLifetime ¶
func (*Config) GetAudience ¶
func (*Config) GetRefreshTokenLifetime ¶
func (*Config) GetSigningMethod ¶
func (*Config) GetTokenType ¶
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 Token ¶
type Token struct { ClientId string `protobuf:"bytes,1,opt,name=client_id,proto3" json:"client_id,omitempty"` UserId string `protobuf:"bytes,2,opt,name=user_id,proto3" json:"user_id,omitempty"` AccessToken string `protobuf:"bytes,10,opt,name=access_token,proto3" json:"access_token,omitempty"` RefreshToken string `protobuf:"bytes,11,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"` ExpirationTime int64 `protobuf:"varint,12,opt,name=expiration_time,proto3" json:"expiration_time,omitempty"` // contains filtered or unexported fields }
PWT is a web token that can be used to authenticate a user with protobuf services.
func (*Token) Descriptor
deprecated
func (*Token) GetAccessToken ¶
func (*Token) GetClientId ¶
func (*Token) GetExpirationTime ¶
func (*Token) GetRefreshToken ¶
func (*Token) ProtoMessage ¶
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶
func (x *Token) ProtoReflect() protoreflect.Message
func (*Token) Validate ¶
Validate checks the field values on Token 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 (*Token) ValidateAll ¶
ValidateAll checks the field values on Token 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 TokenMultiError, or nil if none found.
type TokenMultiError ¶
type TokenMultiError []error
TokenMultiError is an error wrapping multiple validation errors returned by Token.ValidateAll() if the designated constraints aren't met.
func (TokenMultiError) AllErrors ¶
func (m TokenMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (TokenMultiError) Error ¶
func (m TokenMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type TokenValidationError ¶
type TokenValidationError struct {
// contains filtered or unexported fields
}
TokenValidationError is the validation error returned by Token.Validate if the designated constraints aren't met.
func (TokenValidationError) Cause ¶
func (e TokenValidationError) Cause() error
Cause function returns cause value.
func (TokenValidationError) Error ¶
func (e TokenValidationError) Error() string
Error satisfies the builtin error interface
func (TokenValidationError) ErrorName ¶
func (e TokenValidationError) ErrorName() string
ErrorName returns error name.
func (TokenValidationError) Field ¶
func (e TokenValidationError) Field() string
Field function returns field value.
func (TokenValidationError) Key ¶
func (e TokenValidationError) Key() bool
Key function returns key value.
func (TokenValidationError) Reason ¶
func (e TokenValidationError) Reason() string
Reason function returns reason value.