auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultExpireTimeInterval = time.Second * 120

Variables

View Source
var ERR_SIGNATUREEXPIRED = errors.New("signature expired")
View Source
var ERR_SIGNATUREINVALID = errors.New("signature invalid")
View Source
var ERR_UIDINVALID = errors.New("uid invalid")

Functions

func NewDefaultApuAuthenticator

func NewDefaultApuAuthenticator() *defaultApuAuthenticator

Types

type ApiAuthenticator

type ApiAuthenticator interface {
	Request(appId string, pubKey, privKey []byte) string
	Auth(sig string) (string, error)
}

type ApiRequest

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

func NewApiRequest

func NewApiRequest(token, metadata string, pubKey []byte) *ApiRequest

func NewApiRequestFromSig

func NewApiRequestFromSig(sig string) (*ApiRequest, error)

type AuthToken

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

func NewAuthToken

func NewAuthToken(appId string, timestamp int64) *AuthToken

func NewAuthTokenFromMetadata

func NewAuthTokenFromMetadata(metadata string) (*AuthToken, error)

Jump to

Keyboard shortcuts

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