auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 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 = func(e error) SIGNATUREINVALIDERR {
	return SIGNATUREINVALIDERR{content: "signature invalid: %w", err: e}
}
View Source
var ERR_UIDINVALID = errors.New("uid invalid")

Functions

func NewDefaultApiAuthenticator added in v0.1.1

func NewDefaultApiAuthenticator() *defaultApiAuthenticator

func NewDefaultApiAuthenticatorAsDriver added in v0.1.1

func NewDefaultApiAuthenticatorAsDriver(driver xcrypt.Encrypt) *defaultApiAuthenticator

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(signature, metadata string, pubKey []byte) *ApiRequest

func NewApiRequestFromToken added in v0.1.1

func NewApiRequestFromToken(token string) (*ApiRequest, error)

type SIGNATUREINVALIDERR added in v0.1.1

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

func (SIGNATUREINVALIDERR) Error added in v0.1.1

func (e SIGNATUREINVALIDERR) Error() string

func (SIGNATUREINVALIDERR) Unwrap added in v0.1.1

func (e SIGNATUREINVALIDERR) Unwrap() error

type Signatory added in v0.1.1

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

func NewSignatory added in v0.1.1

func NewSignatory(crypt xcrypt.Encrypt, appId string, timestamp int64) *Signatory

func NewSignatoryFromMetadata added in v0.1.1

func NewSignatoryFromMetadata(crypt xcrypt.Encrypt, metadata string) (*Signatory, error)

Jump to

Keyboard shortcuts

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