Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit a66828f

Browse files
support for JSON-LD in universal wallet implementation (#3346)
Signed-off-by: Mykhailo Sizov <mykhailo.sizov@securekey.com> Signed-off-by: Mykhailo Sizov <mykhailo.sizov@securekey.com>
1 parent 6c0c224 commit a66828f

File tree

14 files changed

+920
-2
lines changed

14 files changed

+920
-2
lines changed

test/bdd/bddtests_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/vdr"
3737
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/verifiable"
3838
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/waci"
39+
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/walletjsonld"
3940
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/webkms"
4041
)
4142

@@ -217,5 +218,6 @@ func features() []feature {
217218
webkms.NewCryptoSDKSteps(),
218219
waci.NewIssuanceDIDCommV1SDKSteps(),
219220
waci.NewIssuanceDIDCommV2SDKSteps(),
221+
walletjsonld.NewSDKSteps(),
220222
}
221223
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Copyright SecureKey Technologies Inc. All Rights Reserved.
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
@wallet_jsonld
8+
Feature: Support for JSON-LD in universal wallet
9+
10+
Scenario Outline: Issue credentials, add to wallet, query presentation, verify presentation and credentials
11+
Given credentials crypto algorithm "<crypto>"
12+
And "Berkley" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
13+
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
14+
When "Alice" creates wallet profile
15+
And "Alice" opens wallet
16+
And "Berkley" issues credentials at "2022-04-12" regarding "Master Degree" to "Alice"
17+
Then "Alice" adds credentials to the wallet issued by "Berkley"
18+
When "Vanna" queries credentials issued by "Berkley" using "QueryByExample" query type
19+
Then "Alice" resolves query
20+
And "Alice" adds presentations proof
21+
And "Alice" closes wallet
22+
Then "Vanna" receives presentations signed by "Alice" and verifies it
23+
And "Vanna" receives credentials from presentation signed by "Berkley" and verifies it
24+
Examples:
25+
| crypto |
26+
| "Ed25519" |
27+
| "ECDSA Secp256r1" |
28+
| "ECDSA Secp384r1" |
29+
30+
Scenario Outline: Issue credentials using the wallet, add to wallet, query presentation, verify presentation and credentials
31+
Given credentials crypto algorithm "<crypto>"
32+
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
33+
When "Alice" creates wallet profile
34+
And "Alice" opens wallet
35+
And "Alice" creates credentials at "2022-04-12" regarding "Master Degree" without proof
36+
And "Alice" issues credentials using the wallet
37+
Then "Alice" adds credentials to the wallet issued by "Alice"
38+
When "Vanna" queries credentials issued by "Alice" using "PresentationExchange" query type
39+
And "Alice" resolves query
40+
And "Alice" adds presentations proof
41+
And "Alice" closes wallet
42+
Then "Vanna" receives presentations signed by "Alice" and verifies it
43+
And "Vanna" receives credentials from presentation signed by "Alice" and verifies it
44+
Examples:
45+
| crypto |
46+
| "Ed25519" |
47+
| "ECDSA Secp256r1" |
48+
| "ECDSA Secp384r1" |
49+
50+
Scenario Outline: Issue multiple credentials, add to wallet, query all, verify credentials
51+
Given credentials crypto algorithm "<crypto>"
52+
And "Berkley" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
53+
And "MIT" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
54+
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
55+
When "Alice" creates wallet profile
56+
And "Alice" opens wallet
57+
And "Berkley" issues credentials at "2022-04-12" regarding "Master Degree" to "Alice"
58+
And "MIT" issues credentials at "2022-04-12" regarding "Bachelor Degree" to "Alice"
59+
Then "Alice" adds credentials to the wallet issued by "Berkley"
60+
And "Alice" adds credentials to the wallet issued by "MIT"
61+
When "Vanna" queries all credentials from "Alice"
62+
Then "Vanna" receives "2" credentials
63+
And "Alice" closes wallet
64+
And "Vanna" verifies credentials issued by "Berkley"
65+
And "Vanna" verifies credentials issued by "MIT"
66+
Examples:
67+
| crypto |
68+
| "Ed25519" |
69+
| "ECDSA Secp256r1" |
70+
| "ECDSA Secp384r1" |

test/bdd/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ require (
4848
github.com/golang/protobuf v1.5.2 // indirect
4949
github.com/golang/snappy v0.0.3 // indirect
5050
github.com/google/tink/go v1.6.1 // indirect
51-
github.com/hyperledger/aries-framework-go/test/component v0.0.0-20220428211718-66cc046674a1 // indirect
51+
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c // indirect
52+
github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect
5253
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
5354
github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e // indirect
5455
github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69 // indirect
@@ -74,7 +75,6 @@ require (
7475
github.com/sirupsen/logrus v1.7.0 // indirect
7576
github.com/spaolacci/murmur3 v1.1.0 // indirect
7677
github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693 // indirect
77-
github.com/stretchr/objx v0.4.0 // indirect
7878
github.com/stretchr/testify v1.7.2 // indirect
7979
github.com/syndtr/goleveldb v1.0.0 // indirect
8080
github.com/tidwall/gjson v1.6.7 // indirect

test/bdd/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe
279279
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
280280
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
281281
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
282+
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c h1:8yL/HlgZmfsyXdLJjdE0gBAUjAuW9ZU4I+OiVkil22w=
282283
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c/go.mod h1:JrwivOOQmuXbV1mFWgBGWnfCorOFdfGkpBsYK8dYrfM=
283284
github.com/hyperledger/ursa-wrapper-go v0.3.1 h1:Do+QrVNniY77YK2jTIcyWqj9rm/Yb5SScN0bqCjiibA=
284285
github.com/hyperledger/ursa-wrapper-go v0.3.1/go.mod h1:nPSAuMasIzSVciQo22PedBk4Opph6bJ6ia3ms7BH/mk=

test/bdd/pkg/walletjsonld/agent.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Copyright SecureKey Technologies Inc. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
package walletjsonld
8+
9+
import (
10+
bddagent "github.com/hyperledger/aries-framework-go/test/bdd/agent"
11+
)
12+
13+
func (s *SDKSteps) createAgent(agent, inboundHost, inboundPort, endpointURL, acceptDidMethod string) error {
14+
agentSDK := bddagent.NewSDKSteps()
15+
agentSDK.SetContext(s.bddContext)
16+
17+
return agentSDK.CreateAgentWithHTTPDIDResolver(
18+
agent,
19+
inboundHost,
20+
inboundPort,
21+
endpointURL,
22+
acceptDidMethod,
23+
)
24+
}

0 commit comments

Comments
 (0)