Documentation ¶
Index ¶
- Constants
- func GenerateJWTToken(conf *config.AuthJwtTokenCmd) error
- func GeneratePrivateKey(conf *config.AuthKeyPrivateCmd) error
- func GeneratePublicKey(conf *config.AuthKeyPublicCmd) error
- func WithRole(role Role) func(*tokenSigner)
- func WithSignerAudience(audience string) func(*tokenSigner)
- func WithTokenDuration(duration time.Duration) func(*tokenSigner)
- func WithVerifierAudience(audience string) func(*tokenVerifier)
- type Role
- type TokenAlg
- type TokenClaims
- type TokenSigner
- type TokenSignerOption
- type TokenVerifier
- type TokenVerifierOption
Constants ¶
View Source
const DefaultTokenDuration = 30 * 24 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func GenerateJWTToken ¶
func GenerateJWTToken(conf *config.AuthJwtTokenCmd) error
func GeneratePrivateKey ¶
func GeneratePrivateKey(conf *config.AuthKeyPrivateCmd) error
func GeneratePublicKey ¶
func GeneratePublicKey(conf *config.AuthKeyPublicCmd) error
func WithSignerAudience ¶
func WithSignerAudience(audience string) func(*tokenSigner)
func WithTokenDuration ¶
func WithVerifierAudience ¶
func WithVerifierAudience(audience string) func(*tokenVerifier)
Types ¶
type TokenClaims ¶
type TokenSigner ¶
func NewTokenSigner ¶
func NewTokenSigner(alg TokenAlg, privateKey crypto.PrivateKey, agentID string, opts ...TokenSignerOption) TokenSigner
type TokenSignerOption ¶
type TokenSignerOption func(*tokenSigner)
type TokenVerifier ¶
type TokenVerifier interface {
VerifyToken(tokenString string) (*TokenClaims, error)
}
func NewTokenVerifier ¶
func NewTokenVerifier(publicKey crypto.PublicKey, opts ...TokenVerifierOption) TokenVerifier
type TokenVerifierOption ¶
type TokenVerifierOption func(*tokenVerifier)
Click to show internal directories.
Click to hide internal directories.