signin

package module
v0.0.0-...-25d5232 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	Id        *datastore.Key `datastore:"__key__"`
	UserId    int64
	ExpiresAt time.Time
	CreatedAt time.Time
}

func (*AccessToken) Claims

func (a *AccessToken) Claims() *AccessTokenClaims

func (*AccessToken) Create

func (a *AccessToken) Create(ctx *context.Context, client *datastore.Client) error

func (*AccessToken) CreateFromUser

func (a *AccessToken) CreateFromUser(
	ctx *context.Context,
	client *datastore.Client,
	user *user.User,
	expires int,
) error

func (*AccessToken) GetById

func (a *AccessToken) GetById(ctx *context.Context, client *datastore.Client, id string) error

type AccessTokenClaims

type AccessTokenClaims struct {
	Type string `json:"typ"`
	jwt.StandardClaims
}

func (*AccessTokenClaims) SignRsa256

func (ac *AccessTokenClaims) SignRsa256(key *rsa.PrivateKey) (string, error)

type RefreshToken

type RefreshToken struct {
	Id         *datastore.Key `datastore:"__key__"`
	UserId     int64
	ExpiresAt  time.Time
	Device     string
	Os         string
	ClientName string
	CreatedAt  time.Time
}

func (*RefreshToken) Claims

func (r *RefreshToken) Claims() *RefreshTokenClaims

func (*RefreshToken) Create

func (r *RefreshToken) Create(ctx *context.Context, client *datastore.Client) error

func (*RefreshToken) CreateFromRequest

func (r *RefreshToken) CreateFromRequest(ctx *context.Context, client *datastore.Client, user *user.User, expires int, req *http.Request) (*RefreshTokenClaims, error)

func (*RefreshToken) GetById

func (r *RefreshToken) GetById(ctx *context.Context, client *datastore.Client, id string) error

type RefreshTokenClaims

type RefreshTokenClaims struct {
	Type string `json:"typ,omitempty"`
	jwt.StandardClaims
}

func (*RefreshTokenClaims) SignRsa512

func (rc *RefreshTokenClaims) SignRsa512(key *rsa.PrivateKey) (string, error)

Jump to

Keyboard shortcuts

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