From 7ecb0afeedb7326b43a8d09d6391aa1fd43f508a Mon Sep 17 00:00:00 2001 From: Filip Burlacu Date: Mon, 28 Aug 2023 10:01:41 -0400 Subject: [PATCH] chore: switch to using afgo components instead of afgo pkg where possible (#1385) Signed-off-by: Filip Burlacu --- component/event/bus.go | 2 +- component/event/go.mod | 4 +- component/wallet-cli/go.mod | 6 +- .../wallet-cli/internal/ldutil/ldutil.go | 8 +- .../wallet-cli/internal/vdrutil/vdrutil.go | 29 ++--- .../pkg/walletrunner/aries_services.go | 6 +- .../wallet-cli/pkg/walletrunner/didconfig.go | 10 +- .../wallet-cli/pkg/walletrunner/models.go | 4 +- .../pkg/walletrunner/vcprovider/vcs.go | 4 +- .../wallet-cli/pkg/walletrunner/wallet.go | 5 +- .../pkg/walletrunner/wallet_runner.go | 42 +++---- .../pkg/walletrunner/wallet_runner_oidc4ci.go | 10 +- .../wallet_runner_oidc4ci_pre_auth.go | 2 +- .../pkg/walletrunner/wallet_runner_oidc4vp.go | 14 +-- go.mod | 6 +- pkg/cslmanager/cslmanager.go | 3 +- pkg/cslmanager/cslmanager_test.go | 40 +++--- pkg/doc/vc/crypto/crypto.go | 26 ++-- pkg/doc/vc/crypto/crypto_test.go | 114 +++++++++--------- pkg/doc/vc/crypto/util.go | 4 +- pkg/doc/vc/crypto/util_test.go | 4 +- pkg/doc/vc/jws/signer.go | 2 +- pkg/doc/vc/jws/signer_test.go | 2 +- pkg/doc/vc/signer.go | 5 +- pkg/doc/vc/status.go | 2 +- pkg/doc/vc/statustype/revocationlist2020.go | 6 +- .../vc/statustype/revocationlist2020_test.go | 2 +- pkg/doc/vc/statustype/revocationlist2021.go | 6 +- .../vc/statustype/revocationlist2021_test.go | 2 +- pkg/doc/vc/statustype/statuslist2021.go | 6 +- pkg/doc/vc/statustype/statuslist2021_test.go | 2 +- pkg/doc/vc/validate.go | 6 +- pkg/doc/vc/validate_test.go | 4 +- pkg/doc/vc/vcutil/vcutil.go | 2 +- pkg/doc/vc/vcutil/vcutil_test.go | 2 +- pkg/doc/verifiable/signaturetype.go | 2 +- pkg/doc/verifiable/signaturetype_test.go | 2 +- pkg/doc/vp/validate.go | 3 +- pkg/doc/vp/validate_test.go | 2 +- pkg/event/spi/spi.go | 6 +- pkg/internal/common/diddoc/util.go | 4 +- pkg/internal/common/diddoc/util_test.go | 12 +- pkg/internal/mock/status/status.go | 2 +- pkg/internal/testutil/credential.go | 34 +++--- pkg/internal/testutil/document_loader.go | 8 +- pkg/internal/testutil/jwt.go | 18 +-- pkg/internal/testutil/presentation.go | 18 +-- pkg/kms/arieskms.go | 53 ++++---- pkg/kms/arieskms_test.go | 2 +- pkg/kms/key/creator.go | 10 +- pkg/kms/key/creator_test.go | 6 +- pkg/kms/kms.go | 4 +- pkg/kms/mocks/kms_mocks.go | 4 +- pkg/kms/signer/arieskms_test.go | 6 +- pkg/ld/cached_context_store.go | 6 +- pkg/ld/cached_context_store_test.go | 2 +- pkg/ld/document_loader.go | 10 +- pkg/ld/document_loader_test.go | 6 +- pkg/ld/store_provider.go | 10 +- .../component/credentialstatus_wrapper.go | 2 +- .../issuecredential_wrapper.go | 2 +- .../issuecredential_wrapper_test.go | 2 +- .../wrappers/oidc4vp/oidc4vp_wrapper.go | 2 +- .../wrappers/oidc4vp/oidc4vp_wrapper_test.go | 2 +- .../verifycredential_wrapper.go | 2 +- .../verifycredential_wrapper_test.go | 2 +- .../verifypresentation_wrapper.go | 2 +- .../verifypresentation_wrapper_test.go | 2 +- pkg/profile/api.go | 8 +- pkg/restapi/v1/issuer/controller.go | 15 ++- pkg/restapi/v1/issuer/controller_test.go | 4 +- pkg/restapi/v1/oidc4ci/controller.go | 4 +- .../v1/oidc4ci/controller_e2e_flows_test.go | 4 +- pkg/restapi/v1/oidc4ci/controller_test.go | 4 +- pkg/restapi/v1/verifier/controller.go | 12 +- pkg/restapi/v1/verifier/controller_test.go | 20 +-- .../eventhandler/eventhandler_service.go | 2 +- .../eventhandler/eventhandler_service_test.go | 24 ++-- pkg/service/credentialstatus/types.go | 2 +- .../didconfiguration_service.go | 8 +- .../didconfiguration_service_test.go | 4 +- pkg/service/issuecredential/api.go | 2 +- .../issuecredential_service.go | 2 +- .../issuecredential_service_test.go | 34 +++--- pkg/service/oidc4ci/api.go | 2 +- pkg/service/oidc4ci/oidc4ci_service.go | 4 +- pkg/service/oidc4vp/api.go | 6 +- pkg/service/oidc4vp/claims.go | 2 +- pkg/service/oidc4vp/oidc4vp_service.go | 10 +- pkg/service/oidc4vp/oidc4vp_service_test.go | 37 +++--- pkg/service/oidc4vp/txmanager.go | 4 +- pkg/service/oidc4vp/txmanager_test.go | 4 +- pkg/service/verifycredential/api.go | 2 +- pkg/service/verifycredential/linkeddomain.go | 2 +- .../verifycredential/linkeddomain_test.go | 26 ++-- .../verifycredential_service.go | 4 +- .../verifycredential_service_test.go | 8 +- pkg/service/verifypresentation/api.go | 2 +- .../verifypresentation_service.go | 11 +- .../verifypresentation_service_test.go | 16 +-- .../cslindexstore/csl_index_store_test.go | 2 +- .../mongodb/cslvcstore/csl_vc_store_test.go | 2 +- pkg/storage/mongodb/ldstore/context_store.go | 6 +- .../mongodb/ldstore/context_store_test.go | 4 +- .../mongodb/ldstore/remote_provider_store.go | 18 +-- .../oidc4vptxstore/oidc4vp_tx_store.go | 2 +- .../oidc4vptxstore/oidc4vp_tx_store_test.go | 2 +- .../mongodb/vcstatusstore/vc_status_store.go | 2 +- .../vcstatusstore/vc_status_store_test.go | 2 +- pkg/storage/redis/oidc4vptxstore/doc.go | 2 +- .../redis/oidc4vptxstore/oidc4vp_tx_store.go | 2 +- .../oidc4vptxstore/oidc4vp_tx_store_test.go | 2 +- .../s3/cslvcstore/csl_vc_store_test.go | 2 +- test/bdd/go.mod | 6 +- test/bdd/pkg/bddutil/util.go | 22 ++-- test/bdd/pkg/bddutil/vdrutil/vdrutil.go | 12 +- test/bdd/pkg/context/context.go | 6 +- test/bdd/pkg/v1/oidc4vc/oidc4ci.go | 2 +- test/bdd/pkg/v1/oidc4vc/oidc4vp.go | 4 +- test/bdd/pkg/v1/oidc4vc/steps.go | 4 +- test/bdd/pkg/v1/oidc4vp/oidc4vp.go | 2 +- test/bdd/pkg/v1/vc/credential.go | 2 +- test/stress/go.mod | 4 +- test/stress/pkg/stress/stress_test_case.go | 2 +- 124 files changed, 522 insertions(+), 521 deletions(-) diff --git a/component/event/bus.go b/component/event/bus.go index 62b5e598a..07c8b8b4a 100644 --- a/component/event/bus.go +++ b/component/event/bus.go @@ -11,7 +11,7 @@ import ( "crypto/tls" "sync" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/piprate/json-gold/ld" "github.com/spf13/cobra" "github.com/trustbloc/logutil-go/pkg/log" diff --git a/component/event/go.mod b/component/event/go.mod index 20973c958..36472ce71 100644 --- a/component/event/go.mod +++ b/component/event/go.mod @@ -6,7 +6,7 @@ module github.com/trustbloc/vcs/component/event go 1.21 require ( - github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 + github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f github.com/samber/lo v1.38.1 github.com/spf13/cobra v1.7.0 @@ -68,12 +68,12 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect + github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 // indirect github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20220728172020-0a8903e45149 // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v1.0.0-rc5.0.20221201213446-c4c1e76daa49 // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree v1.0.0-rc3.0.20221104150937-07bfbe450122 // indirect github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 // indirect - github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 // indirect github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20230427134832-0c9969493bd3 // indirect github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 // indirect github.com/hyperledger/aries-framework-go/spi v0.0.0-20230517133327-301aa0597250 // indirect diff --git a/component/wallet-cli/go.mod b/component/wallet-cli/go.mod index 43da21b77..7cda5859f 100644 --- a/component/wallet-cli/go.mod +++ b/component/wallet-cli/go.mod @@ -16,9 +16,12 @@ require ( github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk v0.0.0-20221213152252-f0c83a5a922c github.com/hyperledger/aries-framework-go-ext/component/vdr/longform v0.0.0-20221201213446-c4c1e76daa49 github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v1.0.0-rc5.0.20221201213446-c4c1e76daa49 + github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 + github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 github.com/hyperledger/aries-framework-go/component/storage/leveldb v0.0.0-20221202141134-083803ecf0a3 github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20230427134832-0c9969493bd3 + github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 github.com/hyperledger/aries-framework-go/spi v0.0.0-20230517133327-301aa0597250 github.com/makiuchi-d/gozxing v0.1.1 github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f @@ -85,11 +88,8 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree v1.0.0-rc3.0.20221104150937-07bfbe450122 // indirect - github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 // indirect - github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 // indirect github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20221025204933-b807371b6f1e // indirect - github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 // indirect github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/component/wallet-cli/internal/ldutil/ldutil.go b/component/wallet-cli/internal/ldutil/ldutil.go index c9d457718..118796b5d 100644 --- a/component/wallet-cli/internal/ldutil/ldutil.go +++ b/component/wallet-cli/internal/ldutil/ldutil.go @@ -10,10 +10,10 @@ import ( _ "embed" "fmt" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + ld "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - ldstore "github.com/hyperledger/aries-framework-go/pkg/store/ld" ) // nolint:gochecknoglobals //embedded test contexts @@ -41,7 +41,7 @@ var extraContexts = []ldcontext.Document{ //nolint:gochecknoglobals }, { URL: "https://w3id.org/citizenship/v1", - DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", //resolvable + DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", // resolvable Content: citizenshipVocab, }, { diff --git a/component/wallet-cli/internal/vdrutil/vdrutil.go b/component/wallet-cli/internal/vdrutil/vdrutil.go index 6bb56655c..ffa09107b 100644 --- a/component/wallet-cli/internal/vdrutil/vdrutil.go +++ b/component/wallet-cli/internal/vdrutil/vdrutil.go @@ -13,10 +13,11 @@ import ( "github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk" "github.com/hyperledger/aries-framework-go-ext/component/vdr/longform" "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - "github.com/hyperledger/aries-framework-go/pkg/kms" - didkey "github.com/hyperledger/aries-framework-go/pkg/vdr/key" + "github.com/hyperledger/aries-framework-go/component/models/did" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + didkey "github.com/hyperledger/aries-framework-go/component/vdr/key" + "github.com/hyperledger/aries-framework-go/spi/kms" + "github.com/trustbloc/vcs/pkg/doc/vc/crypto" "github.com/trustbloc/vcs/pkg/kms/key" ) @@ -39,7 +40,7 @@ type VDRUtil struct { func (v *VDRUtil) Create( didMethod string, keyType kms.KeyType, - registry vdr.Registry, + registry vdrapi.Registry, keyManager keyManager, ) (*CreateResult, error) { switch strings.ToLower(didMethod) { @@ -56,7 +57,7 @@ func (v *VDRUtil) Create( } } -func (v *VDRUtil) CreateKey(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager) (*CreateResult, error) { //nolint: unparam +func (v *VDRUtil) CreateKey(keyType kms.KeyType, registry vdrapi.Registry, keyManager keyManager) (*CreateResult, error) { //nolint: unparam verMethod, err := v.newVerMethods(1, keyManager, keyType) if err != nil { return nil, fmt.Errorf("did:key: failed to create new ver method: %w", err) @@ -79,7 +80,7 @@ func (v *VDRUtil) CreateKey(keyType kms.KeyType, registry vdr.Registry, keyManag }, nil } -func (v *VDRUtil) CreateJWK(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager) (*CreateResult, error) { //nolint: unparam +func (v *VDRUtil) CreateJWK(keyType kms.KeyType, registry vdrapi.Registry, keyManager keyManager) (*CreateResult, error) { //nolint: unparam verMethod, err := v.newVerMethods(1, keyManager, keyType) if err != nil { return nil, fmt.Errorf("did:key: failed to create new ver method: %w", err) @@ -102,7 +103,7 @@ func (v *VDRUtil) CreateJWK(keyType kms.KeyType, registry vdr.Registry, keyManag }, nil } -func (v *VDRUtil) createION(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager) (*CreateResult, error) { +func (v *VDRUtil) createION(keyType kms.KeyType, registry vdrapi.Registry, keyManager keyManager) (*CreateResult, error) { verMethod, err := v.newVerMethods(1, keyManager, keyType) if err != nil { return nil, fmt.Errorf("did:ion failed to create new ver method: %w", err) @@ -140,9 +141,9 @@ func (v *VDRUtil) createION(keyType kms.KeyType, registry vdr.Registry, keyManag didResolution, err := registry.Create( "ion", didDoc, - vdr.WithOption(orb.UpdatePublicKeyOpt, updateKey), - vdr.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), - vdr.WithOption(longform.VDRAcceptOpt, "long-form"), + vdrapi.WithOption(orb.UpdatePublicKeyOpt, updateKey), + vdrapi.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), + vdrapi.WithOption(longform.VDRAcceptOpt, "long-form"), ) if err != nil { return nil, fmt.Errorf("did:ion failed to create long form did: %w", err) @@ -154,7 +155,7 @@ func (v *VDRUtil) createION(keyType kms.KeyType, registry vdr.Registry, keyManag }, nil } -func (v *VDRUtil) createORB(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager) (*CreateResult, error) { +func (v *VDRUtil) createORB(keyType kms.KeyType, registry vdrapi.Registry, keyManager keyManager) (*CreateResult, error) { methods, err := v.newVerMethods(3, keyManager, keyType) // nolint:gomnd if err != nil { return nil, fmt.Errorf("did:orb: failed to create verification methods: %w", err) @@ -205,8 +206,8 @@ func (v *VDRUtil) createORB(keyType kms.KeyType, registry vdr.Registry, keyManag didResolution, err := registry.Create( orb.DIDMethod, doc, - vdr.WithOption(orb.UpdatePublicKeyOpt, updateKey), - vdr.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), + vdrapi.WithOption(orb.UpdatePublicKeyOpt, updateKey), + vdrapi.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), ) if err != nil { diff --git a/component/wallet-cli/pkg/walletrunner/aries_services.go b/component/wallet-cli/pkg/walletrunner/aries_services.go index f68252d09..bd8178bdb 100644 --- a/component/wallet-cli/pkg/walletrunner/aries_services.go +++ b/component/wallet-cli/pkg/walletrunner/aries_services.go @@ -9,9 +9,9 @@ package walletrunner import ( "fmt" - "github.com/hyperledger/aries-framework-go/pkg/crypto" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - "github.com/hyperledger/aries-framework-go/pkg/kms" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/hyperledger/aries-framework-go/spi/storage" jsonld "github.com/piprate/json-gold/ld" ) diff --git a/component/wallet-cli/pkg/walletrunner/didconfig.go b/component/wallet-cli/pkg/walletrunner/didconfig.go index ab4cbedcd..53a2e7112 100644 --- a/component/wallet-cli/pkg/walletrunner/didconfig.go +++ b/component/wallet-cli/pkg/walletrunner/didconfig.go @@ -11,7 +11,7 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/client/didconfig" + didconfigclient "github.com/hyperledger/aries-framework-go/component/didconfig/client" ) const ( @@ -45,10 +45,10 @@ func (s *Service) runLinkedDomainVerification(didID string) error { return err } - didConfigurationClient := didconfig.New( - didconfig.WithJSONLDDocumentLoader(s.ariesServices.documentLoader), - didconfig.WithVDRegistry(s.ariesServices.vdrRegistry), - didconfig.WithHTTPClient(s.httpClient), + didConfigurationClient := didconfigclient.New( + didconfigclient.WithJSONLDDocumentLoader(s.ariesServices.documentLoader), + didconfigclient.WithVDRegistry(s.ariesServices.vdrRegistry), + didconfigclient.WithHTTPClient(s.httpClient), ) if err = didConfigurationClient.VerifyDIDAndDomain(didID, diff --git a/component/wallet-cli/pkg/walletrunner/models.go b/component/wallet-cli/pkg/walletrunner/models.go index 2c513c86f..1e8d9d27c 100644 --- a/component/wallet-cli/pkg/walletrunner/models.go +++ b/component/wallet-cli/pkg/walletrunner/models.go @@ -7,8 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package walletrunner import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" verifiable2 "github.com/trustbloc/vcs/pkg/doc/verifiable" ) diff --git a/component/wallet-cli/pkg/walletrunner/vcprovider/vcs.go b/component/wallet-cli/pkg/walletrunner/vcprovider/vcs.go index 87b417877..edbe91f9a 100644 --- a/component/wallet-cli/pkg/walletrunner/vcprovider/vcs.go +++ b/component/wallet-cli/pkg/walletrunner/vcprovider/vcs.go @@ -18,8 +18,8 @@ import ( "path/filepath" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/component/wallet-cli/internal/httputil" "github.com/trustbloc/vcs/component/wallet-cli/internal/ldutil" diff --git a/component/wallet-cli/pkg/walletrunner/wallet.go b/component/wallet-cli/pkg/walletrunner/wallet.go index 3a53622a8..b8c71ad41 100644 --- a/component/wallet-cli/pkg/walletrunner/wallet.go +++ b/component/wallet-cli/pkg/walletrunner/wallet.go @@ -13,12 +13,11 @@ import ( "time" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/kms" "github.com/hyperledger/aries-framework-go/pkg/wallet" - - vcs "github.com/trustbloc/vcs/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/component/wallet-cli/internal/vdrutil" + vcs "github.com/trustbloc/vcs/pkg/doc/verifiable" ) const ( diff --git a/component/wallet-cli/pkg/walletrunner/wallet_runner.go b/component/wallet-cli/pkg/walletrunner/wallet_runner.go index d56f81cdc..eb7a85dcb 100644 --- a/component/wallet-cli/pkg/walletrunner/wallet_runner.go +++ b/component/wallet-cli/pkg/walletrunner/wallet_runner.go @@ -15,30 +15,30 @@ import ( "strings" "time" - "github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk" - "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext/remote" - "github.com/henvic/httpretty" "github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb" + "github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk" "github.com/hyperledger/aries-framework-go-ext/component/vdr/longform" + "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + "github.com/hyperledger/aries-framework-go/component/models/ld/context/remote" + ld "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/hyperledger/aries-framework-go/component/storage/leveldb" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - "github.com/hyperledger/aries-framework-go/pkg/secretlock" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/noop" - "github.com/hyperledger/aries-framework-go/pkg/vdr" - "github.com/hyperledger/aries-framework-go/pkg/vdr/httpbinding" - "github.com/hyperledger/aries-framework-go/pkg/vdr/key" - "github.com/hyperledger/aries-framework-go/pkg/vdr/web" + "github.com/hyperledger/aries-framework-go/component/vdr" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + "github.com/hyperledger/aries-framework-go/component/vdr/httpbinding" + "github.com/hyperledger/aries-framework-go/component/vdr/key" + "github.com/hyperledger/aries-framework-go/component/vdr/web" "github.com/hyperledger/aries-framework-go/pkg/wallet" + kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" + "github.com/hyperledger/aries-framework-go/spi/secretlock" "github.com/hyperledger/aries-framework-go/spi/storage" jsonld "github.com/piprate/json-gold/ld" "golang.org/x/oauth2" @@ -76,7 +76,7 @@ var extraContexts = []ldcontext.Document{ //nolint:gochecknoglobals }, { URL: "https://w3id.org/citizenship/v1", - DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", //resolvable + DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", // resolvable Content: citizenshipVocab, }, { @@ -270,7 +270,7 @@ func createLDStore(storageProvider storage.Provider) (*ldStoreProvider, error) { func createJSONLDDocumentLoader(ldStore *ldStoreProvider, tlsConfig *tls.Config, providerURLs []string, contextEnableRemote bool) (jsonld.DocumentLoader, error) { - loaderOpts := []ld.DocumentLoaderOpts{ld.WithExtraContexts(extraContexts...)} + loaderOpts := []ld.Opts{ld.WithExtraContexts(extraContexts...)} httpClient := &http.Client{ Transport: &http.Transport{ @@ -362,11 +362,11 @@ func createVDR(vcProviderConf *vcprovider.Config) (vdrapi.Registry, error) { } type kmsProvider struct { - store kms.Store + store kmsapi.Store secretLockService secretlock.Service } -func (k kmsProvider) StorageProvider() kms.Store { +func (k kmsProvider) StorageProvider() kmsapi.Store { return k.store } diff --git a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci.go b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci.go index a9a5eab96..5a2ab1905 100644 --- a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci.go +++ b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci.go @@ -23,10 +23,10 @@ import ( "github.com/cli/browser" "github.com/google/uuid" "github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - didkey "github.com/hyperledger/aries-framework-go/pkg/vdr/key" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + didkey "github.com/hyperledger/aries-framework-go/component/vdr/key" "github.com/hyperledger/aries-framework-go/pkg/wallet" "github.com/samber/lo" "golang.org/x/oauth2" @@ -460,7 +460,7 @@ func (s *Service) getAuthCode( config *OIDC4CIConfig, authCodeURL string, ) (string, error) { - //var loginURL, consentURL *url.URL + // var loginURL, consentURL *url.URL var authCode string httpClient := &http.Client{ diff --git a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci_pre_auth.go b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci_pre_auth.go index 75347fa54..2e8e74a0f 100644 --- a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci_pre_auth.go +++ b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4ci_pre_auth.go @@ -18,7 +18,7 @@ import ( "os" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/hyperledger/aries-framework-go/pkg/wallet" "github.com/samber/lo" "golang.org/x/oauth2" diff --git a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4vp.go b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4vp.go index 1a381d3dc..6aa755eae 100644 --- a/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4vp.go +++ b/component/wallet-cli/pkg/walletrunner/wallet_runner_oidc4vp.go @@ -22,14 +22,14 @@ import ( "github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk" "github.com/valyala/fastjson" - "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - didkey "github.com/hyperledger/aries-framework-go/pkg/vdr/key" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + didkey "github.com/hyperledger/aries-framework-go/component/vdr/key" "github.com/hyperledger/aries-framework-go/pkg/wallet" + "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/component/wallet-cli/internal/httputil" "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/go.mod b/go.mod index 9a5a30a9b..79ead19d3 100644 --- a/go.mod +++ b/go.mod @@ -24,8 +24,11 @@ require ( github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20220728172020-0a8903e45149 github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v1.0.0-rc5.0.20221201213446-c4c1e76daa49 + github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 + github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20230427134832-0c9969493bd3 + github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 github.com/hyperledger/aries-framework-go/spi v0.0.0-20230517133327-301aa0597250 github.com/jinzhu/copier v0.3.5 github.com/klauspost/compress v1.15.9 @@ -124,10 +127,7 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/sidetree v1.0.0-rc3.0.20221104150937-07bfbe450122 // indirect - github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 // indirect - github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 // indirect - github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 // indirect github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect github.com/imdario/mergo v0.3.13 // indirect diff --git a/pkg/cslmanager/cslmanager.go b/pkg/cslmanager/cslmanager.go index 9f7f06a3b..530a038d6 100644 --- a/pkg/cslmanager/cslmanager.go +++ b/pkg/cslmanager/cslmanager.go @@ -17,12 +17,11 @@ import ( "sync" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/logutil-go/pkg/log" "github.com/trustbloc/vcs/internal/logfields" "github.com/trustbloc/vcs/pkg/doc/vc" - vccrypto "github.com/trustbloc/vcs/pkg/doc/vc/crypto" "github.com/trustbloc/vcs/pkg/doc/vc/statustype" vcskms "github.com/trustbloc/vcs/pkg/kms" diff --git a/pkg/cslmanager/cslmanager_test.go b/pkg/cslmanager/cslmanager_test.go index 233313eb1..cc19b67d5 100644 --- a/pkg/cslmanager/cslmanager_test.go +++ b/pkg/cslmanager/cslmanager_test.go @@ -24,15 +24,15 @@ import ( "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/pkg/common/model" - ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - cryptomock "github.com/hyperledger/aries-framework-go/pkg/mock/crypto" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + cryptomock "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/models/did" + model "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + ariescrypto "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" @@ -78,7 +78,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ExternalURL: "https://localhost:8080", Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -129,7 +129,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ExternalURL: "https://localhost:8080", Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -160,7 +160,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ExternalURL: "https://localhost:8080", Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -182,7 +182,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { VCStatusStore: nil, ListSize: 1, KMSRegistry: mockKMSRegistry, - Crypto: vccrypto.New(&vdrmock.MockVDRegistry{}, + Crypto: vccrypto.New(&vdrmock.VDRegistry{}, loader), }) require.NoError(t, err) @@ -205,7 +205,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { VCStatusStore: newMockVCStatusStore(), ListSize: 1, KMSRegistry: mockKMSRegistry, - Crypto: vccrypto.New(&vdrmock.MockVDRegistry{}, + Crypto: vccrypto.New(&vdrmock.VDRegistry{}, loader), }) require.NoError(t, err) @@ -260,7 +260,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ExternalURL: "https://localhost:8080", Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -283,7 +283,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { ListSize: 0, KMSRegistry: mockKMSRegistry, Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -332,7 +332,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ExternalURL: "https://localhost:8080", Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -356,7 +356,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ListSize: 1, Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -380,7 +380,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { KMSRegistry: mockKMSRegistry, ListSize: 1, Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) @@ -405,7 +405,7 @@ func TestCredentialStatusList_CreateCSLEntry(t *testing.T) { ListSize: 2, KMSRegistry: mockKMSRegistry, Crypto: vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc()}, loader), + &vdrmock.VDRegistry{ResolveValue: createDIDDoc()}, loader), }) require.NoError(t, err) diff --git a/pkg/doc/vc/crypto/crypto.go b/pkg/doc/vc/crypto/crypto.go index 45177ff7f..cd5a7fb1a 100644 --- a/pkg/doc/vc/crypto/crypto.go +++ b/pkg/doc/vc/crypto/crypto.go @@ -13,17 +13,17 @@ import ( "github.com/piprate/json-gold/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld" - ariessigner "github.com/hyperledger/aries-framework-go/pkg/doc/signature/signer" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/bbsblssignature2020" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/ecdsasecp256k1signature2019" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/ed25519signature2018" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/ed25519signature2020" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/jsonwebsignature2020" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" + "github.com/hyperledger/aries-framework-go/component/models/did" + ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" + ariessigner "github.com/hyperledger/aries-framework-go/component/models/signature/signer" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/bbsblssignature2020" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/ecdsasecp256k1signature2019" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/ed25519signature2018" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/ed25519signature2020" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/jsonwebsignature2020" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/jws" @@ -188,7 +188,7 @@ func (c *Crypto) signCredentialLDP( return nil, err } - err = vc.AddLinkedDataProof(signingCtx, jsonld.WithDocumentLoader(c.documentLoader)) + err = vc.AddLinkedDataProof(signingCtx, ldprocessor.WithDocumentLoader(c.documentLoader)) if err != nil { return nil, fmt.Errorf("failed to sign vc: %w", err) } @@ -320,7 +320,7 @@ func (c *Crypto) SignPresentation(signerData *vc.Signer, vp *verifiable.Presenta signingCtx.Purpose = Authentication } - err = vp.AddLinkedDataProof(signingCtx, jsonld.WithDocumentLoader(c.documentLoader)) + err = vp.AddLinkedDataProof(signingCtx, ldprocessor.WithDocumentLoader(c.documentLoader)) if err != nil { return nil, fmt.Errorf("failed to sign vc: %w", err) } diff --git a/pkg/doc/vc/crypto/crypto_test.go b/pkg/doc/vc/crypto/crypto_test.go index 39115f74c..e24791d9f 100644 --- a/pkg/doc/vc/crypto/crypto_test.go +++ b/pkg/doc/vc/crypto/crypto_test.go @@ -16,21 +16,21 @@ import ( "testing" "time" - "github.com/hyperledger/aries-framework-go/pkg/common/model" - ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/sdjwt/common" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - cryptomock "github.com/hyperledger/aries-framework-go/pkg/mock/crypto" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - ariesmockstorage "github.com/hyperledger/aries-framework-go/pkg/mock/storage" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + cryptomock "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" + "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + ariesmockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + ariescrypto "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/require" "github.com/trustbloc/vcs/pkg/doc/vc" @@ -48,7 +48,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("test success", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -160,7 +160,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit tc := test t.Run(tc.name, func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -210,7 +210,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("test error from creator", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) p := getTestLDPSigner() @@ -224,7 +224,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("test error from sign credential", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) signedVC, err := c.signCredentialLDP( @@ -245,7 +245,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("sign vc - invalid proof purpose", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) p := getTestLDPSigner() @@ -259,7 +259,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("sign vc - capability invocation proof purpose", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) p := getTestLDPSigner() @@ -272,7 +272,7 @@ func TestCrypto_SignCredentialLDP(t *testing.T) { //nolint:gocognit t.Run("sign vc - capability delegation proof purpose", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t)) p := getTestLDPSigner() @@ -300,7 +300,7 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { }, }, }, - Issued: &util.TimeWrapper{ + Issued: &utiltime.TimeWrapper{ Time: time.Now(), }, Issuer: verifiable.Issuer{ @@ -326,7 +326,7 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { }) type fields struct { - getVDR func() vdr.Registry + getVDR func() vdrapi.Registry } type args struct { signerData *vc.Signer @@ -342,8 +342,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "OK empty options", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -358,8 +358,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "OK with options", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -378,8 +378,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "OK with options SD-JWT", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -398,8 +398,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "SD JWT signing error", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -415,8 +415,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "Error GetDIDDocFromVerificationMethod", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveErr: errors.New("some error")} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveErr: errors.New("some error")} }, }, args: args{ @@ -431,8 +431,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "Error proof purpose not supported", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -449,10 +449,10 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "Error unable to find matching key ID from DID", fields: fields{ - getVDR: func() vdr.Registry { + getVDR: func() vdrapi.Registry { doc := createDIDDoc(didID) doc.AssertionMethod[0].VerificationMethod.ID = "" - return &vdrmock.MockVDRegistry{ResolveValue: doc} + return &vdrmock.VDRegistry{ResolveValue: doc} }, }, args: args{ @@ -467,8 +467,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "Error empty VC subject", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -485,8 +485,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "Error kms:unsupported key type", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -512,8 +512,8 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { { name: "JWS signing error", fields: fields{ - getVDR: func() vdr.Registry { - return &vdrmock.MockVDRegistry{ResolveValue: didDoc} + getVDR: func() vdrapi.Registry { + return &vdrmock.VDRegistry{ResolveValue: didDoc} }, }, args: args{ @@ -554,7 +554,7 @@ func TestCrypto_SignCredentialJWT(t *testing.T) { func TestCrypto_SignCredentialBBS(t *testing.T) { t.Run("test success", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -577,7 +577,7 @@ func TestCrypto_SignCredentialBBS(t *testing.T) { func TestSignPresentation(t *testing.T) { t.Run("sign presentation - success", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -590,7 +590,7 @@ func TestSignPresentation(t *testing.T) { t.Run("sign presentation - signature type opts", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -604,7 +604,7 @@ func TestSignPresentation(t *testing.T) { t.Run("sign presentation - fail", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -619,7 +619,7 @@ func TestSignPresentation(t *testing.T) { t.Run("sign presentation - unresolved did", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: nil}, + &vdrmock.VDRegistry{ResolveValue: nil}, nil, ) @@ -636,7 +636,7 @@ func TestSignPresentation(t *testing.T) { func TestSignCredential(t *testing.T) { t.Run("sign credential LDP - success", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -651,7 +651,7 @@ func TestSignCredential(t *testing.T) { }) t.Run("sign credential LDP - error", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: nil}, + &vdrmock.VDRegistry{ResolveValue: nil}, testutil.DocumentLoader(t), ) @@ -665,7 +665,7 @@ func TestSignCredential(t *testing.T) { }) t.Run("sign credential - error undefined format", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: nil}, + &vdrmock.VDRegistry{ResolveValue: nil}, testutil.DocumentLoader(t), ) @@ -689,14 +689,14 @@ func TestSignCredential(t *testing.T) { }) t.Run("sign credential JWT - success", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) unsignedVC := &verifiable.Credential{ ID: "http://example.edu/credentials/1872", Subject: "did:example:76e12ec712ebc6f1c221ebfeb1f", - Issued: &util.TimeWrapper{ + Issued: &utiltime.TimeWrapper{ Time: time.Now(), }, Issuer: verifiable.Issuer{ @@ -723,7 +723,7 @@ func TestSignCredential(t *testing.T) { }) t.Run("sign credential JWT - error", func(t *testing.T) { c := New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:trustbloc:abc")}, testutil.DocumentLoader(t), ) @@ -733,7 +733,7 @@ func TestSignCredential(t *testing.T) { Issuer: verifiable.Issuer{ ID: "did:example:76e12ec712ebc6f1c221ebfeb1f", }, - Issued: &util.TimeWrapper{ + Issued: &utiltime.TimeWrapper{ Time: time.Now(), }, } @@ -837,7 +837,7 @@ func createDIDDoc(didID string, opts ...opt) *did.Doc { service := did.Service{ ID: "did:example:123456789abcdefghi#did-communication", Type: "did-communication", - ServiceEndpoint: model.NewDIDCommV1Endpoint("https://agent.example.com/"), + ServiceEndpoint: endpoint.NewDIDCommV1Endpoint("https://agent.example.com/"), RecipientKeys: []string{creator}, Priority: 0, } diff --git a/pkg/doc/vc/crypto/util.go b/pkg/doc/vc/crypto/util.go index ff16acf85..ea6ace7a8 100644 --- a/pkg/doc/vc/crypto/util.go +++ b/pkg/doc/vc/crypto/util.go @@ -10,8 +10,8 @@ import ( "errors" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" ) const ( diff --git a/pkg/doc/vc/crypto/util_test.go b/pkg/doc/vc/crypto/util_test.go index 192c41fc8..675ab6999 100644 --- a/pkg/doc/vc/crypto/util_test.go +++ b/pkg/doc/vc/crypto/util_test.go @@ -9,8 +9,8 @@ package crypto import ( "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" ) func TestGetVerificationMethodFromProof(t *testing.T) { diff --git a/pkg/doc/vc/jws/signer.go b/pkg/doc/vc/jws/signer.go index bd1e0a778..2ef4eb29e 100644 --- a/pkg/doc/vc/jws/signer.go +++ b/pkg/doc/vc/jws/signer.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package jws import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" ) type signer interface { diff --git a/pkg/doc/vc/jws/signer_test.go b/pkg/doc/vc/jws/signer_test.go index 4c197ccc5..b589e17ee 100644 --- a/pkg/doc/vc/jws/signer_test.go +++ b/pkg/doc/vc/jws/signer_test.go @@ -10,7 +10,7 @@ import ( "reflect" "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" ) func TestNewSigner(t *testing.T) { diff --git a/pkg/doc/vc/signer.go b/pkg/doc/vc/signer.go index 46535c77f..d0166cf9f 100644 --- a/pkg/doc/vc/signer.go +++ b/pkg/doc/vc/signer.go @@ -7,8 +7,9 @@ SPDX-License-Identifier: Apache-2.0 package vc import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + "github.com/hyperledger/aries-framework-go/spi/kms" + vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" ) diff --git a/pkg/doc/vc/status.go b/pkg/doc/vc/status.go index 279dd63dc..2d6e3c206 100644 --- a/pkg/doc/vc/status.go +++ b/pkg/doc/vc/status.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package vc import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" ) // StatusType is used to define implementation of VC status list. diff --git a/pkg/doc/vc/statustype/revocationlist2020.go b/pkg/doc/vc/statustype/revocationlist2020.go index af0f0b274..2f6b9ca52 100644 --- a/pkg/doc/vc/statustype/revocationlist2020.go +++ b/pkg/doc/vc/statustype/revocationlist2020.go @@ -12,8 +12,8 @@ import ( "time" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" @@ -113,7 +113,7 @@ func (s *revocationList2020Processor) CreateVC(vcID string, listSize int, //noli credential.ID = vcID credential.Types = []string{vcType, revocationList2020VCType} credential.Issuer = verifiable.Issuer{ID: profile.DID} - credential.Issued = util.NewTime(time.Now().UTC()) + credential.Issued = utiltime.NewTime(time.Now().UTC()) size := listSize diff --git a/pkg/doc/vc/statustype/revocationlist2020_test.go b/pkg/doc/vc/statustype/revocationlist2020_test.go index 02437ea6b..9679af68f 100644 --- a/pkg/doc/vc/statustype/revocationlist2020_test.go +++ b/pkg/doc/vc/statustype/revocationlist2020_test.go @@ -9,7 +9,7 @@ package statustype import ( "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/pkg/doc/vc/statustype/revocationlist2021.go b/pkg/doc/vc/statustype/revocationlist2021.go index 37aa92260..f24e8d886 100644 --- a/pkg/doc/vc/statustype/revocationlist2021.go +++ b/pkg/doc/vc/statustype/revocationlist2021.go @@ -12,8 +12,8 @@ import ( "time" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" @@ -117,7 +117,7 @@ func (s *revocationList2021Processor) CreateVC(vcID string, listSize int, //noli credential.ID = vcID credential.Types = []string{vcType, statusList2021VCType} credential.Issuer = verifiable.Issuer{ID: profile.DID} - credential.Issued = util.NewTime(time.Now().UTC()) + credential.Issued = utiltime.NewTime(time.Now().UTC()) size := listSize diff --git a/pkg/doc/vc/statustype/revocationlist2021_test.go b/pkg/doc/vc/statustype/revocationlist2021_test.go index dca9cd761..a3f619373 100644 --- a/pkg/doc/vc/statustype/revocationlist2021_test.go +++ b/pkg/doc/vc/statustype/revocationlist2021_test.go @@ -9,7 +9,7 @@ package statustype import ( "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/pkg/doc/vc/statustype/statuslist2021.go b/pkg/doc/vc/statustype/statuslist2021.go index 56e5574a8..f80db0bb1 100644 --- a/pkg/doc/vc/statustype/statuslist2021.go +++ b/pkg/doc/vc/statustype/statuslist2021.go @@ -12,8 +12,8 @@ import ( "time" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" @@ -126,7 +126,7 @@ func (s *statusList2021Processor) CreateVC(vcID string, listSize int, credential.ID = vcID credential.Types = []string{vcType, statusList2021VCType} credential.Issuer = verifiable.Issuer{ID: profile.DID} - credential.Issued = util.NewTime(time.Now().UTC()) + credential.Issued = utiltime.NewTime(time.Now().UTC()) size := listSize diff --git a/pkg/doc/vc/statustype/statuslist2021_test.go b/pkg/doc/vc/statustype/statuslist2021_test.go index fd289b962..042896da1 100644 --- a/pkg/doc/vc/statustype/statuslist2021_test.go +++ b/pkg/doc/vc/statustype/statuslist2021_test.go @@ -9,7 +9,7 @@ package statustype import ( "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" vcapi "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/pkg/doc/vc/validate.go b/pkg/doc/vc/validate.go index 0a854e447..b35d7839f 100644 --- a/pkg/doc/vc/validate.go +++ b/pkg/doc/vc/validate.go @@ -12,9 +12,9 @@ import ( "fmt" "time" - docjsonld "github.com/hyperledger/aries-framework-go/pkg/doc/jsonld" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + docjsonld "github.com/hyperledger/aries-framework-go/component/models/ld/validator" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" jsonld "github.com/piprate/json-gold/ld" "github.com/trustbloc/logutil-go/pkg/log" diff --git a/pkg/doc/vc/validate_test.go b/pkg/doc/vc/validate_test.go index 8f6364c06..f072cb819 100644 --- a/pkg/doc/vc/validate_test.go +++ b/pkg/doc/vc/validate_test.go @@ -17,8 +17,8 @@ import ( "reflect" "testing" - afgojwt "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + afgojwt "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" jsonld "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/doc/vc/vcutil/vcutil.go b/pkg/doc/vc/vcutil/vcutil.go index 3f6d1c402..5ab443c09 100644 --- a/pkg/doc/vc/vcutil/vcutil.go +++ b/pkg/doc/vc/vcutil/vcutil.go @@ -12,7 +12,7 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" ) diff --git a/pkg/doc/vc/vcutil/vcutil_test.go b/pkg/doc/vc/vcutil/vcutil_test.go index 0f43a05df..f27484b57 100644 --- a/pkg/doc/vc/vcutil/vcutil_test.go +++ b/pkg/doc/vc/vcutil/vcutil_test.go @@ -10,7 +10,7 @@ import ( "encoding/json" "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" diff --git a/pkg/doc/verifiable/signaturetype.go b/pkg/doc/verifiable/signaturetype.go index a9e8fb1d7..901938f34 100644 --- a/pkg/doc/verifiable/signaturetype.go +++ b/pkg/doc/verifiable/signaturetype.go @@ -10,7 +10,7 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/spi/kms" ) // SignatureType type of signature used to sign vc. diff --git a/pkg/doc/verifiable/signaturetype_test.go b/pkg/doc/verifiable/signaturetype_test.go index a8e2a7b89..539f51efa 100644 --- a/pkg/doc/verifiable/signaturetype_test.go +++ b/pkg/doc/verifiable/signaturetype_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/require" ) diff --git a/pkg/doc/vp/validate.go b/pkg/doc/vp/validate.go index 595522e24..7ff599457 100644 --- a/pkg/doc/vp/validate.go +++ b/pkg/doc/vp/validate.go @@ -7,7 +7,8 @@ SPDX-License-Identifier: Apache-2.0 package vp import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" "github.com/trustbloc/vcs/pkg/restapi/resterr" ) diff --git a/pkg/doc/vp/validate_test.go b/pkg/doc/vp/validate_test.go index 316ced597..195ebbc76 100644 --- a/pkg/doc/vp/validate_test.go +++ b/pkg/doc/vp/validate_test.go @@ -12,7 +12,7 @@ import ( "reflect" "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" diff --git a/pkg/event/spi/spi.go b/pkg/event/spi/spi.go index 59aebe9c8..91c3cccf4 100644 --- a/pkg/event/spi/spi.go +++ b/pkg/event/spi/spi.go @@ -9,7 +9,7 @@ package spi import ( "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" ) const ( @@ -66,7 +66,7 @@ type Event struct { Type EventType `json:"type"` // Time defines time of occurrence(required). - Time *util.TimeWrapper `json:"time"` + Time *utiltime.TimeWrapper `json:"time"` // DataContentType is data content type(optional). DataContentType string `json:"datacontenttype,omitempty"` @@ -121,6 +121,6 @@ func NewEvent(uuid string, source string, eventType EventType) *Event { ID: uuid, Source: source, Type: eventType, - Time: util.NewTime(now), + Time: utiltime.NewTime(now), } } diff --git a/pkg/internal/common/diddoc/util.go b/pkg/internal/common/diddoc/util.go index 19af3ad35..60c17df29 100644 --- a/pkg/internal/common/diddoc/util.go +++ b/pkg/internal/common/diddoc/util.go @@ -10,8 +10,8 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" + "github.com/hyperledger/aries-framework-go/component/models/did" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" ) const ( diff --git a/pkg/internal/common/diddoc/util_test.go b/pkg/internal/common/diddoc/util_test.go index a18d44ee1..8e8cb02e9 100644 --- a/pkg/internal/common/diddoc/util_test.go +++ b/pkg/internal/common/diddoc/util_test.go @@ -9,8 +9,8 @@ package diddoc import ( "testing" - diddoc "github.com/hyperledger/aries-framework-go/pkg/doc/did" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + diddoc "github.com/hyperledger/aries-framework-go/component/models/did" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" "github.com/stretchr/testify/require" ) @@ -46,19 +46,19 @@ func TestGetKeyIDFromVerificationMethod(t *testing.T) { } func TestGetDIDDocFromVerificationMethod(t *testing.T) { - did, err := GetDIDDocFromVerificationMethod(didID, &vdrmock.MockVDRegistry{}) + did, err := GetDIDDocFromVerificationMethod(didID, &vdrmock.VDRegistry{}) require.Error(t, err) require.Nil(t, did) - did, err = GetDIDDocFromVerificationMethod(keyID, &vdrmock.MockVDRegistry{}) + did, err = GetDIDDocFromVerificationMethod(keyID, &vdrmock.VDRegistry{}) require.Error(t, err) require.Nil(t, did) - did, err = GetDIDDocFromVerificationMethod(didID+"#"+keyID, &vdrmock.MockVDRegistry{}) + did, err = GetDIDDocFromVerificationMethod(didID+"#"+keyID, &vdrmock.VDRegistry{}) require.Error(t, err) require.Nil(t, did) - did, err = GetDIDDocFromVerificationMethod(didID+"#"+keyID, &vdrmock.MockVDRegistry{ + did, err = GetDIDDocFromVerificationMethod(didID+"#"+keyID, &vdrmock.VDRegistry{ ResolveValue: &diddoc.Doc{}, }) require.NoError(t, err) diff --git a/pkg/internal/mock/status/status.go b/pkg/internal/mock/status/status.go index 0b0d29434..1e4eeedc3 100644 --- a/pkg/internal/mock/status/status.go +++ b/pkg/internal/mock/status/status.go @@ -7,7 +7,7 @@ SPDX-License-Identifier: Apache-2.0 package status import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc" ) diff --git a/pkg/internal/testutil/credential.go b/pkg/internal/testutil/credential.go index bbaaa0aa7..7bcea2d5c 100644 --- a/pkg/internal/testutil/credential.go +++ b/pkg/internal/testutil/credential.go @@ -11,21 +11,21 @@ import ( "testing" "time" - "github.com/hyperledger/aries-framework-go/pkg/common/model" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk/jwksupport" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/jsonwebsignature2020" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - kmskeytypes "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - ariesmockstorage "github.com/hyperledger/aries-framework-go/pkg/mock/storage" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" + jsonld "github.com/hyperledger/aries-framework-go/component/models/ld/processor" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/jsonwebsignature2020" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + ariesmockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + kmskeytypes "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/require" @@ -129,7 +129,7 @@ func proveVC( } } - return credential, &vdrmock.MockVDRegistry{ + return credential, &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { return &did.DocResolution{DIDDocument: didDoc}, nil }, @@ -149,7 +149,7 @@ func createDIDDoc(t *testing.T, didID, keyID string, pubKeyBytes []byte, kt kmsk service := did.Service{ ID: "did:example:123456789abcdefghi#did-communication", Type: "did-communication", - ServiceEndpoint: model.NewDIDCommV1Endpoint("https://agent.example.com/"), + ServiceEndpoint: endpoint.NewDIDCommV1Endpoint("https://agent.example.com/"), RecipientKeys: []string{creator}, Priority: 0, } diff --git a/pkg/internal/testutil/document_loader.go b/pkg/internal/testutil/document_loader.go index 703288c22..75e945eeb 100644 --- a/pkg/internal/testutil/document_loader.go +++ b/pkg/internal/testutil/document_loader.go @@ -10,10 +10,10 @@ import ( _ "embed" //nolint:gci // required for go:embed "testing" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - mockldstore "github.com/hyperledger/aries-framework-go/pkg/mock/ld" - ldstore "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + ld "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" + mockldstore "github.com/hyperledger/aries-framework-go/component/models/ld/mock" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/stretchr/testify/require" ) diff --git a/pkg/internal/testutil/jwt.go b/pkg/internal/testutil/jwt.go index 50730afff..fd2c82a7b 100644 --- a/pkg/internal/testutil/jwt.go +++ b/pkg/internal/testutil/jwt.go @@ -9,14 +9,14 @@ package testutil import ( "testing" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/require" ) @@ -60,7 +60,7 @@ func SignedClaimsJWT(t *testing.T, claims interface{}) *SignedClaimsJWTResult { return &SignedClaimsJWTResult{ JWT: jws, - VDR: &vdrmock.MockVDRegistry{ + VDR: &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { return &did.DocResolution{DIDDocument: didDoc}, nil }, diff --git a/pkg/internal/testutil/presentation.go b/pkg/internal/testutil/presentation.go index 9d3839b02..e9a45dddc 100644 --- a/pkg/internal/testutil/presentation.go +++ b/pkg/internal/testutil/presentation.go @@ -10,14 +10,14 @@ import ( "testing" "time" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite/jsonwebsignature2020" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/models/did" + jsonld "github.com/hyperledger/aries-framework-go/component/models/ld/processor" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite/jsonwebsignature2020" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/require" @@ -94,7 +94,7 @@ func proveVP( return &SignedPresentationResult{ Presentation: presentation, - VDR: &vdrmock.MockVDRegistry{ + VDR: &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { return &did.DocResolution{DIDDocument: didDoc}, nil }, diff --git a/pkg/kms/arieskms.go b/pkg/kms/arieskms.go index c8a32bad6..e2aeabaf9 100644 --- a/pkg/kms/arieskms.go +++ b/pkg/kms/arieskms.go @@ -16,15 +16,16 @@ import ( "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/kms" "github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + webcrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/webkms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + arieskms "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/webkms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/local" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - webcrypto "github.com/hyperledger/aries-framework-go/pkg/crypto/webkms" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - arieskms "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - "github.com/hyperledger/aries-framework-go/pkg/kms/webkms" - "github.com/hyperledger/aries-framework-go/pkg/secretlock" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/local" + kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" + "github.com/hyperledger/aries-framework-go/spi/secretlock" "github.com/hyperledger/aries-framework-go/spi/storage" awssvc "github.com/trustbloc/kms/pkg/aws" @@ -35,21 +36,21 @@ import ( ) // nolint: gochecknoglobals -var ariesSupportedKeyTypes = []arieskms.KeyType{ - arieskms.ED25519Type, - arieskms.X25519ECDHKWType, - arieskms.ECDSASecp256k1TypeIEEEP1363, - arieskms.ECDSAP256TypeDER, - arieskms.ECDSAP384TypeDER, - arieskms.RSAPS256Type, - arieskms.BLS12381G2Type, +var ariesSupportedKeyTypes = []kmsapi.KeyType{ + kmsapi.ED25519Type, + kmsapi.X25519ECDHKWType, + kmsapi.ECDSASecp256k1TypeIEEEP1363, + kmsapi.ECDSAP256TypeDER, + kmsapi.ECDSAP384TypeDER, + kmsapi.RSAPS256Type, + kmsapi.BLS12381G2Type, } // nolint: gochecknoglobals -var awsSupportedKeyTypes = []arieskms.KeyType{ - arieskms.ECDSAP256TypeDER, - arieskms.ECDSAP384TypeDER, - arieskms.ECDSASecp256k1DER, +var awsSupportedKeyTypes = []kmsapi.KeyType{ + kmsapi.ECDSAP256TypeDER, + kmsapi.ECDSAP384TypeDER, + kmsapi.ECDSASecp256k1DER, } const ( @@ -60,7 +61,7 @@ const ( type keyManager interface { Get(keyID string) (interface{}, error) - CreateAndExportPubKeyBytes(kt arieskms.KeyType, opts ...arieskms.KeyOpts) (string, []byte, error) + CreateAndExportPubKeyBytes(kt kmsapi.KeyType, opts ...kmsapi.KeyOpts) (string, []byte, error) } type Crypto interface { @@ -179,7 +180,7 @@ func createLocalKMS(cfg *Config) (keyManager, Crypto, error) { return localKms, crypto, nil } -func (km *KeyManager) SupportedKeyTypes() []arieskms.KeyType { +func (km *KeyManager) SupportedKeyTypes() []kmsapi.KeyType { if km.kmsType == AWS { return awsSupportedKeyTypes } @@ -191,11 +192,11 @@ func (km *KeyManager) Crypto() Crypto { return km.crypto } -func (km *KeyManager) CreateJWKKey(keyType arieskms.KeyType) (string, *jwk.JWK, error) { +func (km *KeyManager) CreateJWKKey(keyType kmsapi.KeyType) (string, *jwk.JWK, error) { return key.JWKKeyCreator(keyType)(km.keyManager) } -func (km *KeyManager) CreateCryptoKey(keyType arieskms.KeyType) (string, interface{}, error) { +func (km *KeyManager) CreateCryptoKey(keyType kmsapi.KeyType) (string, interface{}, error) { return key.CryptoKeyCreator(keyType)(km.keyManager) } @@ -248,11 +249,11 @@ func createStoreProvider(typ, url, prefix string) (storage.Provider, error) { } type kmsProvider struct { - storageProvider arieskms.Store + storageProvider kmsapi.Store secretLockService secretlock.Service } -func (k kmsProvider) StorageProvider() arieskms.Store { +func (k kmsProvider) StorageProvider() kmsapi.Store { return k.storageProvider } diff --git a/pkg/kms/arieskms_test.go b/pkg/kms/arieskms_test.go index 5825e9e73..a5333ec27 100644 --- a/pkg/kms/arieskms_test.go +++ b/pkg/kms/arieskms_test.go @@ -19,7 +19,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - arieskms "github.com/hyperledger/aries-framework-go/pkg/kms" + arieskms "github.com/hyperledger/aries-framework-go/spi/kms" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/require" diff --git a/pkg/kms/key/creator.go b/pkg/kms/key/creator.go index a7f100820..511e9bd7a 100644 --- a/pkg/kms/key/creator.go +++ b/pkg/kms/key/creator.go @@ -17,11 +17,11 @@ import ( "github.com/btcsuite/btcd/btcec" jose2 "github.com/go-jose/go-jose/v3" - "github.com/hyperledger/aries-framework-go/pkg/crypto/primitive/bbs12381g2pub" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk/jwksupport" - "github.com/hyperledger/aries-framework-go/pkg/doc/util/jwkkid" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk/jwksupport" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/jwkkid" + "github.com/hyperledger/aries-framework-go/spi/kms" ) type keyManager interface { diff --git a/pkg/kms/key/creator_test.go b/pkg/kms/key/creator_test.go index fd8e259c4..742b14026 100644 --- a/pkg/kms/key/creator_test.go +++ b/pkg/kms/key/creator_test.go @@ -14,11 +14,11 @@ import ( "github.com/stretchr/testify/require" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/primitive/bbs12381g2pub" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - "github.com/hyperledger/aries-framework-go/pkg/crypto/primitive/bbs12381g2pub" "github.com/hyperledger/aries-framework-go/pkg/framework/aries" - "github.com/hyperledger/aries-framework-go/pkg/kms" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/kms/key" ) diff --git a/pkg/kms/kms.go b/pkg/kms/kms.go index aeafdd556..f5431dd4d 100644 --- a/pkg/kms/kms.go +++ b/pkg/kms/kms.go @@ -11,8 +11,8 @@ package kms import ( "net/http" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" diff --git a/pkg/kms/mocks/kms_mocks.go b/pkg/kms/mocks/kms_mocks.go index fe0c50b88..c9c15564a 100644 --- a/pkg/kms/mocks/kms_mocks.go +++ b/pkg/kms/mocks/kms_mocks.go @@ -8,8 +8,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - jwk "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - kms "github.com/hyperledger/aries-framework-go/pkg/kms" + jwk "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + kms "github.com/hyperledger/aries-framework-go/spi/kms" vc "github.com/trustbloc/vcs/pkg/doc/vc" verifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" ) diff --git a/pkg/kms/signer/arieskms_test.go b/pkg/kms/signer/arieskms_test.go index 6a7d8f03f..dc2c46f55 100644 --- a/pkg/kms/signer/arieskms_test.go +++ b/pkg/kms/signer/arieskms_test.go @@ -12,9 +12,9 @@ import ( "testing" "github.com/google/tink/go/keyset" - "github.com/hyperledger/aries-framework-go/pkg/kms" - mockcrypto "github.com/hyperledger/aries-framework-go/pkg/mock/crypto" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" + mockcrypto "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/spi/kms" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" noopMetricsProvider "github.com/trustbloc/vcs/pkg/observability/metrics/noop" diff --git a/pkg/ld/cached_context_store.go b/pkg/ld/cached_context_store.go index 06c53499c..a8d304209 100644 --- a/pkg/ld/cached_context_store.go +++ b/pkg/ld/cached_context_store.go @@ -9,8 +9,8 @@ SPDX-License-Identifier: Apache-2.0 package ld import ( - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" jsonld "github.com/piprate/json-gold/ld" ) @@ -25,7 +25,7 @@ type Cache interface { Del(key interface{}) } -type ContextStore = ld.ContextStore +type ContextStore = ldstore.ContextStore // CachedContextStore is a cached store for JSON-LD contexts. type CachedContextStore struct { diff --git a/pkg/ld/cached_context_store_test.go b/pkg/ld/cached_context_store_test.go index a5dffa7cf..51890fdd7 100644 --- a/pkg/ld/cached_context_store_test.go +++ b/pkg/ld/cached_context_store_test.go @@ -11,7 +11,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" jsonld "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/require" diff --git a/pkg/ld/document_loader.go b/pkg/ld/document_loader.go index c08797753..ec8f54034 100644 --- a/pkg/ld/document_loader.go +++ b/pkg/ld/document_loader.go @@ -10,9 +10,9 @@ import ( _ "embed" //nolint:gci // required for go:embed "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - ldstore "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" jsonld "github.com/piprate/json-gold/ld" ) @@ -36,8 +36,8 @@ type provider interface { } // NewDocumentLoader returns a JSON-LD document loader with preloaded contexts. -func NewDocumentLoader(p provider, opts ...ld.DocumentLoaderOpts) (jsonld.DocumentLoader, error) { - loader, err := ld.NewDocumentLoader(p, append(opts, ld.WithExtraContexts(embedContexts...))...) +func NewDocumentLoader(p provider, opts ...lddocloader.Opts) (jsonld.DocumentLoader, error) { + loader, err := lddocloader.NewDocumentLoader(p, append(opts, lddocloader.WithExtraContexts(embedContexts...))...) if err != nil { return nil, fmt.Errorf("new document loader: %w", err) } diff --git a/pkg/ld/document_loader_test.go b/pkg/ld/document_loader_test.go index 680fdb1c4..b847e5c5b 100644 --- a/pkg/ld/document_loader_test.go +++ b/pkg/ld/document_loader_test.go @@ -10,8 +10,8 @@ import ( "errors" "testing" - mockldstore "github.com/hyperledger/aries-framework-go/pkg/mock/ld" - ldstore "github.com/hyperledger/aries-framework-go/pkg/store/ld" + mockldstore "github.com/hyperledger/aries-framework-go/component/models/ld/mock" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/stretchr/testify/require" "github.com/trustbloc/vcs/pkg/ld" @@ -32,7 +32,7 @@ func TestNewDocumentLoader(t *testing.T) { t.Run("Fail to create a new document loader", func(t *testing.T) { p := &mockProvider{ - ContextStore: &mockldstore.MockContextStore{ErrImport: errors.New("import error")}, + ContextStore: &mockldstore.ContextStore{ErrImport: errors.New("import error")}, RemoteProviderStore: mockldstore.NewMockRemoteProviderStore(), } diff --git a/pkg/ld/store_provider.go b/pkg/ld/store_provider.go index a0e8063da..8c9922cfa 100644 --- a/pkg/ld/store_provider.go +++ b/pkg/ld/store_provider.go @@ -9,7 +9,7 @@ package ld import ( "fmt" - "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldstoreapi "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/trustbloc/vcs/pkg/storage/mongodb" "github.com/trustbloc/vcs/pkg/storage/mongodb/ldstore" @@ -17,8 +17,8 @@ import ( // StoreProvider provides stores for JSON-LD contexts and remote providers. type StoreProvider struct { - ContextStore ld.ContextStore - RemoteProviderStore ld.RemoteProviderStore + ContextStore ldstoreapi.ContextStore + RemoteProviderStore ldstoreapi.RemoteProviderStore CacheImpl Cache } @@ -41,11 +41,11 @@ func NewStoreProvider(mongoClient *mongodb.Client, cacheImpl Cache) (*StoreProvi } // JSONLDContextStore returns JSON-LD context store. -func (p *StoreProvider) JSONLDContextStore() ld.ContextStore { +func (p *StoreProvider) JSONLDContextStore() ldstoreapi.ContextStore { return p.ContextStore } // JSONLDRemoteProviderStore returns JSON-LD remote provider store. -func (p *StoreProvider) JSONLDRemoteProviderStore() ld.RemoteProviderStore { +func (p *StoreProvider) JSONLDRemoteProviderStore() ldstoreapi.RemoteProviderStore { return p.RemoteProviderStore } diff --git a/pkg/observability/tracing/wrappers/credentialstatus/component/credentialstatus_wrapper.go b/pkg/observability/tracing/wrappers/credentialstatus/component/credentialstatus_wrapper.go index 7b5066d2b..c1b361b2b 100644 --- a/pkg/observability/tracing/wrappers/credentialstatus/component/credentialstatus_wrapper.go +++ b/pkg/observability/tracing/wrappers/credentialstatus/component/credentialstatus_wrapper.go @@ -12,7 +12,7 @@ package component import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper.go b/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper.go index 1802b49f4..26d5d0961 100644 --- a/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper.go +++ b/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper.go @@ -11,7 +11,7 @@ package issuecredential import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper_test.go b/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper_test.go index 768405a3c..1e2e038f1 100644 --- a/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper_test.go +++ b/pkg/observability/tracing/wrappers/issuecredential/issuecredential_wrapper_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper.go b/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper.go index 34413691e..97a291ca8 100644 --- a/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper.go +++ b/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper.go @@ -15,7 +15,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" "github.com/trustbloc/vcs/pkg/observability/tracing/attributeutil" profileapi "github.com/trustbloc/vcs/pkg/profile" diff --git a/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper_test.go b/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper_test.go index 8409ead03..839533722 100644 --- a/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper_test.go +++ b/pkg/observability/tracing/wrappers/oidc4vp/oidc4vp_wrapper_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper.go b/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper.go index ce865493d..5100fd8fe 100644 --- a/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper.go +++ b/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper.go @@ -15,7 +15,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/observability/tracing/attributeutil" profileapi "github.com/trustbloc/vcs/pkg/profile" diff --git a/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper_test.go b/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper_test.go index 52313fd2a..2c989b559 100644 --- a/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper_test.go +++ b/pkg/observability/tracing/wrappers/verifycredential/verifycredential_wrapper_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper.go b/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper.go index 237aab256..fcd599931 100644 --- a/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper.go +++ b/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/trace" diff --git a/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper_test.go b/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper_test.go index 628b96c67..7a0307720 100644 --- a/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper_test.go +++ b/pkg/observability/tracing/wrappers/verifypresentation/verifypresentation_wrapper_test.go @@ -12,7 +12,7 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" diff --git a/pkg/profile/api.go b/pkg/profile/api.go index bd3e47f89..e7c5ce9b1 100644 --- a/pkg/profile/api.go +++ b/pkg/profile/api.go @@ -12,11 +12,11 @@ import ( "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" + "github.com/hyperledger/aries-framework-go/component/models/presexch" "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/vdr/key" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + "github.com/hyperledger/aries-framework-go/component/vdr/key" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" diff --git a/pkg/restapi/v1/issuer/controller.go b/pkg/restapi/v1/issuer/controller.go index 90bc09992..7a5ea1124 100644 --- a/pkg/restapi/v1/issuer/controller.go +++ b/pkg/restapi/v1/issuer/controller.go @@ -27,9 +27,8 @@ import ( "go.opentelemetry.io/otel/trace" "github.com/hyperledger/aries-framework-go/component/models/ld/validator" - "github.com/hyperledger/aries-framework-go/pkg/doc/jsonld" - util2 "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/crypto" @@ -239,7 +238,7 @@ func (c *Controller) buildCredentialsFromTemplate( ID: profile.SigningDID.DID, CustomFields: *body.Claims, }, - Issued: util2.NewTime(time.Now()), + Issued: utiltime.NewTime(time.Now()), CustomFields: map[string]interface{}{}, } @@ -251,9 +250,9 @@ func (c *Controller) buildCredentialsFromTemplate( } if credentialTemplate.CredentialDefaultExpirationDuration != nil { - vcc.Expired = util2.NewTime(time.Now().UTC().Add(*credentialTemplate.CredentialDefaultExpirationDuration)) + vcc.Expired = utiltime.NewTime(time.Now().UTC().Add(*credentialTemplate.CredentialDefaultExpirationDuration)) } else { - vcc.Expired = util2.NewTime(time.Now().Add(365 * 24 * time.Hour)) + vcc.Expired = utiltime.NewTime(time.Now().Add(365 * 24 * time.Hour)) } return vcc @@ -738,8 +737,8 @@ func (c *Controller) validateClaims( //nolint:gocognit data["type"] = types return validator.ValidateJSONLDMap(data, - jsonld.WithDocumentLoader(c.documentLoader), - jsonld.WithStrictValidation(strictValidation), + validator.WithDocumentLoader(c.documentLoader), + validator.WithStrictValidation(strictValidation), ) } diff --git a/pkg/restapi/v1/issuer/controller_test.go b/pkg/restapi/v1/issuer/controller_test.go index 40bf91de3..a031c38d6 100644 --- a/pkg/restapi/v1/issuer/controller_test.go +++ b/pkg/restapi/v1/issuer/controller_test.go @@ -21,8 +21,8 @@ import ( "github.com/golang/mock/gomock" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/labstack/echo/v4" "github.com/samber/lo" "github.com/stretchr/testify/assert" diff --git a/pkg/restapi/v1/oidc4ci/controller.go b/pkg/restapi/v1/oidc4ci/controller.go index a563a6596..189fee904 100644 --- a/pkg/restapi/v1/oidc4ci/controller.go +++ b/pkg/restapi/v1/oidc4ci/controller.go @@ -24,8 +24,8 @@ import ( gojose "github.com/go-jose/go-jose/v3" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/labstack/echo/v4" "github.com/ory/fosite" "github.com/samber/lo" diff --git a/pkg/restapi/v1/oidc4ci/controller_e2e_flows_test.go b/pkg/restapi/v1/oidc4ci/controller_e2e_flows_test.go index f49b4032e..6e9f2f7cc 100644 --- a/pkg/restapi/v1/oidc4ci/controller_e2e_flows_test.go +++ b/pkg/restapi/v1/oidc4ci/controller_e2e_flows_test.go @@ -23,8 +23,8 @@ import ( "time" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/labstack/echo/v4" "github.com/ory/fosite" "github.com/ory/fosite/compose" diff --git a/pkg/restapi/v1/oidc4ci/controller_test.go b/pkg/restapi/v1/oidc4ci/controller_test.go index b81e11551..2afe9edc1 100644 --- a/pkg/restapi/v1/oidc4ci/controller_test.go +++ b/pkg/restapi/v1/oidc4ci/controller_test.go @@ -26,8 +26,8 @@ import ( gojose "github.com/go-jose/go-jose/v3" "github.com/golang/mock/gomock" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" "github.com/labstack/echo/v4" "github.com/ory/fosite" "github.com/samber/lo" diff --git a/pkg/restapi/v1/verifier/controller.go b/pkg/restapi/v1/verifier/controller.go index 7ddf129b9..62e71101e 100644 --- a/pkg/restapi/v1/verifier/controller.go +++ b/pkg/restapi/v1/verifier/controller.go @@ -19,11 +19,11 @@ import ( "strings" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" "github.com/labstack/echo/v4" "github.com/piprate/json-gold/ld" "github.com/samber/lo" @@ -570,7 +570,7 @@ func (c *Controller) verifyAuthorizationResponseTokens( logger.Debugc(ctx, "CheckAuthorizationResponse vp_token verified") - //todo: consider to apply this validation for JWT VP in verifypresentation.Service + // todo: consider to apply this validation for JWT VP in verifypresentation.Service if vpTokenClaims.Nonce != idTokenClaims.Nonce { return nil, resterr.NewValidationError(resterr.InvalidValue, "nonce", errors.New("nonce should be the same for both id_token and vp_token")) diff --git a/pkg/restapi/v1/verifier/controller_test.go b/pkg/restapi/v1/verifier/controller_test.go index e46832fdd..48fe44798 100644 --- a/pkg/restapi/v1/verifier/controller_test.go +++ b/pkg/restapi/v1/verifier/controller_test.go @@ -20,10 +20,10 @@ import ( "time" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/trace" @@ -138,7 +138,7 @@ func TestController_PostVerifyCredentials(t *testing.T) { VerifyCredentialSvc: mockVerifyCredentialSvc, ProfileSvc: mockProfileSvc, DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, Tracer: trace.NewNoopTracerProvider().Tracer(""), }) @@ -185,7 +185,7 @@ func TestController_VerifyCredentials(t *testing.T) { VerifyCredentialSvc: mockVerifyCredentialSvc, ProfileSvc: mockProfileSvc, DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, }) t.Run("Success JSON-LD", func(t *testing.T) { @@ -273,7 +273,7 @@ func TestController_VerifyCredentials(t *testing.T) { VerifyCredentialSvc: testCase.getVerifyCredentialSvc(), ProfileSvc: testCase.getProfileSvc(), DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, }) var body VerifyCredentialData @@ -310,7 +310,7 @@ func TestController_PostVerifyPresentation(t *testing.T) { VerifyPresentationSvc: mockVerifyPresSvc, ProfileSvc: mockProfileSvc, DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, Tracer: trace.NewNoopTracerProvider().Tracer(""), }) @@ -357,7 +357,7 @@ func TestController_VerifyPresentation(t *testing.T) { VerifyPresentationSvc: mockVerifyPresentationSvc, ProfileSvc: mockProfileSvc, DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, }) t.Run("Success JSON-LD", func(t *testing.T) { @@ -445,7 +445,7 @@ func TestController_VerifyPresentation(t *testing.T) { VerifyPresentationSvc: testCase.getVerifyPresentationSvc(), ProfileSvc: testCase.getProfileSvc(), DocumentLoader: testutil.DocumentLoader(t), - VDR: &vdrmock.MockVDRegistry{}, + VDR: &vdrmock.VDRegistry{}, }) var body VerifyPresentationData diff --git a/pkg/service/credentialstatus/eventhandler/eventhandler_service.go b/pkg/service/credentialstatus/eventhandler/eventhandler_service.go index 6d122d3a4..2891ecdcb 100644 --- a/pkg/service/credentialstatus/eventhandler/eventhandler_service.go +++ b/pkg/service/credentialstatus/eventhandler/eventhandler_service.go @@ -13,7 +13,7 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/piprate/json-gold/ld" "github.com/trustbloc/logutil-go/pkg/log" diff --git a/pkg/service/credentialstatus/eventhandler/eventhandler_service_test.go b/pkg/service/credentialstatus/eventhandler/eventhandler_service_test.go index d6cc1c212..df050f36d 100644 --- a/pkg/service/credentialstatus/eventhandler/eventhandler_service_test.go +++ b/pkg/service/credentialstatus/eventhandler/eventhandler_service_test.go @@ -20,14 +20,14 @@ import ( "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/require" - ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - cryptomock "github.com/hyperledger/aries-framework-go/pkg/mock/crypto" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + cryptomock "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/crypto" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + ariescrypto "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" @@ -78,7 +78,7 @@ func TestService_HandleEvent(t *testing.T) { mockKMSRegistry := NewMockKMSRegistry(gomock.NewController(t)) mockKMSRegistry.EXPECT().GetKeyManager(gomock.Any()).AnyTimes().Return(&mockKMS{}, nil) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) t.Run("OK", func(t *testing.T) { cslStore := newMockCSLVCStore() @@ -183,7 +183,7 @@ func TestService_handleEventPayload(t *testing.T) { mockKMSRegistry := NewMockKMSRegistry(gomock.NewController(t)) mockKMSRegistry.EXPECT().GetKeyManager(gomock.Any()).AnyTimes().Return(&mockKMS{}, nil) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) t.Run("OK", func(t *testing.T) { cslStore := newMockCSLVCStore() @@ -406,7 +406,7 @@ func TestService_signCSL(t *testing.T) { mockKMSRegistry := NewMockKMSRegistry(gomock.NewController(t)) mockKMSRegistry.EXPECT().GetKeyManager(gomock.Any()).AnyTimes().Return(&mockKMS{}, nil) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) + &vdrmock.VDRegistry{ResolveValue: createDIDDoc("did:test:abc")}, loader) t.Run("OK", func(t *testing.T) { cslStore := newMockCSLVCStore() @@ -484,7 +484,7 @@ func TestService_signCSL(t *testing.T) { t.Run("Error sign CSL failed", func(t *testing.T) { cryptoErr := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveErr: errors.New("some error")}, loader) + &vdrmock.VDRegistry{ResolveErr: errors.New("some error")}, loader) var cslWrapper *credentialstatus.CSLVCWrapper err := json.Unmarshal([]byte(cslWrapperBytes), &cslWrapper) require.NoError(t, err) diff --git a/pkg/service/credentialstatus/types.go b/pkg/service/credentialstatus/types.go index 70f2e30f8..b737d6e2a 100644 --- a/pkg/service/credentialstatus/types.go +++ b/pkg/service/credentialstatus/types.go @@ -11,7 +11,7 @@ import ( "encoding/json" "errors" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc" profileapi "github.com/trustbloc/vcs/pkg/profile" diff --git a/pkg/service/didconfiguration/didconfiguration_service.go b/pkg/service/didconfiguration/didconfiguration_service.go index ee6589f20..fa5f21af3 100644 --- a/pkg/service/didconfiguration/didconfiguration_service.go +++ b/pkg/service/didconfiguration/didconfiguration_service.go @@ -13,8 +13,8 @@ import ( "errors" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + utiltime "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/crypto" @@ -205,7 +205,7 @@ func (s *Service) getBaseCredentials() *verifiable.Credential { vcTypeVerifiableCredential, vcTypeDomainLinkageCredential, }, - Issued: util.NewTime(time.Now()), - Expired: util.NewTime(time.Now().AddDate(1, 0, 0)), + Issued: utiltime.NewTime(time.Now()), + Expired: utiltime.NewTime(time.Now().AddDate(1, 0, 0)), } } diff --git a/pkg/service/didconfiguration/didconfiguration_service_test.go b/pkg/service/didconfiguration/didconfiguration_service_test.go index ebd8938d6..6c9c8ddaf 100644 --- a/pkg/service/didconfiguration/didconfiguration_service_test.go +++ b/pkg/service/didconfiguration/didconfiguration_service_test.go @@ -12,8 +12,8 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/assert" "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/pkg/service/issuecredential/api.go b/pkg/service/issuecredential/api.go index fdd3dee9d..a2d80f912 100644 --- a/pkg/service/issuecredential/api.go +++ b/pkg/service/issuecredential/api.go @@ -9,7 +9,7 @@ package issuecredential import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc/crypto" profileapi "github.com/trustbloc/vcs/pkg/profile" diff --git a/pkg/service/issuecredential/issuecredential_service.go b/pkg/service/issuecredential/issuecredential_service.go index fb15ab6cd..02fb4d699 100644 --- a/pkg/service/issuecredential/issuecredential_service.go +++ b/pkg/service/issuecredential/issuecredential_service.go @@ -12,7 +12,7 @@ import ( "context" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/crypto" diff --git a/pkg/service/issuecredential/issuecredential_service_test.go b/pkg/service/issuecredential/issuecredential_service_test.go index 4bdba68af..12f959306 100644 --- a/pkg/service/issuecredential/issuecredential_service_test.go +++ b/pkg/service/issuecredential/issuecredential_service_test.go @@ -19,19 +19,19 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/pkg/common/model" - ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - ariesmockstorage "github.com/hyperledger/aries-framework-go/pkg/mock/storage" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" + util "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + ariesmockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + ariescrypto "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" vccrypto "github.com/trustbloc/vcs/pkg/doc/vc/crypto" @@ -116,7 +116,7 @@ func TestService_IssueCredential(t *testing.T) { didDoc := createDIDDoc("did:trustblock:abc", keyID) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) service := issuecredential.New(&issuecredential.Config{ VCStatusManager: mockVCStatusManager, @@ -181,7 +181,7 @@ func TestService_IssueCredential(t *testing.T) { didDoc := createDIDDoc("did:trustblock:abc", keyID) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) service := issuecredential.New(&issuecredential.Config{ VCStatusManager: mockVCStatusManager, @@ -306,7 +306,7 @@ func TestService_IssueCredential(t *testing.T) { didDoc := createDIDDoc("did:trustblock:abc", keyID) crypto := vccrypto.New( - &vdrmock.MockVDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) + &vdrmock.VDRegistry{ResolveValue: didDoc}, testutil.DocumentLoader(t)) service := issuecredential.New(&issuecredential.Config{ KMSRegistry: kmRegistry, @@ -404,7 +404,7 @@ func createDIDDoc(didID, keyID string) *did.Doc { //nolint:unparam service := did.Service{ ID: "did:example:123456789abcdefghi#did-communication", Type: "did-communication", - ServiceEndpoint: model.NewDIDCommV1Endpoint("https://agent.example.com/"), + ServiceEndpoint: endpoint.NewDIDCommV1Endpoint("https://agent.example.com/"), RecipientKeys: []string{creator}, Priority: 0, } diff --git a/pkg/service/oidc4ci/api.go b/pkg/service/oidc4ci/api.go index f756f77b5..ccb13dc88 100644 --- a/pkg/service/oidc4ci/api.go +++ b/pkg/service/oidc4ci/api.go @@ -11,7 +11,7 @@ import ( "net/url" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/dataprotect" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" diff --git a/pkg/service/oidc4ci/oidc4ci_service.go b/pkg/service/oidc4ci/oidc4ci_service.go index d5795e8a3..e26546e3a 100644 --- a/pkg/service/oidc4ci/oidc4ci_service.go +++ b/pkg/service/oidc4ci/oidc4ci_service.go @@ -21,8 +21,8 @@ import ( "github.com/google/uuid" "github.com/trustbloc/logutil-go/pkg/log" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + util "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/dataprotect" "github.com/trustbloc/vcs/pkg/event/spi" diff --git a/pkg/service/oidc4vp/api.go b/pkg/service/oidc4vp/api.go index 1a7048303..a26de3c4a 100644 --- a/pkg/service/oidc4vp/api.go +++ b/pkg/service/oidc4vp/api.go @@ -9,9 +9,9 @@ package oidc4vp import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + util "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" profileapi "github.com/trustbloc/vcs/pkg/profile" diff --git a/pkg/service/oidc4vp/claims.go b/pkg/service/oidc4vp/claims.go index 98fe3beb9..5137a85d9 100644 --- a/pkg/service/oidc4vp/claims.go +++ b/pkg/service/oidc4vp/claims.go @@ -11,7 +11,7 @@ import ( "encoding/json" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" ) func (tm *TxManager) EncryptClaims(ctx context.Context, data *ReceivedClaims) (*ClaimData, error) { diff --git a/pkg/service/oidc4vp/oidc4vp_service.go b/pkg/service/oidc4vp/oidc4vp_service.go index da91ef993..c3e5fa117 100644 --- a/pkg/service/oidc4vp/oidc4vp_service.go +++ b/pkg/service/oidc4vp/oidc4vp_service.go @@ -22,11 +22,11 @@ import ( "github.com/trustbloc/logutil-go/pkg/log" "github.com/valyala/fastjson" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose" - "github.com/hyperledger/aries-framework-go/pkg/doc/jwt" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - kmsapi "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose" + "github.com/hyperledger/aries-framework-go/component/models/jwt" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + kmsapi "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/internal/logfields" "github.com/trustbloc/vcs/pkg/doc/vc" diff --git a/pkg/service/oidc4vp/oidc4vp_service_test.go b/pkg/service/oidc4vp/oidc4vp_service_test.go index a35f5f2b3..ab0a9a71c 100644 --- a/pkg/service/oidc4vp/oidc4vp_service_test.go +++ b/pkg/service/oidc4vp/oidc4vp_service_test.go @@ -21,25 +21,25 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/crypto/tinkcrypto" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/jose/jwk" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/doc/util/fingerprint" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/kms/localkms" + mockkms "github.com/hyperledger/aries-framework-go/component/kmscrypto/mock/kms" + "github.com/hyperledger/aries-framework-go/component/kmscrypto/secretlock/noop" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/signature/suite" + "github.com/hyperledger/aries-framework-go/component/models/signature/verifier" + util "github.com/hyperledger/aries-framework-go/component/models/util/time" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - ariescrypto "github.com/hyperledger/aries-framework-go/pkg/crypto" - "github.com/hyperledger/aries-framework-go/pkg/crypto/tinkcrypto" - "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/suite" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/verifier" - "github.com/hyperledger/aries-framework-go/pkg/doc/util" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + ariesmockstorage "github.com/hyperledger/aries-framework-go/component/storageutil/mock/storage" "github.com/hyperledger/aries-framework-go/pkg/framework/aries" ariescontext "github.com/hyperledger/aries-framework-go/pkg/framework/context" - "github.com/hyperledger/aries-framework-go/pkg/kms" - "github.com/hyperledger/aries-framework-go/pkg/kms/localkms" - mockkms "github.com/hyperledger/aries-framework-go/pkg/mock/kms" - ariesmockstorage "github.com/hyperledger/aries-framework-go/pkg/mock/storage" - "github.com/hyperledger/aries-framework-go/pkg/secretlock/noop" - "github.com/hyperledger/aries-framework-go/pkg/vdr/fingerprint" + ariescrypto "github.com/hyperledger/aries-framework-go/spi/crypto" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" @@ -793,7 +793,8 @@ func (m *mockEvent) Publish(_ context.Context, _ string, _ ...*spi.Event) error } func newVPWithPD(t *testing.T, agent *ariescontext.Provider) ( - *verifiable.Presentation, *presexch.PresentationDefinition, string, verifiable.PublicKeyFetcher, *ld.DocumentLoader) { + *verifiable.Presentation, *presexch.PresentationDefinition, string, + verifiable.PublicKeyFetcher, *lddocloader.DocumentLoader) { uri := randomURI() customType := "CustomType" @@ -940,7 +941,7 @@ func randomURI() string { return fmt.Sprintf("https://my.test.context.jsonld/%s", uuid.New().String()) } -func createTestDocumentLoader(t *testing.T, contextURL string, types ...string) *ld.DocumentLoader { +func createTestDocumentLoader(t *testing.T, contextURL string, types ...string) *lddocloader.DocumentLoader { include := fmt.Sprintf(`"ctx":"%s#"`, contextURL) for _, typ := range types { diff --git a/pkg/service/oidc4vp/txmanager.go b/pkg/service/oidc4vp/txmanager.go index fa1e985b4..19c3e2a6f 100644 --- a/pkg/service/oidc4vp/txmanager.go +++ b/pkg/service/oidc4vp/txmanager.go @@ -15,8 +15,8 @@ import ( "errors" "fmt" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/piprate/json-gold/ld" "github.com/trustbloc/vcs/pkg/dataprotect" diff --git a/pkg/service/oidc4vp/txmanager_test.go b/pkg/service/oidc4vp/txmanager_test.go index 4d752f739..0406eaf73 100644 --- a/pkg/service/oidc4vp/txmanager_test.go +++ b/pkg/service/oidc4vp/txmanager_test.go @@ -14,8 +14,8 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/pkg/service/verifycredential/api.go b/pkg/service/verifycredential/api.go index c3e439d4d..40c7a286c 100644 --- a/pkg/service/verifycredential/api.go +++ b/pkg/service/verifycredential/api.go @@ -9,7 +9,7 @@ package verifycredential import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" profileapi "github.com/trustbloc/vcs/pkg/profile" ) diff --git a/pkg/service/verifycredential/linkeddomain.go b/pkg/service/verifycredential/linkeddomain.go index 7903e42ca..b1bf36eba 100644 --- a/pkg/service/verifycredential/linkeddomain.go +++ b/pkg/service/verifycredential/linkeddomain.go @@ -12,7 +12,7 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/client/didconfig" + didconfig "github.com/hyperledger/aries-framework-go/component/didconfig/client" ) const ( diff --git a/pkg/service/verifycredential/linkeddomain_test.go b/pkg/service/verifycredential/linkeddomain_test.go index 16044373d..537406dd2 100644 --- a/pkg/service/verifycredential/linkeddomain_test.go +++ b/pkg/service/verifycredential/linkeddomain_test.go @@ -15,11 +15,11 @@ import ( "net/http" "testing" - "github.com/hyperledger/aries-framework-go/pkg/common/model" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/models/did" + "github.com/hyperledger/aries-framework-go/component/models/did/endpoint" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" "github.com/stretchr/testify/require" "github.com/trustbloc/vcs/pkg/internal/testutil" @@ -172,7 +172,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { name: "OK", fields: fields{ getVDR: func() vdrapi.Registry { - return &vdrmock.MockVDRegistry{ + return &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { if didID != testDID { return nil, errors.New("some error") @@ -192,7 +192,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { name: "VDR resolve error", fields: fields{ getVDR: func() vdrapi.Registry { - return &vdrmock.MockVDRegistry{ + return &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { return nil, errors.New("some error") }, @@ -208,7 +208,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { name: "No LinkedDomains", fields: fields{ getVDR: func() vdrapi.Registry { - return &vdrmock.MockVDRegistry{ + return &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { if didID != testDID { return nil, errors.New("some error") @@ -233,7 +233,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { name: "Unsupported service endpoint structure", fields: fields{ getVDR: func() vdrapi.Registry { - return &vdrmock.MockVDRegistry{ + return &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { if didID != testDID { return nil, errors.New("some error") @@ -245,11 +245,11 @@ func TestService_ValidateLinkedDomain(t *testing.T) { emptyServicesDoc.Service = []did.Service{ { Type: []interface{}{"IdentityHub"}, - ServiceEndpoint: model.NewDIDCommV1Endpoint("https://example.com"), + ServiceEndpoint: endpoint.NewDIDCommV1Endpoint("https://example.com"), }, { Type: []string{"LinkedDomains"}, - ServiceEndpoint: model.NewDIDCommV1Endpoint("https://example.com"), + ServiceEndpoint: endpoint.NewDIDCommV1Endpoint("https://example.com"), }, } @@ -267,7 +267,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { name: "Invalid domain", fields: fields{ getVDR: func() vdrapi.Registry { - return &vdrmock.MockVDRegistry{ + return &vdrmock.VDRegistry{ ResolveFunc: func(didID string, opts ...vdrapi.DIDMethodOption) (*did.DocResolution, error) { if didID != testDID { return nil, errors.New("some error") @@ -279,7 +279,7 @@ func TestService_ValidateLinkedDomain(t *testing.T) { emptyServicesDoc.Service = []did.Service{ { Type: []string{"LinkedDomains"}, - ServiceEndpoint: model.NewDIDCoreEndpoint( + ServiceEndpoint: endpoint.NewDIDCoreEndpoint( map[string][]string{ "origins": {"https://example.com"}, }), diff --git a/pkg/service/verifycredential/verifycredential_service.go b/pkg/service/verifycredential/verifycredential_service.go index 9be17fe25..e1603cf7f 100644 --- a/pkg/service/verifycredential/verifycredential_service.go +++ b/pkg/service/verifycredential/verifycredential_service.go @@ -17,8 +17,8 @@ import ( "github.com/piprate/json-gold/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" "github.com/trustbloc/vcs/pkg/doc/vc" "github.com/trustbloc/vcs/pkg/doc/vc/bitstring" diff --git a/pkg/service/verifycredential/verifycredential_service_test.go b/pkg/service/verifycredential/verifycredential_service_test.go index 283bb8074..f8204361d 100644 --- a/pkg/service/verifycredential/verifycredential_service_test.go +++ b/pkg/service/verifycredential/verifycredential_service_test.go @@ -13,9 +13,9 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - kmskeytypes "github.com/hyperledger/aries-framework-go/pkg/kms" - vdrmock "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrmock "github.com/hyperledger/aries-framework-go/component/vdr/mock" + kmskeytypes "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/stretchr/testify/require" "github.com/trustbloc/vcs/pkg/doc/vc" @@ -186,7 +186,7 @@ func TestService_VerifyCredential(t *testing.T) { t.Run("Failed", func(t *testing.T) { // Assert - mockVDRRegistry := &vdrmock.MockVDRegistry{} + mockVDRRegistry := &vdrmock.VDRegistry{} loader := testutil.DocumentLoader(t) vc, err := verifiable.ParseCredential( diff --git a/pkg/service/verifypresentation/api.go b/pkg/service/verifypresentation/api.go index f6898cff3..13b0b5031 100644 --- a/pkg/service/verifypresentation/api.go +++ b/pkg/service/verifypresentation/api.go @@ -9,7 +9,7 @@ package verifypresentation import ( "context" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" profileapi "github.com/trustbloc/vcs/pkg/profile" ) diff --git a/pkg/service/verifypresentation/verifypresentation_service.go b/pkg/service/verifypresentation/verifypresentation_service.go index 7320acec5..5d7f1ac48 100644 --- a/pkg/service/verifypresentation/verifypresentation_service.go +++ b/pkg/service/verifypresentation/verifypresentation_service.go @@ -16,10 +16,9 @@ import ( "time" "github.com/hyperledger/aries-framework-go/component/models/ld/validator" - "github.com/hyperledger/aries-framework-go/pkg/doc/jsonld" - jsonutil "github.com/hyperledger/aries-framework-go/pkg/doc/util/json" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" + jsonutil "github.com/hyperledger/aries-framework-go/component/models/util/json" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" "github.com/piprate/json-gold/ld" "github.com/samber/lo" "github.com/trustbloc/logutil-go/pkg/log" @@ -228,8 +227,8 @@ func (s *Service) checkCredentialStrict(ctx context.Context, lazy []*LazyCredent } if err = validator.ValidateJSONLDMap(credMap, - jsonld.WithDocumentLoader(s.documentLoader), - jsonld.WithStrictValidation(true), + validator.WithDocumentLoader(s.documentLoader), + validator.WithStrictValidation(true), ); err != nil { return err } diff --git a/pkg/service/verifypresentation/verifypresentation_service_test.go b/pkg/service/verifypresentation/verifypresentation_service_test.go index 1e72f8782..17da0804c 100644 --- a/pkg/service/verifypresentation/verifypresentation_service_test.go +++ b/pkg/service/verifypresentation/verifypresentation_service_test.go @@ -15,10 +15,10 @@ import ( "testing" "github.com/golang/mock/gomock" - "github.com/hyperledger/aries-framework-go/pkg/doc/sdjwt/common" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - mockvdr "github.com/hyperledger/aries-framework-go/pkg/mock/vdr" + "github.com/hyperledger/aries-framework-go/component/models/sdjwt/common" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + mockvdr "github.com/hyperledger/aries-framework-go/component/vdr/mock" "github.com/piprate/json-gold/ld" "github.com/stretchr/testify/assert" @@ -46,13 +46,13 @@ func TestNew(t *testing.T) { name: "OK", args: args{ config: &Config{ - VDR: &mockvdr.MockVDRegistry{}, + VDR: &mockvdr.VDRegistry{}, DocumentLoader: testutil.DocumentLoader(t), VcVerifier: NewMockVcVerifier(gomock.NewController(t)), }, }, want: &Service{ - vdr: &mockvdr.MockVDRegistry{}, + vdr: &mockvdr.VDRegistry{}, documentLoader: testutil.DocumentLoader(t), vcVerifier: NewMockVcVerifier(gomock.NewController(t)), claimKeys: map[string][]string{}, @@ -310,7 +310,7 @@ func TestService_validatePresentationProof(t *testing.T) { name: "Error empty VDR", fields: fields{ getVDR: func() vdrapi.Registry { - return &mockvdr.MockVDRegistry{} + return &mockvdr.VDRegistry{} }, }, args: args{ @@ -513,7 +513,7 @@ func TestService_validateProofData(t *testing.T) { { name: "Error unresolved did doc", fields: fields{ - vdr: &mockvdr.MockVDRegistry{}, + vdr: &mockvdr.VDRegistry{}, }, args: args{ getVP: func() *verifiable.Presentation { diff --git a/pkg/storage/mongodb/cslindexstore/csl_index_store_test.go b/pkg/storage/mongodb/cslindexstore/csl_index_store_test.go index eb1ec5786..28f11ceaf 100644 --- a/pkg/storage/mongodb/cslindexstore/csl_index_store_test.go +++ b/pkg/storage/mongodb/cslindexstore/csl_index_store_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/assert" diff --git a/pkg/storage/mongodb/cslvcstore/csl_vc_store_test.go b/pkg/storage/mongodb/cslvcstore/csl_vc_store_test.go index 2e976909b..2e33ae838 100644 --- a/pkg/storage/mongodb/cslvcstore/csl_vc_store_test.go +++ b/pkg/storage/mongodb/cslvcstore/csl_vc_store_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/assert" diff --git a/pkg/storage/mongodb/ldstore/context_store.go b/pkg/storage/mongodb/ldstore/context_store.go index af657668b..4bd5846cf 100644 --- a/pkg/storage/mongodb/ldstore/context_store.go +++ b/pkg/storage/mongodb/ldstore/context_store.go @@ -13,8 +13,8 @@ import ( "fmt" "strings" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "github.com/hyperledger/aries-framework-go/spi/storage" jsonld "github.com/piprate/json-gold/ld" "go.mongodb.org/mongo-driver/bson" @@ -29,7 +29,7 @@ const ( contextURLFieldName = "contextURL" ) -var _ ld.ContextStore = (*ContextStore)(nil) +var _ ldstore.ContextStore = (*ContextStore)(nil) type bsonRemoteDocument struct { DocumentURL string `bson:"documentURL,omitempty"` diff --git a/pkg/storage/mongodb/ldstore/context_store_test.go b/pkg/storage/mongodb/ldstore/context_store_test.go index fcf1ead42..99bc9aad4 100644 --- a/pkg/storage/mongodb/ldstore/context_store_test.go +++ b/pkg/storage/mongodb/ldstore/context_store_test.go @@ -18,8 +18,8 @@ import ( "github.com/hyperledger/aries-framework-go/spi/storage" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext/embed" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + "github.com/hyperledger/aries-framework-go/component/models/ld/context/embed" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" jsonld "github.com/piprate/json-gold/ld" diff --git a/pkg/storage/mongodb/ldstore/remote_provider_store.go b/pkg/storage/mongodb/ldstore/remote_provider_store.go index bd544e303..27869e36f 100644 --- a/pkg/storage/mongodb/ldstore/remote_provider_store.go +++ b/pkg/storage/mongodb/ldstore/remote_provider_store.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/store/ld" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" @@ -25,7 +25,7 @@ const ( endpointFieldName = "endpoint" ) -var _ ld.RemoteProviderStore = (*RemoteProviderStore)(nil) +var _ ldstore.RemoteProviderStore = (*RemoteProviderStore)(nil) // RemoteProviderStore is mongodb implementation of remote provider repository. type RemoteProviderStore struct { @@ -81,13 +81,13 @@ func (s *RemoteProviderStore) migrate() error { } // Get returns a remote provider record from DB. -func (s *RemoteProviderStore) Get(id string) (*ld.RemoteProviderRecord, error) { +func (s *RemoteProviderStore) Get(id string) (*ldstore.RemoteProviderRecord, error) { collection := s.mongoClient.Database().Collection(remoteProviderCollectionName) ctxWithTimeout, cancel := s.mongoClient.ContextWithTimeout() defer cancel() - var provider ld.RemoteProviderRecord + var provider ldstore.RemoteProviderRecord if err := collection.FindOne(ctxWithTimeout, bson.D{ @@ -104,7 +104,7 @@ func (s *RemoteProviderStore) Get(id string) (*ld.RemoteProviderRecord, error) { } // GetAll returns all remote provider records from DB. -func (s *RemoteProviderStore) GetAll() ([]ld.RemoteProviderRecord, error) { +func (s *RemoteProviderStore) GetAll() ([]ldstore.RemoteProviderRecord, error) { collection := s.mongoClient.Database().Collection(remoteProviderCollectionName) ctxWithTimeout, cancel := s.mongoClient.ContextWithTimeout() @@ -117,7 +117,7 @@ func (s *RemoteProviderStore) GetAll() ([]ld.RemoteProviderRecord, error) { defer cursor.Close(ctxWithTimeout) //nolint:errcheck - var providers []ld.RemoteProviderRecord + var providers []ldstore.RemoteProviderRecord if err = cursor.All(ctxWithTimeout, &providers); err != nil { return nil, fmt.Errorf("get all providers: %w", err) @@ -128,9 +128,9 @@ func (s *RemoteProviderStore) GetAll() ([]ld.RemoteProviderRecord, error) { // Save creates a new remote provider record and saves it into DB. // If record with given endpoint already exists, it is returned to the caller. -func (s *RemoteProviderStore) Save(endpoint string) (*ld.RemoteProviderRecord, error) { +func (s *RemoteProviderStore) Save(endpoint string) (*ldstore.RemoteProviderRecord, error) { var ( - provider ld.RemoteProviderRecord + provider ldstore.RemoteProviderRecord err error ) @@ -154,7 +154,7 @@ func (s *RemoteProviderStore) Save(endpoint string) (*ld.RemoteProviderRecord, e return &provider, nil } - provider = ld.RemoteProviderRecord{ + provider = ldstore.RemoteProviderRecord{ ID: uuid.New().String(), Endpoint: endpoint, } diff --git a/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store.go b/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store.go index 3452b21f2..17236c6f9 100644 --- a/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store.go +++ b/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store.go @@ -12,7 +12,7 @@ import ( "fmt" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" jsonld "github.com/piprate/json-gold/ld" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" diff --git a/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store_test.go b/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store_test.go index 5e8cd1c17..26ee50d36 100644 --- a/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store_test.go +++ b/pkg/storage/mongodb/oidc4vptxstore/oidc4vp_tx_store_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/require" diff --git a/pkg/storage/mongodb/vcstatusstore/vc_status_store.go b/pkg/storage/mongodb/vcstatusstore/vc_status_store.go index 639a51c05..213ef339a 100644 --- a/pkg/storage/mongodb/vcstatusstore/vc_status_store.go +++ b/pkg/storage/mongodb/vcstatusstore/vc_status_store.go @@ -12,7 +12,7 @@ import ( "fmt" mongodbext "github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/storage/mongodb" "go.mongodb.org/mongo-driver/bson" ) diff --git a/pkg/storage/mongodb/vcstatusstore/vc_status_store_test.go b/pkg/storage/mongodb/vcstatusstore/vc_status_store_test.go index 400e39e1f..b545e20a1 100644 --- a/pkg/storage/mongodb/vcstatusstore/vc_status_store_test.go +++ b/pkg/storage/mongodb/vcstatusstore/vc_status_store_test.go @@ -15,7 +15,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" "github.com/stretchr/testify/assert" diff --git a/pkg/storage/redis/oidc4vptxstore/doc.go b/pkg/storage/redis/oidc4vptxstore/doc.go index 8ba30c209..f97f8f150 100644 --- a/pkg/storage/redis/oidc4vptxstore/doc.go +++ b/pkg/storage/redis/oidc4vptxstore/doc.go @@ -10,7 +10,7 @@ import ( "encoding/json" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" ) type txDocument struct { diff --git a/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store.go b/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store.go index b59717615..27597fc7e 100644 --- a/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store.go +++ b/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store.go @@ -14,7 +14,7 @@ import ( "time" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" jsonld "github.com/piprate/json-gold/ld" redisapi "github.com/redis/go-redis/v9" diff --git a/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store_test.go b/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store_test.go index 2bfd0ee3f..525cb2d36 100644 --- a/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store_test.go +++ b/pkg/storage/redis/oidc4vptxstore/oidc4vp_tx_store_test.go @@ -13,7 +13,7 @@ import ( "time" "github.com/cenkalti/backoff/v4" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" + "github.com/hyperledger/aries-framework-go/component/models/presexch" dctest "github.com/ory/dockertest/v3" dc "github.com/ory/dockertest/v3/docker" redisapi "github.com/redis/go-redis/v9" diff --git a/pkg/storage/s3/cslvcstore/csl_vc_store_test.go b/pkg/storage/s3/cslvcstore/csl_vc_store_test.go index e5f50ccf1..e50436178 100644 --- a/pkg/storage/s3/cslvcstore/csl_vc_store_test.go +++ b/pkg/storage/s3/cslvcstore/csl_vc_store_test.go @@ -20,7 +20,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/internal/testutil" "github.com/trustbloc/vcs/pkg/service/credentialstatus" diff --git a/test/bdd/go.mod b/test/bdd/go.mod index b0f9bafb8..9f5411afb 100644 --- a/test/bdd/go.mod +++ b/test/bdd/go.mod @@ -13,7 +13,10 @@ require ( github.com/greenpau/go-calculator v1.0.1 github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 github.com/hyperledger/aries-framework-go-ext/component/vdr/orb v1.0.0-rc5.0.20221201213446-c4c1e76daa49 + github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20230427134832-0c9969493bd3 + github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 + github.com/hyperledger/aries-framework-go/spi v0.0.0-20230517133327-301aa0597250 github.com/jedib0t/go-pretty/v6 v6.4.6 github.com/ory/fosite v0.44.0 github.com/rdumont/assistdog v0.0.0-20201106100018-168b06230d14 @@ -96,11 +99,8 @@ require ( github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 // indirect github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 // indirect - github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 // indirect github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20221025204933-b807371b6f1e // indirect github.com/hyperledger/aries-framework-go/component/storage/leveldb v0.0.0-20221202141134-083803ecf0a3 // indirect - github.com/hyperledger/aries-framework-go/component/vdr v0.0.0-20230622171716-43af8054a539 // indirect - github.com/hyperledger/aries-framework-go/spi v0.0.0-20230517133327-301aa0597250 // indirect github.com/hyperledger/fabric-amcl v0.0.0-20230602173724-9e02669dceb2 // indirect github.com/hyperledger/ursa-wrapper-go v0.3.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/test/bdd/pkg/bddutil/util.go b/test/bdd/pkg/bddutil/util.go index ed63aef17..9766098ad 100644 --- a/test/bdd/pkg/bddutil/util.go +++ b/test/bdd/pkg/bddutil/util.go @@ -20,14 +20,14 @@ import ( "strings" "time" + docdid "github.com/hyperledger/aries-framework-go/component/models/did" + ldcontext "github.com/hyperledger/aries-framework-go/component/models/ld/context" + lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" + ldprocessor "github.com/hyperledger/aries-framework-go/component/models/ld/processor" + ldstore "github.com/hyperledger/aries-framework-go/component/models/ld/store" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/hyperledger/aries-framework-go/component/storageutil/mem" - docdid "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" - "github.com/hyperledger/aries-framework-go/pkg/doc/ldcontext" - "github.com/hyperledger/aries-framework-go/pkg/doc/signature/jsonld" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - ldstore "github.com/hyperledger/aries-framework-go/pkg/store/ld" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" "github.com/trustbloc/logutil-go/pkg/log" "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" @@ -246,7 +246,7 @@ func CreateCustomPresentation(vcBytes []byte, vdr vdrapi.Registry, } // add linked data proof - err = vp.AddLinkedDataProof(ldpContext, jsonld.WithDocumentLoader(loader)) + err = vp.AddLinkedDataProof(ldpContext, ldprocessor.WithDocumentLoader(loader)) if err != nil { return nil, err } @@ -291,7 +291,7 @@ var extraContexts = []ldcontext.Document{ //nolint:gochecknoglobals }, { URL: "https://w3id.org/citizenship/v1", - DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", //resolvable + DocumentURL: "https://w3c-ccg.github.io/citizenship-vocab/contexts/citizenship-v1.jsonld", // resolvable Content: citizenshipVocab, }, { @@ -331,7 +331,7 @@ func (p *ldStoreProvider) JSONLDRemoteProviderStore() ldstore.RemoteProviderStor } // DocumentLoader returns a JSON-LD document loader with preloaded test contexts. -func DocumentLoader() (*ld.DocumentLoader, error) { +func DocumentLoader() (*lddocloader.DocumentLoader, error) { contextStore, err := ldstore.NewContextStore(mem.NewProvider()) if err != nil { return nil, fmt.Errorf("create JSON-LD context store: %w", err) @@ -347,7 +347,7 @@ func DocumentLoader() (*ld.DocumentLoader, error) { RemoteProviderStore: remoteProviderStore, } - loader, err := ld.NewDocumentLoader(ldStore, ld.WithExtraContexts(extraContexts...)) + loader, err := lddocloader.NewDocumentLoader(ldStore, lddocloader.WithExtraContexts(extraContexts...)) if err != nil { return nil, fmt.Errorf("create document loader: %w", err) } diff --git a/test/bdd/pkg/bddutil/vdrutil/vdrutil.go b/test/bdd/pkg/bddutil/vdrutil/vdrutil.go index 70ea14aaf..454725f58 100644 --- a/test/bdd/pkg/bddutil/vdrutil/vdrutil.go +++ b/test/bdd/pkg/bddutil/vdrutil/vdrutil.go @@ -10,9 +10,9 @@ import ( "fmt" "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" - "github.com/hyperledger/aries-framework-go/pkg/doc/did" - "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - "github.com/hyperledger/aries-framework-go/pkg/kms" + "github.com/hyperledger/aries-framework-go/component/models/did" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + "github.com/hyperledger/aries-framework-go/spi/kms" "github.com/trustbloc/vcs/pkg/doc/vc/crypto" "github.com/trustbloc/vcs/pkg/kms/key" @@ -28,7 +28,7 @@ type keyManager interface { CreateAndExportPubKeyBytes(kt kms.KeyType, opts ...kms.KeyOpts) (string, []byte, error) } -func CreateDID(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager) (*CreateResult, error) { +func CreateDID(keyType kms.KeyType, registry vdrapi.Registry, keyManager keyManager) (*CreateResult, error) { methods, err := newVerMethods(3, keyManager, keyType) // nolint:gomnd if err != nil { return nil, fmt.Errorf("did:orb: failed to create verification methods: %w", err) @@ -79,8 +79,8 @@ func CreateDID(keyType kms.KeyType, registry vdr.Registry, keyManager keyManager didResolution, err := registry.Create( orb.DIDMethod, doc, - vdr.WithOption(orb.UpdatePublicKeyOpt, updateKey), - vdr.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), + vdrapi.WithOption(orb.UpdatePublicKeyOpt, updateKey), + vdrapi.WithOption(orb.RecoveryPublicKeyOpt, recoveryKey), ) if err != nil { diff --git a/test/bdd/pkg/context/context.go b/test/bdd/pkg/context/context.go index 29e60c932..4ec2d297e 100644 --- a/test/bdd/pkg/context/context.go +++ b/test/bdd/pkg/context/context.go @@ -15,9 +15,9 @@ import ( "path/filepath" "github.com/hyperledger/aries-framework-go-ext/component/vdr/orb" - vdrapi "github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr" - vdrpkg "github.com/hyperledger/aries-framework-go/pkg/vdr" - "github.com/hyperledger/aries-framework-go/pkg/vdr/httpbinding" + vdrpkg "github.com/hyperledger/aries-framework-go/component/vdr" + vdrapi "github.com/hyperledger/aries-framework-go/component/vdr/api" + "github.com/hyperledger/aries-framework-go/component/vdr/httpbinding" tlsutils "github.com/trustbloc/cmdutil-go/pkg/utils/tls" "github.com/trustbloc/vcs/pkg/profile" diff --git a/test/bdd/pkg/v1/oidc4vc/oidc4ci.go b/test/bdd/pkg/v1/oidc4vc/oidc4ci.go index c15f699e2..e831372a8 100644 --- a/test/bdd/pkg/v1/oidc4vc/oidc4ci.go +++ b/test/bdd/pkg/v1/oidc4vc/oidc4ci.go @@ -18,7 +18,7 @@ import ( "strings" "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/hyperledger/aries-framework-go/pkg/wallet" "github.com/ory/fosite" "github.com/samber/lo" diff --git a/test/bdd/pkg/v1/oidc4vc/oidc4vp.go b/test/bdd/pkg/v1/oidc4vc/oidc4vp.go index 52ad16a31..da5a492ae 100644 --- a/test/bdd/pkg/v1/oidc4vc/oidc4vp.go +++ b/test/bdd/pkg/v1/oidc4vc/oidc4vp.go @@ -16,8 +16,8 @@ import ( "strings" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/presexch" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/presexch" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/hyperledger/aries-framework-go/pkg/wallet" "github.com/trustbloc/vcs/component/wallet-cli/pkg/walletrunner" diff --git a/test/bdd/pkg/v1/oidc4vc/steps.go b/test/bdd/pkg/v1/oidc4vc/steps.go index f06683466..8d3589e5e 100644 --- a/test/bdd/pkg/v1/oidc4vc/steps.go +++ b/test/bdd/pkg/v1/oidc4vc/steps.go @@ -13,7 +13,7 @@ import ( "github.com/cucumber/godog" - "github.com/hyperledger/aries-framework-go/pkg/doc/ld" + lddocloader "github.com/hyperledger/aries-framework-go/component/models/ld/documentloader" "github.com/trustbloc/vcs/component/wallet-cli/pkg/walletrunner" "github.com/trustbloc/vcs/component/wallet-cli/pkg/walletrunner/vcprovider" @@ -31,7 +31,7 @@ type Steps struct { issuerProfile *profileapi.Issuer verifierProfile *profileapi.Verifier walletRunner *walletrunner.Service - dl *ld.DocumentLoader + dl *lddocloader.DocumentLoader issuedCredentialType string issuedCredentialTemplateID string vpClaimsTransactionID string diff --git a/test/bdd/pkg/v1/oidc4vp/oidc4vp.go b/test/bdd/pkg/v1/oidc4vp/oidc4vp.go index 1b671fb2d..f01df650c 100644 --- a/test/bdd/pkg/v1/oidc4vp/oidc4vp.go +++ b/test/bdd/pkg/v1/oidc4vp/oidc4vp.go @@ -15,7 +15,7 @@ import ( "strings" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/pkg/event/spi" "github.com/trustbloc/vcs/test/bdd/pkg/bddutil" diff --git a/test/bdd/pkg/v1/vc/credential.go b/test/bdd/pkg/v1/vc/credential.go index 5c0a88c13..9db200e4c 100644 --- a/test/bdd/pkg/v1/vc/credential.go +++ b/test/bdd/pkg/v1/vc/credential.go @@ -16,7 +16,7 @@ import ( "github.com/google/uuid" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/vcs/component/wallet-cli/pkg/walletrunner/vcprovider" vcsverifiable "github.com/trustbloc/vcs/pkg/doc/verifiable" "github.com/trustbloc/vcs/test/bdd/pkg/bddutil" diff --git a/test/stress/go.mod b/test/stress/go.mod index 5d3232e56..55e95dfc7 100644 --- a/test/stress/go.mod +++ b/test/stress/go.mod @@ -9,7 +9,7 @@ go 1.21 require ( github.com/google/uuid v1.3.0 github.com/greenpau/go-calculator v1.0.1 - github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 + github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 github.com/imroc/req/v3 v3.34.0 github.com/joho/godotenv v1.4.0 github.com/labstack/echo/v4 v4.9.0 @@ -83,6 +83,7 @@ require ( github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/henvic/httpretty v0.1.0 // indirect + github.com/hyperledger/aries-framework-go v0.3.3-0.20230810150537-71e132ba5968 // indirect github.com/hyperledger/aries-framework-go-ext/component/storage/mongodb v0.0.0-20220728172020-0a8903e45149 // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/jwk v0.0.0-20221213152252-f0c83a5a922c // indirect github.com/hyperledger/aries-framework-go-ext/component/vdr/longform v0.0.0-20221201213446-c4c1e76daa49 // indirect @@ -91,7 +92,6 @@ require ( github.com/hyperledger/aries-framework-go/component/didconfig v0.0.0-20230622211121-852ce35730b4 // indirect github.com/hyperledger/aries-framework-go/component/kmscrypto v0.0.0-20230622082138-3ffab1691857 // indirect github.com/hyperledger/aries-framework-go/component/log v0.0.0-20230427134832-0c9969493bd3 // indirect - github.com/hyperledger/aries-framework-go/component/models v0.0.0-20230810150537-71e132ba5968 // indirect github.com/hyperledger/aries-framework-go/component/storage/edv v0.0.0-20221025204933-b807371b6f1e // indirect github.com/hyperledger/aries-framework-go/component/storage/leveldb v0.0.0-20221202141134-083803ecf0a3 // indirect github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20230427134832-0c9969493bd3 // indirect diff --git a/test/stress/pkg/stress/stress_test_case.go b/test/stress/pkg/stress/stress_test_case.go index 542a6d8c2..21996e560 100644 --- a/test/stress/pkg/stress/stress_test_case.go +++ b/test/stress/pkg/stress/stress_test_case.go @@ -15,7 +15,7 @@ import ( "net/http" "time" - "github.com/hyperledger/aries-framework-go/pkg/doc/verifiable" + "github.com/hyperledger/aries-framework-go/component/models/verifiable" "github.com/trustbloc/logutil-go/pkg/log" "github.com/trustbloc/vcs/component/wallet-cli/pkg/walletrunner"