security

package
v0.0.0-...-ce03e45 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RawCookieBlockKey []byte
View Source
var RawCookieHashKey []byte

Functions

func ComparePassword

func ComparePassword(raw string, encoded string) (bool, error)

func DecodePublicKey

func DecodePublicKey() (*ecdsa.PublicKey, string, error)

func HashPassword

func HashPassword(raw string) (string, error)

Types

type JWT

type JWT struct {
	// contains filtered or unexported fields
}

func NewJWT

func NewJWT(clock iface.Clocker) (*JWT, error)

func (*JWT) GenerateAccessToken

func (j *JWT) GenerateAccessToken(uid typedef.UserID, claims map[string]any) (string, error)

func (*JWT) GenerateIDToken

func (j *JWT) GenerateIDToken(uid typedef.UserID, audiences []string, authTime time.Time, nonce string) (string, error)

GenerateIDToken generates ID token and returns it as string. The detail of ID token is described here: https://openid-foundation-japan.github.io/openid-connect-core-1_0.ja.html#IDToken

func (*JWT) GenerateRefreshToken

func (j *JWT) GenerateRefreshToken(uid typedef.UserID, claims map[string]any) (string, error)

func (*JWT) Parse

func (j *JWT) Parse(token string) (jwt.Token, error)

Jump to

Keyboard shortcuts

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