auth

package
v0.0.0-...-a0d1ad3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTokenSecret

func GetTokenSecret() string

func NewRegisteredClaims

func NewRegisteredClaims(issuer, aud, sub string, expir time.Duration) *jwt.RegisteredClaims

Types

type Claims

type Claims struct {
	Userdata             `json:"userdata"`
	jwt.RegisteredClaims `json:"jwt_._standard_claims"`
}

Claims https://datatracker.ietf.org/doc/html/rfc7519#section-4 JWT Claims.

func NewClaims

func NewClaims(userdata *Userdata, registeredClaims *jwt.RegisteredClaims) *Claims

func (*Claims) JWTTokenGenerator

func (c *Claims) JWTTokenGenerator(secret string) (token string, err error)

JWTTokenGenerator ...

type JWT

type JWT interface {
	JWTTokenGenerator(secret string) (token string, err error)
}

type JWTParse

type JWTParse struct {
	Token  string
	Secret string
}

func NewParseJWTToken

func NewParseJWTToken(token string, secret string) *JWTParse

func (*JWTParse) JWTTokenParse

func (p *JWTParse) JWTTokenParse() (*Claims, error)

type Userdata

type Userdata struct {
	AccountId string `json:"account_id,omitempty"`
	ActorId   string `json:"actor_id,omitempty"`
	DeviceID  string `json:"device_id,omitempty"`
	Username  string `json:"username,omitempty"`
	Mail      string `json:"mail,omitempty"`
}

func NewUserdata

func NewUserdata(accountId string, actorId string, deviceID string, username string, mail string) *Userdata

Jump to

Keyboard shortcuts

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