authn

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

func PublicKeyToPEM

func PublicKeyToPEM(pubKey *rsa.PublicKey) (string, error)

Types

type JWK

type JWK struct {
	Kty string `json:"kty"`
	N   string `json:"n"`
	E   string `json:"e"`
	Alg string `json:"alg,omitempty"`
	Use string `json:"use,omitempty"`
	KID string `json:"kid,omitempty"`
}

func (*JWK) MarshalPublicKey

func (j *JWK) MarshalPublicKey() (*rsa.PublicKey, error)

func (*JWK) UnmarshalPublicKey

func (j *JWK) UnmarshalPublicKey(pubKey *rsa.PublicKey) (*JWK, error)

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
	GivenName  string `json:"given_name"`
	FamilyName string `json:"family_name"`
}

func VerifyJWTToken

func VerifyJWTToken(tokenString string, publicKey *rsa.PublicKey) (*UserClaims, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL