Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK-2386: Update IDV example project defaults #286

Merged
merged 11 commits into from
Nov 10, 2023
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ 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.9.0
require github.com/getyoti/yoti-go-sdk/v3 v3.10.0
```

## Setup
Expand Down
Binary file removed _examples/idv/idv.exe
Binary file not shown.
20 changes: 8 additions & 12 deletions _examples/idv/models.sessionspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {
var faceMatchCheck *check.RequestedFaceMatchCheck
faceMatchCheck, err = check.NewRequestedFaceMatchCheckBuilder().
WithManualCheckAlways().
WithManualCheckFallback().
Build()
if err != nil {
return nil, err
Expand All @@ -28,8 +28,8 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {

var livenessCheck *check.RequestedLivenessCheck
livenessCheck, err = check.NewRequestedLivenessCheckBuilder().
ForZoomLiveness().
WithMaxRetries(5).
ForStaticLiveness().
WithMaxRetries(3).
Build()
if err != nil {
return nil, err
Expand Down Expand Up @@ -71,7 +71,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {

var textExtractionTask *task.RequestedTextExtractionTask
textExtractionTask, err = task.NewRequestedTextExtractionTaskBuilder().
WithManualCheckAlways().
WithManualCheckFallback().
WithExpandedDocumentFields(true).
Build()
if err != nil {
Expand All @@ -80,7 +80,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {

var supplementaryDocTextExtractionTask *task.RequestedSupplementaryDocTextExtractionTask
supplementaryDocTextExtractionTask, err = task.NewRequestedSupplementaryDocTextExtractionTaskBuilder().
WithManualCheckAlways().
WithManualCheckFallback().
Build()
if err != nil {
return nil, err
Expand Down Expand Up @@ -158,7 +158,7 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {

sessionSpec, err = create.NewSessionSpecificationBuilder().
WithClientSessionTokenTTL(600).
WithResourcesTTL(90000).
WithResourcesTTL(86400).
WithUserTrackingID("some-tracking-id").
WithRequestedCheck(faceMatchCheck).
WithRequestedCheck(documentAuthenticityCheck).
Expand All @@ -180,10 +180,6 @@ func buildSessionSpec() (sessionSpec *create.SessionSpecification, err error) {
return nil, err
}

if err != nil {
return nil, err
}

return sessionSpec, nil
}

Expand Down Expand Up @@ -224,8 +220,8 @@ func buildDBSSessionSpec() (sessionSpec *create.SessionSpecification, err error)
}`)

sessionSpec, err = create.NewSessionSpecificationBuilder().
WithClientSessionTokenTTL(6000).
WithResourcesTTL(900000).
WithClientSessionTokenTTL(600).
WithResourcesTTL(86400).
WithUserTrackingID("some-tracking-id").
WithSDKConfig(sdkConfig).
WithIdentityProfileRequirements(identityProfile).
Expand Down
35 changes: 35 additions & 0 deletions _examples/idv/templates/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,41 @@ <h5>Media</h5>
</div>
{{ end }}

{{ if $doc.ExpandedDocumentFields }}
<div class="card">
<div class="card-header" id="document-fields-{{ $key }}">
<h4 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse"
data-target="#collapse-document-fields-{{ $key }}"
aria-expanded="true"
aria-controls="collapse-document-fields-{{ $key }}">
Expanded Document Fields
</button>
</h4>
</div>
<div id="collapse-document-fields-{{ $key }}" class="collapse"
aria-labelledby="document-fields-{{ $key }}">
<div class="card-body">
{{ if $doc.ExpandedDocumentFields.Media }}
<h5>Media</h5>
<table class="table table-striped table-light">
<tbody>
<tr>
<td>ID</td>
<td>
<a href="/media?mediaId={{ $doc.ExpandedDocumentFields.Media.ID }}">
{{ $doc.ExpandedDocumentFields.Media.ID }}
</a>
</td>
</tr>
</tbody>
</table>
{{ end }}
</div>
</div>
</div>
{{ end }}

{{ if $doc.DocumentIDPhoto }}
<div class="card">
<div class="card-header" id="document-id-photo-{{ $key }}">
Expand Down
2 changes: 1 addition & 1 deletion consts/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package consts

const (
SDKIdentifier = "Go"
SDKVersionIdentifier = "3.9.0"
SDKVersionIdentifier = "3.10.0"
)
2 changes: 1 addition & 1 deletion requests/signed_message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestRequestShouldBuildForValid(t *testing.T) {
assert.Check(t, urlCheck)
assert.Check(t, signed.Header.Get("X-Yoti-Auth-Digest") != "")
assert.Equal(t, signed.Header.Get("X-Yoti-SDK"), "Go")
assert.Equal(t, signed.Header.Get("X-Yoti-SDK-Version"), "3.9.0")
assert.Equal(t, signed.Header.Get("X-Yoti-SDK-Version"), "3.10.0")
}

func TestRequestShouldAddHeaders(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sonar.organization = getyoti
sonar.projectKey = getyoti:go
sonar.projectName = Go SDK
sonar.projectVersion = 3.9.0
sonar.projectVersion = 3.10.0
sonar.exclusions = **/yotiprotoattr/*.go,**/yotiprotocom/*.go,**/yotiprotoshare/*.go,**/**_test.go,_examples/**/*
sonar.links.scm = https://github.com/getyoti/yoti-go-sdk
sonar.host.url = https://sonarcloud.io
Expand Down
Loading