Documentation
¶
Index ¶
- Variables
- type Claims
- func (*Claims) Descriptor() ([]byte, []int)deprecated
- func (x *Claims) GetAud() []string
- func (x *Claims) GetExp() *timestamppb.Timestamp
- func (x *Claims) GetIat() *timestamppb.Timestamp
- func (x *Claims) GetIss() string
- func (x *Claims) GetJti() string
- func (x *Claims) GetNbf() *timestamppb.Timestamp
- func (x *Claims) GetScopes() map[string]bool
- func (x *Claims) GetSub() string
- func (*Claims) ProtoMessage()
- func (x *Claims) ProtoReflect() protoreflect.Message
- func (x *Claims) Reset()
- func (x *Claims) String() string
- func (m *Claims) Validate() error
- func (m *Claims) ValidateAll() error
- type ClaimsMultiError
- type ClaimsValidationError
- type Config
- func (*Config) Descriptor() ([]byte, []int)deprecated
- func (x *Config) GetAudience() []string
- func (x *Config) GetIssuer() string
- func (x *Config) GetKey() []byte
- func (x *Config) GetKey2() []byte
- func (x *Config) GetKeyfunc() string
- func (x *Config) GetSigningMethod() string
- func (x *Config) GetTokenLifetime() *durationpb.Duration
- 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) GetClaims() *Claims
- func (x *Token) GetClientId() string
- func (x *Token) GetClientSecret() string
- func (x *Token) GetExpirationTime() *timestamppb.Timestamp
- func (x *Token) GetRefreshToken() string
- func (x *Token) GetToken() string
- func (x *Token) GetTokenType() 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_pwt_v1_token_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Claims ¶ added in v0.0.13
type Claims struct {
Sub string `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` // Subject
Iss string `protobuf:"bytes,2,opt,name=iss,proto3" json:"iss,omitempty"` // Issuer
Aud []string `protobuf:"bytes,3,rep,name=aud,proto3" json:"aud,omitempty"` // Audience
Exp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=exp,proto3" json:"exp,omitempty"` // Expiration Time
Nbf *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=nbf,proto3" json:"nbf,omitempty"` // Not Before
Iat *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=iat,proto3" json:"iat,omitempty"` // Issued At
Jti string `protobuf:"bytes,7,opt,name=jti,proto3" json:"jti,omitempty"` // JWT ID
Scopes map[string]bool `` // Scopes
/* 154-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*Claims) Descriptor
deprecated
added in
v0.0.13
func (*Claims) GetExp ¶ added in v0.0.13
func (x *Claims) GetExp() *timestamppb.Timestamp
func (*Claims) GetIat ¶ added in v0.0.13
func (x *Claims) GetIat() *timestamppb.Timestamp
func (*Claims) GetNbf ¶ added in v0.0.13
func (x *Claims) GetNbf() *timestamppb.Timestamp
func (*Claims) ProtoMessage ¶ added in v0.0.13
func (*Claims) ProtoMessage()
func (*Claims) ProtoReflect ¶ added in v0.0.13
func (x *Claims) ProtoReflect() protoreflect.Message
func (*Claims) Validate ¶ added in v0.0.13
Validate checks the field values on Claims 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 (*Claims) ValidateAll ¶ added in v0.0.13
ValidateAll checks the field values on Claims 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 ClaimsMultiError, or nil if none found.
type ClaimsMultiError ¶ added in v0.0.13
type ClaimsMultiError []error
ClaimsMultiError is an error wrapping multiple validation errors returned by Claims.ValidateAll() if the designated constraints aren't met.
func (ClaimsMultiError) AllErrors ¶ added in v0.0.13
func (m ClaimsMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ClaimsMultiError) Error ¶ added in v0.0.13
func (m ClaimsMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ClaimsValidationError ¶ added in v0.0.13
type ClaimsValidationError struct {
// contains filtered or unexported fields
}
ClaimsValidationError is the validation error returned by Claims.Validate if the designated constraints aren't met.
func (ClaimsValidationError) Cause ¶ added in v0.0.13
func (e ClaimsValidationError) Cause() error
Cause function returns cause value.
func (ClaimsValidationError) Error ¶ added in v0.0.13
func (e ClaimsValidationError) Error() string
Error satisfies the builtin error interface
func (ClaimsValidationError) ErrorName ¶ added in v0.0.13
func (e ClaimsValidationError) ErrorName() string
ErrorName returns error name.
func (ClaimsValidationError) Field ¶ added in v0.0.13
func (e ClaimsValidationError) Field() string
Field function returns field value.
func (ClaimsValidationError) Key ¶ added in v0.0.13
func (e ClaimsValidationError) Key() bool
Key function returns key value.
func (ClaimsValidationError) Reason ¶ added in v0.0.13
func (e ClaimsValidationError) Reason() string
Reason function returns reason value.
type Config ¶ added in v0.0.13
type Config struct {
SigningMethod string `protobuf:"bytes,1,opt,name=signing_method,proto3" json:"signing_method,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
Key2 []byte `protobuf:"bytes,3,opt,name=key2,proto3" json:"key2,omitempty"`
Keyfunc string `protobuf:"bytes,4,opt,name=keyfunc,proto3" json:"keyfunc,omitempty"`
TokenLifetime *durationpb.Duration `protobuf:"bytes,5,opt,name=token_lifetime,proto3" json:"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
TokenType string `protobuf:"bytes,8,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
added in
v0.0.13
func (*Config) GetAudience ¶ added in v0.0.13
func (*Config) GetKeyfunc ¶ added in v0.0.13
func (*Config) GetSigningMethod ¶ added in v0.0.13
func (*Config) GetTokenLifetime ¶ added in v0.0.13
func (x *Config) GetTokenLifetime() *durationpb.Duration
func (*Config) GetTokenType ¶ added in v0.0.13
func (*Config) ProtoMessage ¶ added in v0.0.13
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶ added in v0.0.13
func (x *Config) ProtoReflect() protoreflect.Message
func (*Config) Validate ¶ added in v0.0.13
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 ¶ added in v0.0.13
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 ¶ added in v0.0.13
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 ¶ added in v0.0.13
func (m ConfigMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ConfigMultiError) Error ¶ added in v0.0.13
func (m ConfigMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ConfigValidationError ¶ added in v0.0.13
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 ¶ added in v0.0.13
func (e ConfigValidationError) Cause() error
Cause function returns cause value.
func (ConfigValidationError) Error ¶ added in v0.0.13
func (e ConfigValidationError) Error() string
Error satisfies the builtin error interface
func (ConfigValidationError) ErrorName ¶ added in v0.0.13
func (e ConfigValidationError) ErrorName() string
ErrorName returns error name.
func (ConfigValidationError) Field ¶ added in v0.0.13
func (e ConfigValidationError) Field() string
Field function returns field value.
func (ConfigValidationError) Key ¶ added in v0.0.13
func (e ConfigValidationError) Key() bool
Key function returns key value.
func (ConfigValidationError) Reason ¶ added in v0.0.13
func (e ConfigValidationError) Reason() string
Reason function returns reason value.
type Token ¶ added in v0.0.6
type Token struct {
ClientId string `protobuf:"bytes,8,opt,name=client_id,proto3" json:"client_id,omitempty"`
ClientSecret string `protobuf:"bytes,9,opt,name=client_secret,proto3" json:"client_secret,omitempty"`
Token string `protobuf:"bytes,10,opt,name=token,json=access_token,proto3" json:"token,omitempty"`
RefreshToken string `protobuf:"bytes,11,opt,name=refresh_token,proto3" json:"refresh_token,omitempty"`
ExpirationTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=expiration_time,proto3" json:"expiration_time,omitempty"`
TokenType string `protobuf:"bytes,13,opt,name=token_type,proto3" json:"token_type,omitempty"`
Claims *Claims `protobuf:"bytes,14,opt,name=claims,proto3" json:"claims,omitempty"` // Claims
// 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
added in
v0.0.6
func (*Token) GetClientId ¶ added in v0.0.6
func (*Token) GetClientSecret ¶ added in v0.0.6
func (*Token) GetExpirationTime ¶ added in v0.0.6
func (x *Token) GetExpirationTime() *timestamppb.Timestamp
func (*Token) GetRefreshToken ¶ added in v0.0.13
func (*Token) GetTokenType ¶ added in v0.0.13
func (*Token) ProtoMessage ¶ added in v0.0.6
func (*Token) ProtoMessage()
func (*Token) ProtoReflect ¶ added in v0.0.6
func (x *Token) ProtoReflect() protoreflect.Message
func (*Token) Validate ¶ added in v0.0.6
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 ¶ added in v0.0.6
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 ¶ added in v0.0.6
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 ¶ added in v0.0.6
func (m TokenMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (TokenMultiError) Error ¶ added in v0.0.6
func (m TokenMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type TokenValidationError ¶ added in v0.0.6
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 ¶ added in v0.0.6
func (e TokenValidationError) Cause() error
Cause function returns cause value.
func (TokenValidationError) Error ¶ added in v0.0.6
func (e TokenValidationError) Error() string
Error satisfies the builtin error interface
func (TokenValidationError) ErrorName ¶ added in v0.0.6
func (e TokenValidationError) ErrorName() string
ErrorName returns error name.
func (TokenValidationError) Field ¶ added in v0.0.6
func (e TokenValidationError) Field() string
Field function returns field value.
func (TokenValidationError) Key ¶ added in v0.0.6
func (e TokenValidationError) Key() bool
Key function returns key value.
func (TokenValidationError) Reason ¶ added in v0.0.6
func (e TokenValidationError) Reason() string
Reason function returns reason value.