Skip to content

Releases: getyoti/yoti-go-sdk

v3.1.0

28 Sep 10:00
746bfed
Compare
Choose a tag to compare

Added

v3.0.0

02 Sep 10:39
Compare
Choose a tag to compare

We've taken this opportunity to address a number of breaking changes.
To get these updates, and other ones going forwards, you'll need to update references from github.com/getyoti/yoti-go-sdk/v2 to github.com/getyoti/yoti-go-sdk/v3

Added

  • Error returned can be wrapped, and can be signified as being "temporary", i.e. it might be worth retrying the request (see README for example)
  • Possible ActivityDetails errors are defined in yotierror/activitydetails.go

Changed

  • Preferred way of initialising the yoti client:
    • client := yoti.Client{sdkId, key} -> client, err := yoti.NewClient(sdkId, key)
  • GetActivityDetails(yotiOneTimeUseToken) now returns a single error, instead of "error strings". This can wrap multiple errors
  • anchor.value now returns a single string, rather than []string
  • Subpackage creation (moved from core yoti package:
    • Aml structs to aml subpackage:
      • yoti.AmlAddress -> aml.Address
      • yoti.AmlProfile -> aml.Profile
    • Dynamic Scenario structs moved to dynamic subpackage:
      • &yoti.DynamicScenarioBuilder{} -> &dynamic.ScenarioBuilder{}
    • share.ExtraData -> extra.Data
    • Share URL creation changed:
      • yoti.CreateShareURL(&client, &scenario) -> client.CreateShareURL(&scenario)
    • yoti/attribute -> yoti/profile/attribute
    • yoti.AgeVerification -> (yoti/profile/)attribute.AgeVerification
  • Image.Data is now a function, rather than a field:
    • selfie.Value().Data -> selfie.Value.Data()
  • The following methods can now potentially return an error:
    • SourceConstraintBuilder.Build()
    • WantedAttributeBuilder.Build()
    • ThirdPartyAttributeExtensionBuilder.Build()
  • (&ThirdPartyAttributeExtensionBuilder{}).New(). -> (&ThirdPartyAttributeExtensionBuilder{})
  • Structured Postal Address returns json.number instead of float64 for integer values

Removed

  • yoti.Image (use media.PNGImage or media.JPEGImage instead)
  • yoti.UserProfile (use profile.UserProfile) instead

v2.10.0

06 Jul 15:15
49a942b
Compare
Choose a tag to compare

Added

  • Document Images can be specified in Sandbox service when making a token request with: TokenRequest.WithDocumentImages

Fixed

  • issue where extra ; was being added to attribute.image.Base64URL()

v2.9.1

04 Jun 17:34
6b29e4a
Compare
Choose a tag to compare

Fixed

  • Dropping of trailing microseconds when formatting AttributeIssuance.ExpiryDate, ensure UTC

v2.9.0

06 Apr 15:40
fb0b12a
Compare
Choose a tag to compare

Added

  • Ability to use environment variable API URL (YOTI_API_URL) when making calls with the Yoti Client

Also added Profile Sandbox examples

v2.8.0

30 Mar 08:18
ac58652
Compare
Choose a tag to compare

Added

  • Sandbox Service
    • .SetupSharingProfile(tokenRequest) to interact with the Sandbox service and create a token for the specified profile (see snippet below)
  • file.ReadFile - this can be used to read the PEM file in bytes, which we initialise the YotiClient with, and then convert to a PEM before using it in the SandboxClient
import (
	"github.com/getyoti/yoti-go-sdk/v2"
	"github.com/getyoti/yoti-go-sdk/v2/cryptoutil"
	"github.com/getyoti/yoti-go-sdk/v2/file"
	"github.com/getyoti/yoti-go-sdk/v2/profile/sandbox"
)


func TestExample(t *testing.T) {
	sandboxClientSdkId := os.Getenv("SANDBOX_CLIENT_SDK_ID")
	pemFileBytes, err := file.ReadFile(os.Getenv("YOTI_KEY_FILE_PATH"))
	assert.NilError(t, err)

	privateKey, err := cryptoutil.ParseRSAKey(pemFileBytes)
	assert.NilError(t, err)

	sandboxClient := sandbox.Client{
		ClientSdkID: sandboxClientSdkId,
		Key:         privateKey,
	}

	var dateOfBirthUnder18 = time.Now().AddDate(-10, 0, 0)

	tokenRequest := (&sandbox.TokenRequest{}).
		WithRememberMeID("remember_me_id_12345").
		WithAgeVerification(dateOfBirthUnder18, sandbox.Derivation{}.AgeUnder(18), nil).
		WithGivenNames("some given names", nil).
		WithFamilyName("some family name", nil).
		WithFullName("some full name", nil).
		WithDateOfBirth(dateOfBirthUnder18, nil).
		WithGender("some gender", nil).
		WithPhoneNumber("some phone number", nil).
		WithNationality("some nationality", nil).
		WithStructuredPostalAddress(
			map[string]interface{}{
				"building_number": "1",
				"address_line1":   "some street name",
			}, nil).
		WithBase64Selfie(base64.StdEncoding.EncodeToString([]byte("some_image_value")), nil).
		WithEmailAddress("some@email", nil).
		WithDocumentDetails("PASSPORT USA 1234abc", nil)

	sandboxToken, err := sandboxClient.SetupSharingProfile(tokenRequest)
	assert.NilError(t, err)

	yotiClient := yoti.Client{
		Key:   pemFileBytes,
		SdkID: sandboxClientSdkId,
	}
	yotiClient.OverrideAPIURL("https://api.yoti.com/sandbox/v1")

	activityDetails, errStrings := yotiClient.GetActivityDetails(sandboxToken)
	if len(errStrings) > 0 {
		log.Fatalf("%v", errStrings)
	}

	assert.Equal(t, "some@email", activityDetails.UserProfile.EmailAddress().Value())
}

v2.7.1

24 Feb 15:04
e3cd0f9
Compare
Choose a tag to compare

Changed

  • Document Details parsing to now handle redacted Aadhaar ID numbers (and other redacted ID numbers)

Removed

  • Support for Go 1.10 and earlier. Go's release policy is to only support a version until there are two newer major releases. The current latest is 1.13, so official support extends only back to 1.12. Additionally, while Go promises backwards compatibility, Go 1.11 is the earliest version of Go with an official implementation of the Go modules feature which is necessary to fetch our dependencies. Due to upstream changes the previous workaround no longer functions.

v2.7.0

05 Dec 11:00
4667ee6
Compare
Choose a tag to compare

Additions

  • JSONHeaders helper function to requests subpackage
  • ActivityDetails.ExtraData() with AttributeIssuanceDetails() for accessing third party issued attributes.
  • ThirdPartyAttributeExtension and ThirdPartyAttributeExtensionBuilder for requesting third party issued attributes.
  • Validation to assert Wanted Attribute Names are not empty
  • AgeVerifications() to Profile, returning list of new AgeVerification struct

Removed

  • Unneeded HTTP header X-Yoti-Auth-Key from requests generated by SignedRequest

v2.6.0

30 Sep 09:54
3a53047
Compare
Choose a tag to compare

Changelog

Added

  • ActivityDetails:
    • ApplicationProfile
    • Timestamp()
    • ReceiptID()
  • Profile:
    • DocumentDetails()
  • Requesting dynamic shares: yoti.CreateShareURL(&client, &scenario)
    • Including Source-based constraints
  • Signed request builder: SignedRequest

Changed

  • Anchor timestamp now include Microsecond precision
  • Improve Profile example project

v2.5.0

24 Apr 15:30
Compare
Choose a tag to compare

Changed

  • SDK Identifier header
  • UNDEFINED content type handling