yoti

package module
v3.12.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 8 Imported by: 0

README

Yoti Go SDK

Build Status Go Report Card PkgGoDev License Coverage Bugs Code Smells Vulnerabilities

Welcome to the Yoti Go SDK. This repo contains the tools and step by step instructions you need to quickly integrate your Go back-end with Yoti so that your users can share their identity details with your application in a secure and trusted way.

Table of Contents

  1. Requirements - Requirements to use the SDK

  2. Enabling the SDK - How to add the SDK to your project

  3. Setup - Setup required before using the Yoti services

  4. Products - Links to more information about the products offered by the Yoti SDK

  5. Support - Please feel free to reach out

Requirements

Supported Go Versions:

Enabling the SDK

Simply add github.com/getyoti/yoti-go-sdk/v3 as an import:

import "github.com/getyoti/yoti-go-sdk/v3"

or add the following line to your go.mod file (check https://github.com/getyoti/yoti-go-sdk/releases for the latest version)


require github.com/getyoti/yoti-go-sdk/v3 v3.12.0

Setup

For each service you will need:

  • Your Client SDK ID, generated by Yoti Hub when you create (and then publish) your app.
  • Your .pem file. This is your own unique private key which your browser generates from the Yoti Hub when you create an application.

Products

Support

For any questions or support please contact us here: https://support.yoti.com Please provide the following to get you up and working as quickly as possible:

  • Computer type
  • OS version
  • Version of Go being used
  • Screenshot

Once we have answered your question we may contact you again to discuss Yoti products and services. If you’d prefer us not to do this, please let us know when you e-mail.

Documentation

Index

Constants

View Source
const DefaultURL = "https://api.yoti.com/share"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// SdkID represents the SDK ID and NOT the App ID. This can be found in the integration section of your
	// application hub at https://hub.yoti.com/
	SdkID string

	// Key should be the security key given to you by yoti (see: security keys section of
	// https://hub.yoti.com) for more information about how to load your key from a file see:
	// https://github.com/getyoti/yoti-go-sdk/blob/master/README.md
	Key *rsa.PrivateKey

	HTTPClient requests.HttpClient // Mockable HTTP Client Interface
	// contains filtered or unexported fields
}

Client represents a client that can communicate with yoti and return information about Yoti users.

func NewClient

func NewClient(sdkID string, key []byte) (*Client, error)

NewClient constructs a Client object

func (*Client) CreateShareURL

func (client *Client) CreateShareURL(scenario *dynamic.Scenario) (share dynamic.ShareURL, err error)

CreateShareURL creates a QR code for a specified dynamic scenario

func (*Client) GetActivityDetails

func (client *Client) GetActivityDetails(token string) (activity profile.ActivityDetails, err error)

GetActivityDetails requests information about a Yoti user using the one time use token generated by the Yoti login process. It returns the outcome of the request. If the request was successful it will include the user's details, otherwise an error will be returned, which will specify the reason the request failed. If the function call can be reattempted with the same token the error will implement interface{ Temporary() bool }.

func (*Client) GetSdkID

func (client *Client) GetSdkID() string

GetSdkID gets the Client SDK ID attached to this client instance

func (*Client) OverrideAPIURL

func (client *Client) OverrideAPIURL(apiURL string)

OverrideAPIURL overrides the default API URL for this Yoti Client

func (*Client) PerformAmlCheck

func (client *Client) PerformAmlCheck(profile aml.Profile) (result aml.Result, err error)

PerformAmlCheck performs an Anti Money Laundering Check (AML) for a particular user. Returns three boolean values: 'OnPEPList', 'OnWatchList' and 'OnFraudList'.

type DigitalIdentityClient added in v3.12.0

type DigitalIdentityClient struct {
	// SdkID represents the SDK ID and NOT the App ID. This can be found in the integration section of your
	// application hub at https://hub.yoti.com/
	SdkID string

	// Key should be the security key given to you by yoti (see: security keys section of
	// https://hub.yoti.com) for more information about how to load your key from a file see:
	// https://github.com/getyoti/yoti-go-sdk/blob/master/README.md
	Key *rsa.PrivateKey

	HTTPClient requests.HttpClient // Mockable HTTP Client Interface
	// contains filtered or unexported fields
}

DigitalIdentityClient represents a client that can communicate with yoti and return information about Yoti users.

func NewDigitalIdentityClient added in v3.12.0

func NewDigitalIdentityClient(sdkID string, key []byte) (*DigitalIdentityClient, error)

NewDigitalIdentityClient constructs a Client object

func (*DigitalIdentityClient) CreateShareQrCode added in v3.12.0

func (client *DigitalIdentityClient) CreateShareQrCode(sessionID string) (share *digitalidentity.QrCode, err error)

CreateShareQrCode generates a sharing session QR code to initiate a sharing process based on session ID

func (*DigitalIdentityClient) CreateShareSession added in v3.12.0

func (client *DigitalIdentityClient) CreateShareSession(shareSessionRequest *digitalidentity.ShareSessionRequest) (shareSession *digitalidentity.ShareSession, err error)

CreateShareSession creates a sharing session to initiate a sharing process based on a policy

func (*DigitalIdentityClient) GetQrCode added in v3.12.0

func (client *DigitalIdentityClient) GetQrCode(qrCodeId string) (share digitalidentity.ShareSessionQrCode, err error)

Get session QR code based on generated Qr ID

func (*DigitalIdentityClient) GetSdkID added in v3.12.0

func (client *DigitalIdentityClient) GetSdkID() string

GetSdkID gets the Client SDK ID attached to this client instance

func (*DigitalIdentityClient) GetShareReceipt added in v3.12.0

func (client *DigitalIdentityClient) GetShareReceipt(receiptId string) (share digitalidentity.SharedReceiptResponse, err error)

GetShareReceipt fetches the receipt of the share given a receipt id.

func (*DigitalIdentityClient) GetShareSession added in v3.12.0

func (client *DigitalIdentityClient) GetShareSession(sessionID string) (*digitalidentity.ShareSession, error)

GetShareSession retrieves the sharing session.

func (*DigitalIdentityClient) OverrideAPIURL added in v3.12.0

func (client *DigitalIdentityClient) OverrideAPIURL(apiURL string)

OverrideAPIURL overrides the default API URL for this Yoti Client

Jump to

Keyboard shortcuts

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