Releases: getyoti/yoti-go-sdk
Releases · getyoti/yoti-go-sdk
v3.1.0
v3.0.0
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 errorsanchor.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
- Aml structs to
- 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
returnsjson.number
instead offloat64
for integer values
Removed
- yoti.Image (use
media.PNGImage
ormedia.JPEGImage
instead) yoti.UserProfile
(useprofile.UserProfile
) instead
v2.10.0
v2.9.1
v2.9.0
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
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
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
Additions
JSONHeaders
helper function torequests
subpackageActivityDetails.ExtraData()
withAttributeIssuanceDetails()
for accessing third party issued attributes.ThirdPartyAttributeExtension
andThirdPartyAttributeExtensionBuilder
for requesting third party issued attributes.- Validation to assert Wanted Attribute Names are not empty
AgeVerifications()
to Profile, returning list of newAgeVerification
struct
Removed
- Unneeded HTTP header
X-Yoti-Auth-Key
from requests generated bySignedRequest
v2.6.0
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