identity

package module
v0.0.0-...-c64e028 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

README

trust-identity

Sign-In gateway support sign-in with eth-address / did / ens

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSession   = errors.New("Session not found", errors.WithVendor(errVendor))
	ErrTypedData = errors.New("TypedData sign verify failed", errors.WithVendor(errVendor))
)

errors

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	GetID(session string) (did string, err error)
	EthSignPrepare(from string, chainId uint) (typedData []byte, err error)
	EthSignVerify(session string, chainId uint, signature []byte) (err error)
}

type SessionManager

type SessionManager interface {
	Get(session string) (token *Token, committed bool)
	Prepare(token *Token) error
	Commit(session string) error
}

type Token

type Token struct {
	DID     string `json:"did"`
	Session string `json:"session"`
}

Directories

Path Synopsis
app
cmd
httproxy command
session

Jump to

Keyboard shortcuts

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