Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidAlgorithm for service. ErrInvalidAlgorithm = errors.New("invalid algorithm") // ErrInvalidIssuer for service. ErrInvalidIssuer = errors.New("invalid issuer") // ErrInvalidAudience for service. ErrInvalidAudience = errors.New("invalid audience") // ErrInvalidTime for service. ErrInvalidTime = errors.New("invalid time") )
View Source
var Module = fx.Options( fx.Provide(NewKID), fx.Provide(NewJWT), fx.Provide(NewPaseto), fx.Provide(NewToken), )
Module for fx.
Functions ¶
Types ¶
type Config ¶ added in v1.324.0
type Config struct { Kind string `yaml:"kind,omitempty" json:"kind,omitempty" toml:"kind,omitempty"` Subject string `yaml:"sub,omitempty" json:"sub,omitempty" toml:"sub,omitempty"` Audience string `yaml:"aud,omitempty" json:"aud,omitempty" toml:"aud,omitempty"` Issuer string `yaml:"iss,omitempty" json:"iss,omitempty" toml:"iss,omitempty"` Expiration string `yaml:"exp,omitempty" json:"exp,omitempty" toml:"exp,omitempty"` }
Config for token.
type Generator ¶
type Generator interface { // Generate a new token or error. Generate(ctx context.Context) (context.Context, []byte, error) }
Generator allows the implementation of different types generators.
type JWT ¶ added in v1.324.0
type JWT struct {
// contains filtered or unexported fields
}
JWT token.
type Paseto ¶ added in v1.324.0
type Paseto struct {
// contains filtered or unexported fields
}
Paseto token.
Click to show internal directories.
Click to hide internal directories.