Versions in this module Expand all Collapse all v0 v0.0.1 Feb 26, 2024 Changes in this version + const DefaultTokenDuration + 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 string + const RoleAgent + const RoleClient + type TokenAlg string + const ES256 + const RS256 + type TokenClaims struct + AgentID string + Role string + type TokenSigner interface + SignToken func() (string, error) + func NewTokenSigner(alg TokenAlg, privateKey crypto.PrivateKey, agentID string, ...) TokenSigner + type TokenSignerOption func(*tokenSigner) + type TokenVerifier interface + VerifyToken func(tokenString string) (*TokenClaims, error) + func NewTokenVerifier(publicKey crypto.PublicKey, opts ...TokenVerifierOption) TokenVerifier + type TokenVerifierOption func(*tokenVerifier)