auth

package
v0.0.2-0...-13a971e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccountName = "zafx"
)

Variables

This section is empty.

Functions

func DefaultAuthMW

func DefaultAuthMW(next http.Handler) http.Handler

func GetCSRFToken

func GetCSRFToken(r *http.Request) (string, error)

func HandleCORSMW

func HandleCORSMW(next http.Handler) http.Handler

func LoginRequiredMW

func LoginRequiredMW(next http.Handler) http.Handler

func MustGetKBPassphraseFromSession

func MustGetKBPassphraseFromSession(r *http.Request) string

func OTPRequiredMW

func OTPRequiredMW(next http.HandlerFunc) http.HandlerFunc

func ProtectCSRFMW

func ProtectCSRFMW(skipRoutes []string) mux.MiddlewareFunc

func ReadN

func ReadN(n int) []byte

func ReadStr32

func ReadStr32() string

func ReadStrN

func ReadStrN(byteLen int) string

func RegisterRoutes

func RegisterRoutes(ctx context.CLIContext, r *mux.Router, cdc *codec.Codec)

func ReplaceKB

func ReplaceKB(name string, passphrase string, pk crypto.PrivKey) string

Types

type Keybase

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

func GetKB

func GetKB(id string) *Keybase

func GetKBFromSession

func GetKBFromSession(r *http.Request) (*Keybase, error)

func MustGetKBFromSession

func MustGetKBFromSession(r *http.Request) *Keybase

func NewHotKeybase

func NewHotKeybase(name string, passphrase string, pk crypto.PrivKey) *Keybase

func (*Keybase) CloseDB

func (*Keybase) CloseDB()

func (*Keybase) CreateAccount

func (*Keybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd string, account uint32, index uint32) (keys.Info, error)

func (*Keybase) CreateLedger

func (k *Keybase) CreateLedger(name string, algo keys.SigningAlgo, hrp string, account, index uint32) (info keys.Info, err error)

func (*Keybase) CreateMnemonic

func (*Keybase) CreateMnemonic(name string, language keys.Language, passwd string, algo keys.SigningAlgo) (info keys.Info, seed string, err error)

func (*Keybase) CreateMulti

func (*Keybase) CreateMulti(name string, pubkey crypto.PubKey) (info keys.Info, err error)

func (*Keybase) CreateOffline

func (*Keybase) CreateOffline(name string, pubkey crypto.PubKey) (info keys.Info, err error)

func (*Keybase) Delete

func (*Keybase) Delete(name, passphrase string, skipPass bool) error

func (*Keybase) Derive

func (*Keybase) Derive(name, mnemonic, bip39Passwd, encryptPasswd string, params hd.BIP44Params) (keys.Info, error)

func (*Keybase) Export

func (*Keybase) Export(name string) (armor string, err error)

func (*Keybase) ExportPrivKey

func (k *Keybase) ExportPrivKey(name, decryptPassphrase, encryptPassphrase string) (armor string, err error)

func (*Keybase) ExportPrivateKeyObject

func (*Keybase) ExportPrivateKeyObject(name string, passphrase string) (crypto.PrivKey, error)

func (*Keybase) ExportPubKey

func (*Keybase) ExportPubKey(name string) (armor string, err error)

func (*Keybase) Get

func (*Keybase) Get(name string) (keys.Info, error)

func (*Keybase) GetAddr

func (k *Keybase) GetAddr() sdk.AccAddress

func (*Keybase) GetByAddress

func (*Keybase) GetByAddress(address types.AccAddress) (keys.Info, error)

func (*Keybase) GetName

func (k *Keybase) GetName() string

func (*Keybase) Import

func (*Keybase) Import(name string, armor string) (err error)

func (*Keybase) ImportPrivKey

func (k *Keybase) ImportPrivKey(name, armor, passphrase string) error

func (*Keybase) ImportPubKey

func (*Keybase) ImportPubKey(name string, armor string) (err error)

func (*Keybase) List

func (*Keybase) List() ([]keys.Info, error)

func (*Keybase) Sign

func (k *Keybase) Sign(name string, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)

func (*Keybase) Update

func (*Keybase) Update(name, oldpass string, getNewpass func() (string, error)) error

type LoginRequest

type LoginRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type MeResponse

type MeResponse struct {
	Address string `json:"address"`
}

Jump to

Keyboard shortcuts

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