controllers

package
v0.0.0-...-2a2476d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHmac

func CheckHmac(message, messageMAC, key []byte) bool

Types

type CreateSDKToken

type CreateSDKToken struct {
	Applicant string `json:"applicant_id"`
	Referrer  string `json:"referrer"`
}

type OnfidoApplicant

type OnfidoApplicant struct {
	ID string `json:"id"`
}

func CreateOnfidoApplicant

func CreateOnfidoApplicant(name, lastName, email string) *OnfidoApplicant

type OnfidoApplicantCreation

type OnfidoApplicantCreation struct {
	Name     string `json:"first_name"`
	LastName string `json:"last_name"`
	Email    string `json:"email"`
}

type OnfidoCheck

type OnfidoCheck struct {
	ID     string `json:"id"`
	Result string `json:"result"`
}

https://documentation.onfido.com/#check-object

func CreateOnfidoCheck

func CreateOnfidoCheck(applicantId string) *OnfidoCheck

func GetOnfidoCheck

func GetOnfidoCheck(applicantId, checkId string) OnfidoCheck

func (*OnfidoCheck) IsClear

func (this *OnfidoCheck) IsClear() bool

type OnfidoCheckCreation

type OnfidoCheckCreation struct {
	Reports []Report `json:"reports"`
}

type OnfidoObject

type OnfidoObject struct {
	CompletedAt string `json:"completed_at"`
	Href        string `json:"href"`
	Id          string `json:"id"`
	Status      string `json:"status"`
	Action      string `json:"action"`
	Resource    string `json:"action"`
}

type OnfidoPayload

type OnfidoPayload struct {
	Action       string       `json:"action"`
	ResourceType string       `json:"resource_type"`
	Object       OnfidoObject `json:"object"`
}

type OnfidoStatus

type OnfidoStatus int
const (
	PENDING_DOCUMENT_UPLOAD OnfidoStatus = iota
	WAITING_FOR_APPROVAL
	ACCEPTED
	DENIED
)

func (OnfidoStatus) String

func (this OnfidoStatus) String() string

type OnfidoWebHook

type OnfidoWebHook struct {
	Payload OnfidoPayload `json:"payload"`
}

func (*OnfidoWebHook) IsReportCompleted

func (this *OnfidoWebHook) IsReportCompleted() bool

type Report

type Report struct {
	Name string `json:"name"`
}

type SDKToken

type SDKToken struct {
	Token string `json:"token"`
}

func GetOnfidoSDKToken

func GetOnfidoSDKToken(applicantId string) *SDKToken

type UserController

type UserController struct {
	beego.Controller
}

Operations about users

func (*UserController) ApproveUser

func (controller *UserController) ApproveUser()

@Title Mark user as approved, testing purposes only @Description Mark user as approved. It's GET to allow not technical people to trigger it @Success 200 @Failure 400 Malformed request @router /users/approval/0x:address([a-fA-F0-9]+) [get]

func (*UserController) Check

func (controller *UserController) Check()

@Title Liveness probe for Kubernetes @Description It just returns 200 if everything is ok, or 500 if the database is not connecting etc @Success 200 @Failure 400 Malformed request @router /check [get]

func (*UserController) Get

func (controller *UserController) Get()

@Title Get User @Description Retrieves user @Success 200 @Failure 400 Malformed request @router /users/0x:address([a-fA-F0-9]+) [get]

func (*UserController) Post

func (controller *UserController) Post()

@Title Signup User @Description Registers user in the service for the kyc verification @Success 200 @Failure 400 Malformed request @router /users/0x:address([a-fA-F0-9]+) [post]

func (*UserController) Put

func (controller *UserController) Put()

@Title Signal User Report @Description After the user uploads the documents, the frontend reaches this endpoint to create the check @Success 200 @Failure 400 Malformed request @router /users/0x:address([a-fA-F0-9]+) [put]

func (*UserController) WebhookPost

func (controller *UserController) WebhookPost()

@Title Webhook post @Description Called by Onfido when report status changes @Success 200 @Failure 400 Malformed request @router /webhooks [post]

type UserPost

type UserPost struct {
	Email     string              `json:"email"`
	Name      string              `json:"name"`
	LastName  string              `json:"lastName"`
	Signature UserSignupSignature `json:"signature"`
}

type UserSignupSignature

type UserSignupSignature struct {
	Terms     string `json:"terms"`
	TermsHash string `json:"termsHash"`
	R         string `json:"r"`
	S         string `json:"s"`
	V         string `json:"v"`
}

type UserStatus

type UserStatus struct {
	Status string `json:"status"`
}

type ValidationError

type ValidationError struct {
	Message string `json:"Message"`
	Key     string `json:"Key"`
}

Jump to

Keyboard shortcuts

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