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

Commit

Permalink
support for JSON-LD in universal wallet implementation (#3346)
Browse files Browse the repository at this point in the history
Signed-off-by: Mykhailo Sizov <[email protected]>

Signed-off-by: Mykhailo Sizov <[email protected]>
  • Loading branch information
mishasizov-SK authored Aug 26, 2022
1 parent 6c0c224 commit a66828f
Show file tree
Hide file tree
Showing 14 changed files with 920 additions and 2 deletions.
2 changes: 2 additions & 0 deletions test/bdd/bddtests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/vdr"
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/verifiable"
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/waci"
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/walletjsonld"
"github.com/hyperledger/aries-framework-go/test/bdd/pkg/webkms"
)

Expand Down Expand Up @@ -217,5 +218,6 @@ func features() []feature {
webkms.NewCryptoSDKSteps(),
waci.NewIssuanceDIDCommV1SDKSteps(),
waci.NewIssuanceDIDCommV2SDKSteps(),
walletjsonld.NewSDKSteps(),
}
}
70 changes: 70 additions & 0 deletions test/bdd/features/wallet_jsonld.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#
# Copyright SecureKey Technologies Inc. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#

@wallet_jsonld
Feature: Support for JSON-LD in universal wallet

Scenario Outline: Issue credentials, add to wallet, query presentation, verify presentation and credentials
Given credentials crypto algorithm "<crypto>"
And "Berkley" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
When "Alice" creates wallet profile
And "Alice" opens wallet
And "Berkley" issues credentials at "2022-04-12" regarding "Master Degree" to "Alice"
Then "Alice" adds credentials to the wallet issued by "Berkley"
When "Vanna" queries credentials issued by "Berkley" using "QueryByExample" query type
Then "Alice" resolves query
And "Alice" adds presentations proof
And "Alice" closes wallet
Then "Vanna" receives presentations signed by "Alice" and verifies it
And "Vanna" receives credentials from presentation signed by "Berkley" and verifies it
Examples:
| crypto |
| "Ed25519" |
| "ECDSA Secp256r1" |
| "ECDSA Secp384r1" |

Scenario Outline: Issue credentials using the wallet, add to wallet, query presentation, verify presentation and credentials
Given credentials crypto algorithm "<crypto>"
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
When "Alice" creates wallet profile
And "Alice" opens wallet
And "Alice" creates credentials at "2022-04-12" regarding "Master Degree" without proof
And "Alice" issues credentials using the wallet
Then "Alice" adds credentials to the wallet issued by "Alice"
When "Vanna" queries credentials issued by "Alice" using "PresentationExchange" query type
And "Alice" resolves query
And "Alice" adds presentations proof
And "Alice" closes wallet
Then "Vanna" receives presentations signed by "Alice" and verifies it
And "Vanna" receives credentials from presentation signed by "Alice" and verifies it
Examples:
| crypto |
| "Ed25519" |
| "ECDSA Secp256r1" |
| "ECDSA Secp384r1" |

Scenario Outline: Issue multiple credentials, add to wallet, query all, verify credentials
Given credentials crypto algorithm "<crypto>"
And "Berkley" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
And "MIT" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
And "Alice" agent is running on "localhost" port "random" with http-binding did resolver url "${SIDETREE_URL}" which accepts did method "sidetree"
When "Alice" creates wallet profile
And "Alice" opens wallet
And "Berkley" issues credentials at "2022-04-12" regarding "Master Degree" to "Alice"
And "MIT" issues credentials at "2022-04-12" regarding "Bachelor Degree" to "Alice"
Then "Alice" adds credentials to the wallet issued by "Berkley"
And "Alice" adds credentials to the wallet issued by "MIT"
When "Vanna" queries all credentials from "Alice"
Then "Vanna" receives "2" credentials
And "Alice" closes wallet
And "Vanna" verifies credentials issued by "Berkley"
And "Vanna" verifies credentials issued by "MIT"
Examples:
| crypto |
| "Ed25519" |
| "ECDSA Secp256r1" |
| "ECDSA Secp384r1" |
4 changes: 2 additions & 2 deletions test/bdd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.3 // indirect
github.com/google/tink/go v1.6.1 // indirect
github.com/hyperledger/aries-framework-go/test/component v0.0.0-20220428211718-66cc046674a1 // indirect
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c // indirect
github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect
github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a // indirect
github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e // indirect
github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69 // indirect
Expand All @@ -74,7 +75,6 @@ require (
github.com/sirupsen/logrus v1.7.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693 // indirect
github.com/stretchr/objx v0.4.0 // indirect
github.com/stretchr/testify v1.7.2 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tidwall/gjson v1.6.7 // indirect
Expand Down
1 change: 1 addition & 0 deletions test/bdd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c h1:8yL/HlgZmfsyXdLJjdE0gBAUjAuW9ZU4I+OiVkil22w=
github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20220606124520-53422361c38c/go.mod h1:JrwivOOQmuXbV1mFWgBGWnfCorOFdfGkpBsYK8dYrfM=
github.com/hyperledger/ursa-wrapper-go v0.3.1 h1:Do+QrVNniY77YK2jTIcyWqj9rm/Yb5SScN0bqCjiibA=
github.com/hyperledger/ursa-wrapper-go v0.3.1/go.mod h1:nPSAuMasIzSVciQo22PedBk4Opph6bJ6ia3ms7BH/mk=
Expand Down
24 changes: 24 additions & 0 deletions test/bdd/pkg/walletjsonld/agent.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/

package walletjsonld

import (
bddagent "github.com/hyperledger/aries-framework-go/test/bdd/agent"
)

func (s *SDKSteps) createAgent(agent, inboundHost, inboundPort, endpointURL, acceptDidMethod string) error {
agentSDK := bddagent.NewSDKSteps()
agentSDK.SetContext(s.bddContext)

return agentSDK.CreateAgentWithHTTPDIDResolver(
agent,
inboundHost,
inboundPort,
endpointURL,
acceptDidMethod,
)
}
Loading

0 comments on commit a66828f

Please sign in to comment.