auth

package
v0.0.0-...-56b0842 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Network build.Network

Functions

This section is empty.

Types

type Challenge

type Challenge struct{}

Challenge represents a model which generates challenge transactions on developer's account

func (*Challenge) Call

func (c *Challenge) Call(devSecret string, expiresIn int64) string

Call generates a challenge transaction signed by the developer's private key

type JWT

type JWT struct{ Secret string }

JWT represents a generated json web token

func (*JWT) Decode

func (j *JWT) Decode(payload string) *jwt.Token

Decode and verify a JSON Web Token

func (*JWT) Encode

func (j *JWT) Encode(t *Token, options map[string]interface{}) string

Encode a Mobius auth token as a JSON Web token

type Sign

type Sign struct{}

Sign the user's challenge transaction

func (*Sign) Call

func (s *Sign) Call(userSecret, xdrs, address string) string

Sign adds a signature to the given transaction

type Token

type Token struct {
	DeveloperSecret string
	TX              *transaction.Transaction
	Address         string // user public key
	// contains filtered or unexported fields
}

Token checks the challenge transaction signed by user on developer's side

func NewToken

func NewToken(devSecret, xdrs, address string) (*Token, error)

NewToken creates a new token handler with provided developer seed, xdr and user address

func (*Token) GetAddress

func (t *Token) GetAddress() string

Address returns the address a current token is issued for

func (*Token) GetKeypair

func (t *Token) GetKeypair() *keypair.Full

GetKeypair returns the keypair for developer

func (*Token) GetUserKeypair

func (t *Token) GetUserKeypair() *keypair.Full

func (*Token) Hash

func (t *Token) Hash(format string) interface{}

Hash validates and returns the transaction hash

func (*Token) TimeBounds

func (t *Token) TimeBounds() *xdr.TimeBounds

TimeBounds returns the time bounds for a given transaction

func (*Token) Validate

func (t *Token) Validate(strict bool) (bool, error)

Validate transaction signed by developer and user

Jump to

Keyboard shortcuts

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