Documentation
¶
Index ¶
- Constants
- func GenerateAgentJWTToken(agent *relational.Agent, key *relational.AgentServiceAccountKey, ...) (*string, error)
- func GenerateJWTToken(user *relational.User, privateKey *rsa.PrivateKey) (*string, error)
- func GeneratePasswordResetToken(email string, privateKey *rsa.PrivateKey) (*string, error)
- func PublicKeyToPEM(pubKey *rsa.PublicKey) (string, error)
- type AgentClaims
- type JWK
- type PasswordResetClaims
- type UserClaims
Constants ¶
View Source
const ( TokenKindUser = "user" TokenKindAgent = "agent" TokenKindEvidenceSignature = "evidence_signature" )
Variables ¶
This section is empty.
Functions ¶
func GenerateAgentJWTToken ¶
func GenerateAgentJWTToken(agent *relational.Agent, key *relational.AgentServiceAccountKey, privateKey *rsa.PrivateKey) (*string, error)
func GenerateJWTToken ¶
func GenerateJWTToken(user *relational.User, privateKey *rsa.PrivateKey) (*string, error)
func GeneratePasswordResetToken ¶ added in v0.6.0
func GeneratePasswordResetToken(email string, privateKey *rsa.PrivateKey) (*string, error)
Types ¶
type AgentClaims ¶
type AgentClaims struct {
jwt.RegisteredClaims
TokenKind string `json:"token_kind"`
AgentID string `json:"agent_id"`
CredentialID string `json:"credential_id"`
AuthMethod string `json:"auth_method"`
}
func VerifyAgentJWTToken ¶
func VerifyAgentJWTToken(tokenString string, publicKey *rsa.PublicKey) (*AgentClaims, error)
type JWK ¶
type PasswordResetClaims ¶ added in v0.6.0
type PasswordResetClaims struct {
jwt.RegisteredClaims
Email string `json:"email"`
}
func VerifyPasswordResetToken ¶ added in v0.6.0
func VerifyPasswordResetToken(tokenString string, publicKey *rsa.PublicKey) (*PasswordResetClaims, error)
type UserClaims ¶
type UserClaims struct {
jwt.RegisteredClaims
TokenKind string `json:"token_kind"`
GivenName string `json:"given_name"`
FamilyName string `json:"family_name"`
}
func VerifyJWTToken ¶
func VerifyJWTToken(tokenString string, publicKey *rsa.PublicKey) (*UserClaims, error)
Click to show internal directories.
Click to hide internal directories.