From d85b1d751adfe62f331d46384457f94b3be2c4d7 Mon Sep 17 00:00:00 2001 From: Andrii Holovko Date: Thu, 17 Oct 2024 14:51:35 +0300 Subject: [PATCH] feat(sdk): support for VC model 2.0 Signed-off-by: Andrii Holovko --- cmd/wallet-sdk-gomobile/go.mod | 12 +- cmd/wallet-sdk-gomobile/go.sum | 16 +- .../lib/scenarios/handle_openid_vp_flow.dart | 21 ++- internal/testutil/contexts/examples_v2.jsonld | 7 + internal/testutil/document_loader.go | 6 + test/integration/cli/go.mod | 6 +- test/integration/cli/go.sum | 8 +- .../university_degree_v2.json | 104 +++++++++++++ .../fixtures/file-server/ld-contexts.json | 10 ++ .../fixtures/profile/profiles.json | 139 ++++++++++++++++++ test/integration/go.mod | 12 +- test/integration/go.sum | 16 +- test/integration/openid4ci_test.go | 18 +++ test/integration/openid4vp_test.go | 6 + 14 files changed, 347 insertions(+), 34 deletions(-) create mode 100644 internal/testutil/contexts/examples_v2.jsonld create mode 100644 test/integration/expecteddisplaydata/university_degree_v2.json diff --git a/cmd/wallet-sdk-gomobile/go.mod b/cmd/wallet-sdk-gomobile/go.mod index f8a751cbd..03334c809 100644 --- a/cmd/wallet-sdk-gomobile/go.mod +++ b/cmd/wallet-sdk-gomobile/go.mod @@ -5,7 +5,9 @@ module github.com/trustbloc/wallet-sdk/cmd/wallet-sdk-gomobile -go 1.22 +go 1.22.0 + +toolchain go1.23.2 require ( github.com/go-jose/go-jose/v3 v3.0.1 @@ -70,12 +72,12 @@ require ( github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/cmd/wallet-sdk-gomobile/go.sum b/cmd/wallet-sdk-gomobile/go.sum index 97f106a6c..f449a46f6 100644 --- a/cmd/wallet-sdk-gomobile/go.sum +++ b/cmd/wallet-sdk-gomobile/go.sum @@ -178,15 +178,15 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -194,12 +194,12 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= diff --git a/demo/app/lib/scenarios/handle_openid_vp_flow.dart b/demo/app/lib/scenarios/handle_openid_vp_flow.dart index fed7cc45f..9aa6dc08f 100644 --- a/demo/app/lib/scenarios/handle_openid_vp_flow.dart +++ b/demo/app/lib/scenarios/handle_openid_vp_flow.dart @@ -5,6 +5,7 @@ SPDX-License-Identifier: Apache-2.0 */ import 'dart:developer'; +import 'dart:convert'; import 'package:app/wallet_sdk/wallet_sdk.dart'; import 'package:app/views/custom_error.dart'; import 'package:flutter/material.dart'; @@ -51,8 +52,24 @@ void handleOpenIDVpFlow(BuildContext context, String qrCodeURL) async { for (var cred in credentials) { log('multi cred flow $submission and ${credentials.length}'); for (var inputDescriptor in submission.inputDescriptors) { - Map payload = Jwt.parseJwt(cred); - if (inputDescriptor.matchedVCsID.contains(payload['jti'])) { + Map? payload; + try { + payload = Jwt.parseJwt(cred); + } catch (jwtError) { + try { + payload = json.decode(cred) as Map; + } catch (jsonError) { + log('error while parsing cred as json: $jsonError'); + continue; + } + } + var key = payload['jti'] ?? payload['id']; + if (key == null) { + log('no key found in cred payload'); + continue; + } + if (inputDescriptor.matchedVCsID.contains(key)) { + log('matched vc with id $key added to list'); var credentialDisplayData = storedCredentials .where((element) => cred.contains(element.value.rawCredential)) .map((e) => e.value) diff --git a/internal/testutil/contexts/examples_v2.jsonld b/internal/testutil/contexts/examples_v2.jsonld new file mode 100644 index 000000000..035ff6db3 --- /dev/null +++ b/internal/testutil/contexts/examples_v2.jsonld @@ -0,0 +1,7 @@ +{ + "@context": [ + { + "@vocab": "https://www.w3.org/ns/credentials/examples#" + } + ] +} \ No newline at end of file diff --git a/internal/testutil/document_loader.go b/internal/testutil/document_loader.go index 153f0773a..baf8ef80d 100644 --- a/internal/testutil/document_loader.go +++ b/internal/testutil/document_loader.go @@ -23,6 +23,8 @@ var ( credentialExamples []byte //go:embed contexts/examples_v1.jsonld vcExamples []byte + //go:embed contexts/examples_v2.jsonld + vcExamplesV2 []byte //go:embed contexts/odrl.jsonld odrl []byte //go:embed contexts/citizenship_v1.jsonld @@ -62,6 +64,10 @@ func DocumentLoader(t *testing.T, extraContexts ...ldcontext.Document) *lddocloa URL: "https://trustbloc.github.io/context/vc/examples-v1.jsonld", Content: vcExamples, }, + { + URL: "https://www.w3.org/ns/credentials/examples/v2", + Content: vcExamplesV2, + }, { URL: "https://www.w3.org/ns/odrl.jsonld", Content: odrl, diff --git a/test/integration/cli/go.mod b/test/integration/cli/go.mod index b5fccf175..d161a6f79 100644 --- a/test/integration/cli/go.mod +++ b/test/integration/cli/go.mod @@ -4,7 +4,9 @@ module github.com/trustbloc/wallet-sdk/test/integration/helper -go 1.22 +go 1.22.0 + +toolchain go1.23.2 require github.com/trustbloc/wallet-sdk/test/integration v0.0.0-20221207181956-419a3951143f @@ -18,7 +20,7 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect go.uber.org/zap v1.23.0 // indirect - golang.org/x/net v0.26.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.13.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/test/integration/cli/go.sum b/test/integration/cli/go.sum index 964f2c0cf..5bdf944d9 100644 --- a/test/integration/cli/go.sum +++ b/test/integration/cli/go.sum @@ -45,13 +45,13 @@ go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/test/integration/expecteddisplaydata/university_degree_v2.json b/test/integration/expecteddisplaydata/university_degree_v2.json new file mode 100644 index 000000000..8ebb5a957 --- /dev/null +++ b/test/integration/expecteddisplaydata/university_degree_v2.json @@ -0,0 +1,104 @@ +{ + "issuer_display": { + "name": "University Degree Issuer 2.0", + "locale": "en-US" + }, + "credential_displays": [ + { + "overview": { + "name": "University Degree Credential", + "locale": "en-US", + "logo": { + "uri": "https://example.com/public/logo.png", + "alt_text": "a square logo of a degree verification" + }, + "background_color": "#12107c", + "text_color": "#FFFFFF" + }, + "claims": [ + { + "raw_id": "familyName", + "label": "Family Name", + "value_type": "string", + "raw_value": "John Doe", + "locale": "en-US" + }, + { + "raw_id": "givenName", + "label": "Given Name", + "value_type": "string", + "raw_value": "John", + "locale": "en-US" + }, + { + "raw_id": "degree", + "label": "Degree", + "value_type": "string", + "raw_value": "MIT", + "locale": "en-US" + }, + { + "raw_id": "degreeSchool", + "label": "Degree School", + "value_type": "string", + "raw_value": "MIT school", + "locale": "en-US" + }, + { + "raw_id": "photo", + "label": "Photo", + "value_type": "image", + "raw_value": "binary data" + } + ] + }, + { + "overview": { + "name": "University Degree Credential", + "locale": "en-US", + "logo": { + "uri": "https://example.com/public/logo.png", + "alt_text": "a square logo of a degree verification" + }, + "background_color": "#12107c", + "text_color": "#FFFFFF" + }, + "claims": [ + { + "raw_id": "familyName", + "label": "Family Name", + "value_type": "string", + "raw_value": "John Doe", + "locale": "en-US" + }, + { + "raw_id": "givenName", + "label": "Given Name", + "value_type": "string", + "raw_value": "John", + "locale": "en-US" + }, + { + "raw_id": "degree", + "label": "Degree", + "value_type": "string", + "raw_value": "MS", + "locale": "en-US" + }, + { + "raw_id": "degreeSchool", + "label": "Degree School", + "value_type": "string", + "raw_value": "Stanford", + "locale": "en-US" + }, + { + "raw_id": "photo", + "label": "Photo", + "value_type": "image", + "raw_value": "binary data" + } + ] + } + ] +} diff --git a/test/integration/fixtures/file-server/ld-contexts.json b/test/integration/fixtures/file-server/ld-contexts.json index 8400f9d47..45981732a 100644 --- a/test/integration/fixtures/file-server/ld-contexts.json +++ b/test/integration/fixtures/file-server/ld-contexts.json @@ -134,6 +134,16 @@ }] } }, + { + "url": "https://www.w3.org/ns/credentials/examples/v2", + "content" : { + "@context": [ + { + "@vocab": "https://www.w3.org/ns/credentials/examples#" + } + ] + } + }, { "url": "https://www.w3.org/ns/odrl.jsonld", "content": { diff --git a/test/integration/fixtures/profile/profiles.json b/test/integration/fixtures/profile/profiles.json index 550c356a1..a736be0ed 100644 --- a/test/integration/fixtures/profile/profiles.json +++ b/test/integration/fixtures/profile/profiles.json @@ -1006,6 +1006,145 @@ }, "createDID": true }, + { + "issuer": { + "id": "university_degree_issuer_v2", + "version": "v1.0", + "groupID": "group_university_degree_issuer_v2", + "name": "University Degree Issuer 2.0", + "organizationID": "f13d1va9lp403pb9lyj89vk55", + "url": "http://localhost:8075", + "active": true, + "vcConfig": { + "model": "w3c-vc-2.0", + "refreshServiceEnabled": false, + "signingAlgorithm": "JsonWebSignature2020", + "signatureRepresentation": 0, + "keyType": "ED25519", + "format": "ldp", + "didMethod": "ion", + "status": { + "type": "BitstringStatusListEntry" + } + }, + "dataIntegrityProof": { + "enable": true, + "suiteType": "ecdsa-2019" + }, + "oidcConfig": { + "client_id": "7d4u50e7w6nfq8tfayhzplgjf", + "client_secret_handle": "282ks4fkuqfosus5k0x30abnv", + "issuer_well_known": "http://cognito-mock.trustbloc.local:9229/local_5a9GzRvB/.well-known/openid-configuration", + "scopes_supported": [ + "openid", + "profile" + ], + "grant_types_supported": [ + "authorization_code", + "urn:ietf:params:oauth:grant-type:pre-authorized_code" + ], + "response_types_supported": [ + "code" + ], + "token_endpoint_auth_methods_supported": [ + "none" + ], + "pre-authorized_grant_anonymous_access_supported": true + }, + "credentialTemplates": [ + { + "contexts": [ + "https://www.w3.org/ns/credentials/v2", + "https://www.w3.org/ns/credentials/examples/v2" + ], + "type": "UniversityDegreeCredential", + "id": "universityDegreeTemplateID", + "issuer": "did:orb:bank_issuer_v2", + "checks": { + "strict": true + } + } + ], + "credentialMetadata": { + "credential_configurations_supported": { + "UniversityDegreeCredential_ldp_vc_v1": { + "format": "ldp_vc", + "credential_definition": { + "type": [ + "VerifiableCredential", + "UniversityDegreeCredential" + ], + "credentialSubject": { + "familyName": { + "display": [ + { + "name": "Family Name", + "locale": "en-US" + } + ], + "value_type": "string" + }, + "givenName": { + "display": [ + { + "name": "Given Name", + "locale": "en-US" + } + ], + "value_type": "string" + }, + "degree": { + "display": [ + { + "name": "Degree", + "locale": "en-US" + } + ], + "value_type": "string" + }, + "photo": { + "display": [ + { + "name": "Photo" + } + ], + "value_type": "image" + }, + "degreeSchool": { + "display": [ + { + "name": "Degree School", + "locale": "en-US" + } + ], + "value_type": "string" + } + } + }, + "cryptographic_binding_methods_supported": [ + "did" + ], + "credential_signing_alg_values_supported": [ + "Ed25519Signature2018" + ], + "display": [ + { + "name": "University Degree Credential", + "locale": "en-US", + "logo": { + "uri": "https://example.com/public/logo.png", + "alt_text": "a square logo of a degree verification" + }, + "background_color": "#12107c", + "text_color": "#FFFFFF" + } + ] + } + } + } + }, + "createDID": true + }, { "issuer": { "id": "did_ion_issuer", diff --git a/test/integration/go.mod b/test/integration/go.mod index df88e1c68..f118e7136 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -5,7 +5,9 @@ module github.com/trustbloc/wallet-sdk/test/integration -go 1.22 +go 1.22.0 + +toolchain go1.23.2 require ( github.com/google/uuid v1.3.0 @@ -78,11 +80,11 @@ require ( go.opentelemetry.io/otel/trace v1.14.0 // indirect go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.6.0 // indirect - golang.org/x/crypto v0.24.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/net v0.26.0 // indirect - golang.org/x/sys v0.21.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/text v0.19.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/test/integration/go.sum b/test/integration/go.sum index 36ec00c16..015f99a65 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -203,15 +203,15 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI= -golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ= -golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -219,12 +219,12 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= -golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= diff --git a/test/integration/openid4ci_test.go b/test/integration/openid4ci_test.go index 7a9666bbb..e6021d462 100644 --- a/test/integration/openid4ci_test.go +++ b/test/integration/openid4ci_test.go @@ -56,6 +56,9 @@ var ( //go:embed expecteddisplaydata/university_degree_multi.json expectedUniversityDegreeMulti string + + //go:embed expecteddisplaydata/university_degree_v2.json + expectedUniversityDegreeV2 string ) const ( @@ -231,6 +234,21 @@ func doPreAuthCodeFlowTest(t *testing.T) { expectedDisplayData: helpers.ParseDisplayData(t, expectedUniversityDegreeMulti), expectedIssuerURI: "http://localhost:8075/oidc/idp/university_degree_issuer/v1.0", }, + { + issuerProfileID: "university_degree_issuer_v2", + issuerDIDMethod: "ion", + walletDIDMethod: "ion", + claims: []*claimEntry{ + { + Data: universityDegreeClaims, + }, + { + Data: universityDegreeClaims2, + }, + }, + expectedDisplayData: helpers.ParseDisplayData(t, expectedUniversityDegreeV2), + expectedIssuerURI: "http://localhost:8075/oidc/idp/university_degree_issuer_v2/v1.0", + }, } oidc4ciSetup, err := oidc4ci.NewSetup(testenv.NewHttpRequest()) diff --git a/test/integration/openid4vp_test.go b/test/integration/openid4vp_test.go index 9a15f0927..7618cc17b 100644 --- a/test/integration/openid4vp_test.go +++ b/test/integration/openid4vp_test.go @@ -178,6 +178,12 @@ func TestOpenID4VPFullFlow(t *testing.T) { verifierProfileID: "v_myprofile_jwt_verified_employee", acknowledgeNoConsent: true, }, + { + issuerProfileIDs: []string{"university_degree_issuer_v2"}, + claimData: []claimData{universityDegreeClaims}, + walletDIDMethod: "ion", + verifierProfileID: "v_ldp_university_degree", + }, } var traceIDs []string