fazpass

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

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 13 Imported by: 0

README

go-fazpass-sdk

example workflow codecov GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRequest

type CheckRequest struct {
	Phone string `json:"phone" validate:"required"`
	Email string `json:"email" validate:"required"`
	Data  string `json:"data" validate:"required"`
}

type CheckResponse

type CheckResponse struct {
	Name    string `json:"name"`
	Address string `json:"address"`
}

type Data

type Data struct {
	SessionId string     `json:"session_id"`
	TimeStamp *time.Time `json:"time_stamp"`
	Device    Device     `json:"device"`
}

type Device

type Device struct {
	Score           float64     `json:"score"`
	Platform        string      `json:"platform"`
	FazpassId       string      `json:"fazpass_id"`
	IsRooted        bool        `json:"is_rooted"`
	IsEmulator      bool        `json:"is_emulator"`
	IsGpsSpoof      bool        `json:"is_gps_spoof"`
	IsAppTemper     bool        `json:"is_app_temper"`
	IsVpn           bool        `json:"is_vpn"`
	IsScreenSharing bool        `json:"is_share_screen"`
	IsDebuging      bool        `json:"is_debuging"`
	Name            string      `json:"name"`
	SimSerial       []string    `json:"sim_serial"`
	Geolocation     Geolocation `json:"geolocation"`
	CPU             string      `json:"cpu"`
	Timezone        string      `json:"timezone"`
}

type EnrollRequest

type EnrollRequest struct {
	Phone string `json:"phone" validate:"required"`
	Email string `json:"email" validate:"required"`
	Data  string `json:"data" validate:"required"`
}

type Fazpass

type Fazpass struct {
	PrivateKey  *rsa.PrivateKey
	PublicKey   *rsa.PublicKey
	MerchantKey string
	BaseUrl     string
	Flow        FlowInterface
}

func (*Fazpass) Check

func (f *Fazpass) Check(email string, phone string, encData string) (*Data, error)

func (*Fazpass) EnrollDevice

func (f *Fazpass) EnrollDevice(email string, phone string, encData string) (*Data, error)

func (*Fazpass) RemoveDevice

func (f *Fazpass) RemoveDevice(fazpassId string, encData string) (*Data, error)

func (*Fazpass) ValidateDevice

func (f *Fazpass) ValidateDevice(fazpassId string, encData string) (*Data, error)

type FazpassInterface

type FazpassInterface interface {
	Check(email string, phone string, encData string) (*Data, error)
	EnrollDevice(email string, phone string, encData string) (*Data, error)
	ValidateDevice(fazpassId string, encData string) (*Data, error)
	RemoveDevice(fazpassId string, encData string) (*Data, error)
}

func Initialize

func Initialize(flow FlowInterface, privatePath string, publicPath string, merchantKey string, url string) (FazpassInterface, error)

type Flow

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

func (*Flow) ExtractingData

func (flow *Flow) ExtractingData(privKey *rsa.PrivateKey, response *http.Response, data *Data) (*Data, error)

func (*Flow) SendingData

func (flow *Flow) SendingData(baseUrl string, wrappedMessage []byte, merchantKey string) (*http.Response, error)

func (*Flow) WrappingData

func (flow *Flow) WrappingData(pubKey *rsa.PublicKey, model interface{}) ([]byte, error)

type FlowInterface

type FlowInterface interface {
	WrappingData(pubKey *rsa.PublicKey, model interface{}) ([]byte, error)
	SendingData(baseUrl string, wrappedMessage []byte, merchantKey string) (*http.Response, error)
	ExtractingData(privKey *rsa.PrivateKey, response *http.Response, data *Data) (*Data, error)
}

func Default

func Default() FlowInterface

func Init

func Init(f *Flow) FlowInterface

type FlowMock

type FlowMock struct {
	mock.Mock
}

func (*FlowMock) ExtractingData

func (fm *FlowMock) ExtractingData(privKey *rsa.PrivateKey, response *http.Response, data *Data) (*Data, error)

extractingData implements FlowInterface

func (*FlowMock) SendingData

func (fm *FlowMock) SendingData(baseUrl string, wrappedMessage []byte, merchantKey string) (*http.Response, error)

sendingData implements FlowInterface

func (*FlowMock) WrappingData

func (fm *FlowMock) WrappingData(pubKey *rsa.PublicKey, model interface{}) ([]byte, error)

wrapingData implements FlowInterface

type Geolocation

type Geolocation struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type RemoveRequest

type RemoveRequest struct {
	FazpassId string `json:"fazpass_id" validate:"required"`
	Data      string `json:"data" validate:"required"`
}

type Transmission

type Transmission struct {
	Message string `json:"message"`
}

type ValidateRequest

type ValidateRequest struct {
	FazpassId string `json:"fazpass_id" validate:"required"`
	Data      string `json:"data" validate:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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