From 16ccdd62cdb2031cf5c5146e5cc5bbbe7bae2c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jordi=20Gim=C3=A9nez?= Date: Wed, 4 Oct 2023 12:57:10 +0200 Subject: [PATCH] chore: Update iden3 libraries to v2 (#494) * chore: Upgrade project dependencies and some small tweaks needed by changes in dependencies * chore: Iden3 libraries upgraded to v2 * chore: go mod tidy --- cmd/notifications/main.go | 14 +- cmd/pending_publisher/main.go | 18 +- cmd/platform/main.go | 17 +- cmd/platform_ui/main.go | 35 +- go.mod | 215 ++++---- go.sum | 495 +++++++++--------- internal/api/api.gen.go | 43 +- internal/api/main_test.go | 18 +- internal/api/server.go | 26 +- internal/api/server_test.go | 36 +- internal/api_ui/api.gen.go | 83 +-- internal/api_ui/main_test.go | 18 +- internal/api_ui/responses.go | 12 +- internal/api_ui/server.go | 10 +- internal/api_ui/server_test.go | 198 +++---- internal/common/common.go | 2 +- internal/common/schemahash.go | 23 + internal/common/util.go | 25 +- internal/config/config.go | 14 +- internal/core/domain/IdentityMerkleTrees.go | 6 +- internal/core/domain/agent.go | 2 +- internal/core/domain/claim.go | 6 +- internal/core/domain/connection.go | 6 +- internal/core/domain/identity.go | 4 +- internal/core/domain/identity_state.go | 6 +- internal/core/domain/link.go | 16 +- internal/core/domain/notification.go | 2 +- internal/core/domain/proof.go | 2 +- internal/core/domain/revocation.go | 4 +- internal/core/domain/schema.go | 7 +- internal/core/ports/claims_repository.go | 22 +- internal/core/ports/claims_service.go | 38 +- internal/core/ports/connections_repository.go | 14 +- internal/core/ports/connections_service.go | 12 +- .../ports/identity_merkletree_repository.go | 4 +- internal/core/ports/identity_repository.go | 10 +- internal/core/ports/identity_service.go | 29 +- .../core/ports/identity_state_repository.go | 8 +- internal/core/ports/link_repository.go | 8 +- internal/core/ports/link_service.go | 18 +- internal/core/ports/mt_service.go | 4 +- internal/core/ports/notification_service.go | 2 +- internal/core/ports/proof_service.go | 4 +- internal/core/ports/publisher.go | 6 +- internal/core/ports/revocation_repository.go | 4 +- internal/core/ports/revocation_service.go | 6 +- internal/core/ports/schema_repository.go | 6 +- internal/core/ports/schema_service.go | 8 +- internal/core/ports/session_repository.go | 2 +- internal/core/services/claims.go | 54 +- internal/core/services/connections.go | 16 +- internal/core/services/identity.go | 71 ++- internal/core/services/link.go | 30 +- internal/core/services/mt.go | 4 +- internal/core/services/notification.go | 10 +- internal/core/services/proof.go | 87 +-- internal/core/services/revocation.go | 13 +- internal/core/services/schema.go | 18 +- internal/core/services/tests/identity_test.go | 25 +- internal/core/services/tests/link_test.go | 41 +- internal/core/services/tests/main_test.go | 8 + .../core/services/tests/notification_test.go | 10 +- internal/core/services/tests/schema_test.go | 13 +- internal/core/services/zk_native.go | 2 +- ...304121507181_add_linid_to_claims_table.sql | 3 +- internal/db/tests/claims_fixture.go | 6 +- internal/gateways/notification.go | 2 +- internal/gateways/publisher.go | 30 +- internal/gateways/publisher_gateway.go | 14 +- internal/jsonschema/schema.go | 43 +- internal/jsonschema/schema_test.go | 5 +- internal/kms/kms.go | 20 +- internal/kms/vaultPluginIden3KeyProvider.go | 12 +- .../kms/vaultPluginIden3KeyProvider_test.go | 5 +- internal/kms/vault_bjj_key_provider.go | 8 +- internal/kms/vault_bjj_key_provider_test.go | 11 +- internal/kms/vault_providers_helpers.go | 6 +- internal/loader/loader.go | 4 + internal/repositories/claims.go | 26 +- internal/repositories/connections.go | 20 +- internal/repositories/identity.go | 18 +- internal/repositories/identity_state.go | 8 +- internal/repositories/link_repository.go | 8 +- internal/repositories/mt.go | 4 +- internal/repositories/revocation.go | 4 +- internal/repositories/schema-inmemory.go | 6 +- internal/repositories/schema.go | 9 +- internal/repositories/session.go | 2 +- internal/repositories/tests/claims_test.go | 41 +- .../repositories/tests/connections_test.go | 36 +- internal/repositories/tests/link_test.go | 68 +-- internal/repositories/tests/mt_test.go | 6 +- internal/repositories/tests/schema_test.go | 40 +- pkg/blockchain/eth/client.go | 4 +- .../signature/circuit/signer/signer.go | 7 +- pkg/loaders/circuits.go | 2 +- pkg/notifications/messages.go | 4 +- pkg/notifications/push.go | 2 +- pkg/protocol/packagemanager.go | 12 +- pkg/protocol/verify.go | 4 +- pkg/schema/schema.go | 32 +- 101 files changed, 1281 insertions(+), 1221 deletions(-) create mode 100644 internal/common/schemahash.go diff --git a/cmd/notifications/main.go b/cmd/notifications/main.go index 75ca69d88..38446059d 100644 --- a/cmd/notifications/main.go +++ b/cmd/notifications/main.go @@ -8,6 +8,8 @@ import ( "syscall" "github.com/hashicorp/vault/api" + "github.com/iden3/go-schema-processor/v2/loaders" + shell "github.com/ipfs/go-ipfs-api" "github.com/polygonid/sh-id-platform/internal/buildinfo" "github.com/polygonid/sh-id-platform/internal/config" @@ -17,7 +19,6 @@ import ( "github.com/polygonid/sh-id-platform/internal/db" "github.com/polygonid/sh-id-platform/internal/gateways" "github.com/polygonid/sh-id-platform/internal/kms" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/internal/redis" @@ -121,12 +122,9 @@ func newCredentialsService(cfg *config.Configuration, storage *db.Storage, cache } rhsp := reverse_hash.NewRhsPublisher(nil, false) - var schemaLoader loader.Factory - if cfg.SchemaCache == nil || !*cfg.SchemaCache { - schemaLoader = loader.HTTPFactory - } else { - schemaLoader = loader.CachedFactory(loader.HTTPFactory, cachex) - } + + // TODO: Cache only if cfg.APIUI.SchemaCache == true + schemaLoader := loaders.NewDocumentLoader(shell.NewShell(cfg.IPFS.GatewayURL), cfg.IPFS.GatewayURL) mtService := services.NewIdentityMerkleTrees(mtRepository) qrService := services.NewQrStoreService(cachex) @@ -135,7 +133,7 @@ func newCredentialsService(cfg *config.Configuration, storage *db.Storage, cache RHSEnabled: cfg.ReverseHashService.Enabled, RHSUrl: cfg.ReverseHashService.URL, Host: cfg.ServerUrl, - }, ps, cfg.IFPS.GatewayURL) + }, ps, cfg.IPFS.GatewayURL) return claimsService, nil } diff --git a/cmd/pending_publisher/main.go b/cmd/pending_publisher/main.go index 9f8e27a05..27cb8ac3e 100644 --- a/cmd/pending_publisher/main.go +++ b/cmd/pending_publisher/main.go @@ -10,6 +10,8 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/ethclient" + "github.com/iden3/go-schema-processor/v2/loaders" + shell "github.com/ipfs/go-ipfs-api" "github.com/polygonid/sh-id-platform/internal/buildinfo" "github.com/polygonid/sh-id-platform/internal/config" @@ -18,14 +20,13 @@ import ( "github.com/polygonid/sh-id-platform/internal/db" "github.com/polygonid/sh-id-platform/internal/gateways" "github.com/polygonid/sh-id-platform/internal/kms" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/internal/redis" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/blockchain/eth" "github.com/polygonid/sh-id-platform/pkg/cache" - "github.com/polygonid/sh-id-platform/pkg/loaders" + circuitLoaders "github.com/polygonid/sh-id-platform/pkg/loaders" "github.com/polygonid/sh-id-platform/pkg/pubsub" "github.com/polygonid/sh-id-platform/pkg/reverse_hash" ) @@ -72,11 +73,8 @@ func main() { } }(storage) - var schemaLoader loader.Factory - schemaLoader = loader.MultiProtocolFactory(cfg.IFPS.GatewayURL) - if cfg.APIUI.SchemaCache != nil && *cfg.APIUI.SchemaCache { - schemaLoader = loader.CachedFactory(schemaLoader, cachex) - } + // TODO: Cache only if cfg.APIUI.SchemaCache == true + schemaLoader := loaders.NewDocumentLoader(shell.NewShell(cfg.IPFS.GatewayURL), cfg.IPFS.GatewayURL) vaultCli, err := providers.VaultClient(ctx, providers.Config{ UserPassAuthEnabled: cfg.VaultUserPassAuthEnabled, @@ -135,7 +133,7 @@ func main() { RHSEnabled: cfg.ReverseHashService.Enabled, RHSUrl: cfg.ReverseHashService.URL, Host: cfg.ServerUrl, - }, ps, cfg.IFPS.GatewayURL) + }, ps, cfg.IPFS.GatewayURL) commonClient, err := ethclient.Dial(cfg.Ethereum.URL) if err != nil { @@ -154,7 +152,7 @@ func main() { WaitBlockCycleTime: cfg.Ethereum.WaitBlockCycleTime, }) - circuitsLoaderService := loaders.NewCircuits(cfg.Circuit.Path) + circuitsLoaderService := circuitLoaders.NewCircuits(cfg.Circuit.Path) proofService := initProofService(ctx, cfg, circuitsLoaderService) transactionService, err := gateways.NewTransaction(cl, cfg.Ethereum.ConfirmationBlockCount) @@ -190,7 +188,7 @@ func main() { log.Info(ctx, "Finished") } -func initProofService(ctx context.Context, config *config.Configuration, circuitLoaderService *loaders.Circuits) ports.ZKGenerator { +func initProofService(ctx context.Context, config *config.Configuration, circuitLoaderService *circuitLoaders.Circuits) ports.ZKGenerator { log.Info(ctx, "native prover enabled", "enabled", config.NativeProofGenerationEnabled) if config.NativeProofGenerationEnabled { proverConfig := &services.NativeProverConfig{ diff --git a/cmd/platform/main.go b/cmd/platform/main.go index cfe39834b..b9d998bfa 100644 --- a/cmd/platform/main.go +++ b/cmd/platform/main.go @@ -13,7 +13,9 @@ import ( chiMiddleware "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/cors" redis2 "github.com/go-redis/redis/v8" + "github.com/iden3/go-schema-processor/v2/loaders" proof "github.com/iden3/merkletree-proof" + shell "github.com/ipfs/go-ipfs-api" "github.com/polygonid/sh-id-platform/internal/api" "github.com/polygonid/sh-id-platform/internal/buildinfo" @@ -24,14 +26,13 @@ import ( "github.com/polygonid/sh-id-platform/internal/gateways" "github.com/polygonid/sh-id-platform/internal/health" "github.com/polygonid/sh-id-platform/internal/kms" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/internal/providers/blockchain" "github.com/polygonid/sh-id-platform/internal/redis" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/cache" - "github.com/polygonid/sh-id-platform/pkg/loaders" + circuitLoaders "github.com/polygonid/sh-id-platform/pkg/loaders" "github.com/polygonid/sh-id-platform/pkg/protocol" "github.com/polygonid/sh-id-platform/pkg/pubsub" "github.com/polygonid/sh-id-platform/pkg/reverse_hash" @@ -71,11 +72,9 @@ func main() { ps := pubsub.NewRedis(rdb) ps.WithLogger(log.Error) cachex := cache.NewRedisCache(rdb) - var schemaLoader loader.Factory - schemaLoader = loader.MultiProtocolFactory(cfg.IFPS.GatewayURL) - if cfg.APIUI.SchemaCache != nil && *cfg.APIUI.SchemaCache { - schemaLoader = loader.CachedFactory(schemaLoader, cachex) - } + + // TODO: Cache only if cfg.APIUI.SchemaCache == true + schemaLoader := loaders.NewDocumentLoader(shell.NewShell(cfg.IPFS.GatewayURL), cfg.IPFS.GatewayURL) vaultCli, err := providers.VaultClient(ctx, providers.Config{ UserPassAuthEnabled: cfg.VaultUserPassAuthEnabled, @@ -112,7 +111,7 @@ func main() { return } - circuitsLoaderService := loaders.NewCircuits(cfg.Circuit.Path) + circuitsLoaderService := circuitLoaders.NewCircuits(cfg.Circuit.Path) rhsp := reverse_hash.NewRhsPublisher(nil, false) if cfg.ReverseHashService.Enabled { @@ -137,7 +136,7 @@ func main() { RHSEnabled: cfg.ReverseHashService.Enabled, RHSUrl: cfg.ReverseHashService.URL, Host: cfg.ServerUrl, - }, ps, cfg.IFPS.GatewayURL) + }, ps, cfg.IPFS.GatewayURL) proofService := gateways.NewProver(ctx, cfg, circuitsLoaderService) revocationService := services.NewRevocationService(ethConn, common.HexToAddress(cfg.Ethereum.ContractAddress)) zkProofService := services.NewProofService(claimsService, revocationService, identityService, mtService, claimsRepository, keyStore, storage, stateContract, schemaLoader) diff --git a/cmd/platform_ui/main.go b/cmd/platform_ui/main.go index 59c70430a..6af66e593 100644 --- a/cmd/platform_ui/main.go +++ b/cmd/platform_ui/main.go @@ -14,12 +14,14 @@ import ( chiMiddleware "github.com/go-chi/chi/v5/middleware" "github.com/go-chi/cors" redis2 "github.com/go-redis/redis/v8" - auth "github.com/iden3/go-iden3-auth" - authLoaders "github.com/iden3/go-iden3-auth/loaders" - "github.com/iden3/go-iden3-auth/pubsignals" - "github.com/iden3/go-iden3-auth/state" - core "github.com/iden3/go-iden3-core" + auth "github.com/iden3/go-iden3-auth/v2" + authLoaders "github.com/iden3/go-iden3-auth/v2/loaders" + "github.com/iden3/go-iden3-auth/v2/pubsignals" + "github.com/iden3/go-iden3-auth/v2/state" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/loaders" proof "github.com/iden3/merkletree-proof" + shell "github.com/ipfs/go-ipfs-api" "github.com/polygonid/sh-id-platform/internal/api_ui" "github.com/polygonid/sh-id-platform/internal/buildinfo" @@ -31,14 +33,13 @@ import ( "github.com/polygonid/sh-id-platform/internal/gateways" "github.com/polygonid/sh-id-platform/internal/health" "github.com/polygonid/sh-id-platform/internal/kms" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/internal/providers/blockchain" "github.com/polygonid/sh-id-platform/internal/redis" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/cache" - "github.com/polygonid/sh-id-platform/pkg/loaders" + circuitLoaders "github.com/polygonid/sh-id-platform/pkg/loaders" "github.com/polygonid/sh-id-platform/pkg/protocol" "github.com/polygonid/sh-id-platform/pkg/pubsub" "github.com/polygonid/sh-id-platform/pkg/reverse_hash" @@ -79,11 +80,8 @@ func main() { ps.WithLogger(log.Error) cachex := cache.NewRedisCache(rdb) - var schemaLoader loader.Factory - schemaLoader = loader.MultiProtocolFactory(cfg.IFPS.GatewayURL) - if cfg.APIUI.SchemaCache != nil && *cfg.APIUI.SchemaCache { - schemaLoader = loader.CachedFactory(schemaLoader, cachex) - } + // TODO: Cache only if cfg.APIUI.SchemaCache == true + schemaLoader := loaders.NewDocumentLoader(shell.NewShell(cfg.IPFS.GatewayURL), cfg.IPFS.GatewayURL) vaultCli, err := providers.VaultClient(ctx, providers.Config{ UserPassAuthEnabled: cfg.VaultUserPassAuthEnabled, @@ -134,13 +132,14 @@ func main() { }, } - verifier, err := auth.NewVerifierWithExplicitError(verificationKeyLoader, authLoaders.DefaultSchemaLoader{IpfsURL: cfg.IFPS.GatewayURL}, resolvers) + verifier, err := auth.NewVerifier(verificationKeyLoader, resolvers) if err != nil { log.Error(ctx, "failed init verifier", "err", err) return } - circuitsLoaderService := loaders.NewCircuits(cfg.Circuit.Path) + circuitsLoaderService := circuitLoaders.NewCircuits(cfg.Circuit.Path) + proofService := gateways.NewProver(ctx, cfg, circuitsLoaderService) rhsp := reverse_hash.NewRhsPublisher(nil, false) if cfg.ReverseHashService.Enabled { @@ -170,10 +169,10 @@ func main() { RHSEnabled: cfg.ReverseHashService.Enabled, RHSUrl: cfg.ReverseHashService.URL, Host: cfg.APIUI.ServerURL, - }, ps, cfg.IFPS.GatewayURL) + }, ps, cfg.IPFS.GatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, qrService, claimsRepository, linkRepository, schemaRepository, schemaLoader, sessionRepository, ps, cfg.IFPS.GatewayURL) - proofService := gateways.NewProver(ctx, cfg, circuitsLoaderService) + linkService := services.NewLinkService(storage, claimsService, qrService, claimsRepository, linkRepository, schemaRepository, schemaLoader, sessionRepository, ps, cfg.IPFS.GatewayURL) + revocationService := services.NewRevocationService(ethConn, common.HexToAddress(cfg.Ethereum.ContractAddress)) zkProofService := services.NewProofService(claimsService, revocationService, identityService, mtService, claimsRepository, keyStore, storage, stateContract, schemaLoader) transactionService, err := gateways.NewTransaction(ethereumClient, cfg.Ethereum.ConfirmationBlockCount) @@ -250,7 +249,7 @@ func main() { log.Info(ctx, "Shutting down") } -func identifierExists(ctx context.Context, did *core.DID, service ports.IdentityService) bool { +func identifierExists(ctx context.Context, did *w3c.DID, service ports.IdentityService) bool { _, err := service.GetByDID(ctx, *did) return err == nil } diff --git a/go.mod b/go.mod index 102757e76..61790a4ce 100644 --- a/go.mod +++ b/go.mod @@ -3,93 +3,103 @@ module github.com/polygonid/sh-id-platform go 1.20 require ( - github.com/alicebob/miniredis/v2 v2.30.1 - github.com/deepmap/oapi-codegen v1.13.4 - github.com/ethereum/go-ethereum v1.11.5 - github.com/getkin/kin-openapi v0.118.0 + github.com/alicebob/miniredis/v2 v2.30.5 + github.com/deepmap/oapi-codegen v1.15.0 + github.com/ethereum/go-ethereum v1.13.0 + github.com/getkin/kin-openapi v0.120.0 github.com/go-chi/chi/v5 v5.0.10 github.com/go-chi/cors v1.2.1 github.com/go-redis/cache/v8 v8.4.4 github.com/go-redis/redis/v8 v8.11.5 - github.com/golangci/golangci-lint v1.52.2 - github.com/google/uuid v1.3.0 - github.com/hashicorp/go-retryablehttp v0.7.2 - github.com/hashicorp/vault/api v1.9.2 - github.com/hashicorp/vault/api/auth/userpass v0.4.1 - github.com/iden3/contracts-abi/state/go/abi v1.0.0-beta.3 - github.com/iden3/go-circuits v1.0.3 - github.com/iden3/go-iden3-auth v1.2.0 - github.com/iden3/go-iden3-core v1.0.2 + github.com/golangci/golangci-lint v1.54.2 + github.com/google/uuid v1.3.1 + github.com/hashicorp/go-retryablehttp v0.7.4 + github.com/hashicorp/vault/api v1.10.0 + github.com/hashicorp/vault/api/auth/userpass v0.5.0 + github.com/iden3/contracts-abi/state/go/abi v1.0.1 + github.com/iden3/go-circuits/v2 v2.0.0 + github.com/iden3/go-iden3-auth/v2 v2.0.0-beta.2 + github.com/iden3/go-iden3-core/v2 v2.0.0 github.com/iden3/go-iden3-crypto v0.0.15 - github.com/iden3/go-jwz v1.0.0 + github.com/iden3/go-jwz/v2 v2.0.0 github.com/iden3/go-merkletree-sql/db/pgx/v2 v2.0.5 - github.com/iden3/go-merkletree-sql/v2 v2.0.5 + github.com/iden3/go-merkletree-sql/v2 v2.0.6 github.com/iden3/go-rapidsnark/prover v0.0.10 github.com/iden3/go-rapidsnark/witness v0.0.6 github.com/iden3/go-schema-processor v1.3.1 - github.com/iden3/iden3comm v1.0.1-0.20230609100900-191d60f4f566 + github.com/iden3/go-schema-processor/v2 v2.0.1 + github.com/iden3/iden3comm/v2 v2.0.0 github.com/iden3/merkletree-proof v0.0.3 - github.com/ipfs/go-ipfs-api v0.6.0 - github.com/jackc/pgconn v1.14.0 + github.com/ipfs/go-ipfs-api v0.7.0 + github.com/jackc/pgconn v1.14.1 github.com/jackc/pgtype v1.14.0 github.com/jackc/pgx/v4 v4.18.1 github.com/jmoiron/sqlx v1.3.5 github.com/joho/godotenv v1.5.1 github.com/labstack/gommon v0.4.0 - github.com/lib/pq v1.10.7 + github.com/lib/pq v1.10.9 github.com/mitchellh/mapstructure v1.5.0 github.com/mr-tron/base58 v1.2.0 + github.com/oapi-codegen/runtime v1.0.0 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/piprate/json-gold v0.5.1-0.20230111113000-6ddbe6e6f19f github.com/pkg/errors v0.9.1 - github.com/pressly/goose/v3 v3.10.0 - github.com/spf13/viper v1.15.0 + github.com/pressly/goose/v3 v3.15.0 + github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 + golang.org/x/crypto v0.13.0 + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 ) require ( 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect 4d63.com/gochecknoglobals v0.2.1 // indirect - github.com/Abirdcfly/dupword v0.0.11 // indirect - github.com/Antonboom/errname v0.1.9 // indirect - github.com/Antonboom/nilnil v0.1.3 // indirect - github.com/BurntSushi/toml v1.2.1 // indirect + github.com/4meepo/tagalign v1.3.2 // indirect + github.com/Abirdcfly/dupword v0.0.12 // indirect + github.com/Antonboom/errname v0.1.12 // indirect + github.com/Antonboom/nilnil v0.1.7 // indirect + github.com/BurntSushi/toml v1.3.2 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect github.com/Masterminds/semver v1.5.0 // indirect - github.com/OpenPeeDeeP/depguard v1.1.1 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect github.com/VictoriaMetrics/fastcache v1.12.1 // indirect + github.com/alexkohler/nakedret/v2 v2.0.2 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect github.com/alingse/asasalint v0.0.11 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect - github.com/ashanbrown/forbidigo v1.5.1 // indirect + github.com/ashanbrown/forbidigo v1.6.0 // indirect github.com/ashanbrown/makezero v1.1.1 // indirect github.com/benbjohnson/clock v1.3.5 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bkielbasa/cyclop v1.2.0 // indirect + github.com/bits-and-blooms/bitset v1.5.0 // indirect + github.com/bkielbasa/cyclop v1.2.1 // indirect + github.com/blang/semver/v4 v4.0.0 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bombsimon/wsl/v3 v3.4.0 // indirect - github.com/breml/bidichk v0.2.4 // indirect - github.com/breml/errchkjson v0.3.1 // indirect + github.com/breml/bidichk v0.2.6 // indirect + github.com/breml/errchkjson v0.3.5 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/butuzov/ireturn v0.1.1 // indirect - github.com/bytedance/sonic v1.10.0-rc3 // indirect + github.com/butuzov/ireturn v0.2.0 // indirect + github.com/butuzov/mirror v1.1.0 // indirect + github.com/ccojocar/zxcvbn-go v1.0.1 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect - github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 // indirect - github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect - github.com/chenzhuoyu/iasm v0.9.0 // indirect + github.com/chavacava/garif v0.1.0 // indirect github.com/cockroachdb/errors v1.9.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230309163202-51422ae2d449 // indirect + github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 // indirect github.com/cockroachdb/redact v1.1.3 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.10.0 // indirect github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect + github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/daixiang0/gci v0.10.1 // indirect + github.com/daixiang0/gci v0.11.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dchest/blake512 v1.0.0 // indirect github.com/deckarep/golang-set/v2 v2.3.0 // indirect @@ -98,24 +108,19 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 // indirect github.com/esimonov/ifshort v1.0.4 // indirect + github.com/ethereum/c-kzg-4844 v0.3.1 // indirect github.com/ettle/strcase v0.1.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/firefart/nonamedreturns v1.0.4 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/gabriel-vasile/mimetype v1.4.2 // indirect github.com/getsentry/sentry-go v0.19.0 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/gin-gonic/gin v1.9.1 // indirect - github.com/go-critic/go-critic v0.7.0 // indirect + github.com/go-critic/go-critic v0.9.0 // indirect github.com/go-jose/go-jose/v3 v3.0.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/swag v0.22.4 // indirect - github.com/go-playground/locales v0.14.1 // indirect - github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.14.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect @@ -130,18 +135,18 @@ require ( github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.4 // indirect + github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.4.0 // indirect - github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect + github.com/golangci/misspell v0.4.1 // indirect + github.com/golangci/revgrep v0.5.0 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 // indirect + github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect @@ -159,13 +164,16 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect - github.com/holiman/uint256 v1.2.2 // indirect + github.com/holiman/uint256 v1.2.3 // indirect + github.com/iden3/go-iden3-core v1.0.2 // indirect github.com/iden3/go-rapidsnark/types v0.0.3 // indirect github.com/iden3/go-rapidsnark/verifier v0.0.5 // indirect + github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 // indirect + github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e // indirect github.com/iden3/wasmer-go v0.0.1 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/yaml v0.2.0 // indirect - github.com/ipfs/boxo v0.10.2 // indirect + github.com/ipfs/boxo v0.12.0 // indirect github.com/ipfs/go-cid v0.4.1 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect github.com/jackc/pgio v1.0.0 // indirect @@ -173,13 +181,11 @@ require ( github.com/jackc/pgproto3/v2 v2.3.2 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle v1.3.0 // indirect - github.com/jgautheron/goconst v1.5.1 // indirect + github.com/jgautheron/goconst v1.6.0 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect github.com/julz/importas v0.1.0 // indirect - github.com/junk1tm/musttag v0.5.0 // indirect github.com/kisielk/errcheck v1.6.3 // indirect github.com/kisielk/gotool v1.0.0 // indirect github.com/kkHAIKE/contextcheck v1.1.4 // indirect @@ -188,18 +194,16 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.6 // indirect + github.com/kunwardeep/paralleltest v1.0.8 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect - github.com/labstack/echo/v4 v4.11.1 // indirect github.com/ldez/gomoddirectives v0.2.3 // indirect - github.com/ldez/tagliatelle v0.4.0 // indirect - github.com/leodido/go-urn v1.2.4 // indirect + github.com/ldez/tagliatelle v0.5.0 // indirect github.com/leonklingele/grouper v1.1.1 // indirect github.com/lestrrat-go/blackmagic v1.0.1 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/httprc v1.0.4 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect - github.com/lestrrat-go/jwx/v2 v2.0.9-0.20230429214153-5090ec1bd2cd // indirect + github.com/lestrrat-go/jwx/v2 v2.0.12 // indirect github.com/lestrrat-go/option v1.0.1 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-flow-metrics v0.1.0 // indirect @@ -215,118 +219,115 @@ require ( github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.1 // indirect + github.com/mgechev/revive v1.3.3 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/moricho/tparallel v0.3.1 // indirect github.com/multiformats/go-base32 v0.1.0 // indirect github.com/multiformats/go-base36 v0.2.0 // indirect - github.com/multiformats/go-multiaddr v0.10.1 // indirect + github.com/multiformats/go-multiaddr v0.11.0 // indirect github.com/multiformats/go-multibase v0.2.0 // indirect github.com/multiformats/go-multicodec v0.9.0 // indirect github.com/multiformats/go-multihash v0.2.3 // indirect github.com/multiformats/go-multistream v0.4.1 // indirect github.com/multiformats/go-varint v0.0.7 // indirect github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect - github.com/nishanths/exhaustive v0.9.5 // indirect + github.com/nishanths/exhaustive v0.11.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.9.0 // indirect + github.com/nunnatsa/ginkgolinter v0.13.5 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/gomega v1.27.8 // indirect - github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/pelletier/go-toml/v2 v2.1.0 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.4.0 // indirect + github.com/polyfloyd/go-errorlint v1.4.4 // indirect github.com/pquerna/cachecontrol v0.1.0 // indirect - github.com/prometheus/client_golang v1.14.0 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.4.0 // indirect - github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect - github.com/quasilyte/go-ruleguard v0.3.19 // indirect + github.com/prometheus/common v0.44.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect + github.com/quasilyte/go-ruleguard v0.4.0 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/ryancurrah/gomodguard v1.3.0 // indirect - github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect + github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.23.0 // indirect - github.com/securego/gosec/v2 v2.15.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect + github.com/securego/gosec/v2 v2.17.0 // indirect + github.com/segmentio/asm v1.2.0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/shirou/gopsutil v3.21.11+incompatible // indirect - github.com/sirupsen/logrus v1.9.0 // indirect - github.com/sivchari/containedctx v1.0.2 // indirect + github.com/sirupsen/logrus v1.9.3 // indirect + github.com/sivchari/containedctx v1.0.3 // indirect github.com/sivchari/nosnakecase v1.7.0 // indirect github.com/sivchari/tenv v1.7.1 // indirect github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/spf13/afero v1.9.5 // indirect - github.com/spf13/cast v1.5.0 // indirect - github.com/spf13/cobra v1.6.1 // indirect + github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/cobra v1.7.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.1 // indirect - github.com/subosito/gotenv v1.4.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.11 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.11 // indirect - github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e // indirect + github.com/tetafro/godot v1.4.14 // indirect + github.com/tetratelabs/wazero v1.5.0 // indirect + github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/twitchyliquid64/golang-asm v0.15.1 // indirect - github.com/ugorji/go/codec v1.2.11 // indirect - github.com/ultraware/funlen v0.0.3 // indirect + github.com/ultraware/funlen v0.1.0 // indirect github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.0.6 // indirect + github.com/uudashr/gocognit v1.0.7 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect github.com/vmihailenco/go-tinylfu v0.2.2 // indirect github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b // indirect + github.com/xen0n/gosmopolitan v1.2.2 // indirect github.com/yagipy/maintidx v1.0.0 // indirect github.com/yeya24/promlinter v0.2.0 // indirect + github.com/ykadowak/zerologlint v0.1.3 // indirect github.com/yuin/gopher-lua v1.1.0 // indirect - github.com/yusufpapurcu/wmi v1.2.2 // indirect - gitlab.com/bosi/decorder v0.2.3 // indirect - go.uber.org/atomic v1.11.0 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect + gitlab.com/bosi/decorder v0.4.1 // indirect + go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.24.0 // indirect - golang.org/x/arch v0.4.0 // indirect - golang.org/x/crypto v0.11.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 // indirect + go.uber.org/zap v1.25.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/mod v0.12.0 // indirect - golang.org/x/net v0.12.0 // indirect + golang.org/x/net v0.15.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.11.1 // indirect + golang.org/x/tools v0.13.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.4.3 // indirect + honnef.co/go/tools v0.4.5 // indirect lukechampine.com/blake3 v1.2.1 // indirect - mvdan.cc/gofumpt v0.4.0 // indirect + mvdan.cc/gofumpt v0.5.0 // indirect mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect + mvdan.cc/unparam v0.0.0-20230815095028-f7c6fb1088f0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index a195610fd..0d4e6364c 100644 --- a/go.sum +++ b/go.sum @@ -40,16 +40,18 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Abirdcfly/dupword v0.0.11 h1:z6v8rMETchZXUIuHxYNmlUAuKuB21PeaSymTed16wgU= -github.com/Abirdcfly/dupword v0.0.11/go.mod h1:wH8mVGuf3CP5fsBTkfWwwwKTjDnVVCxtU8d8rgeVYXA= +github.com/4meepo/tagalign v1.3.2 h1:1idD3yxlRGV18VjqtDbqYvQ5pXqQS0wO2dn6M3XstvI= +github.com/4meepo/tagalign v1.3.2/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= +github.com/Abirdcfly/dupword v0.0.12 h1:56NnOyrXzChj07BDFjeRA+IUzSz01jmzEq+G4kEgFhc= +github.com/Abirdcfly/dupword v0.0.12/go.mod h1:+us/TGct/nI9Ndcbcp3rgNcQzctTj68pq7TcgNpLfdI= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/Antonboom/errname v0.1.9 h1:BZDX4r3l4TBZxZ2o2LNrlGxSHran4d1u4veZdoORTT4= -github.com/Antonboom/errname v0.1.9/go.mod h1:nLTcJzevREuAsgTbG85UsuiWpMpAqbKD1HNZ29OzE58= -github.com/Antonboom/nilnil v0.1.3 h1:6RTbx3d2mcEu3Zwq9TowQpQMVpP75zugwOtqY1RTtcE= -github.com/Antonboom/nilnil v0.1.3/go.mod h1:iOov/7gRcXkeEU+EMGpBu2ORih3iyVEiWjeste1SJm8= +github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= +github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= +github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= +github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= +github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo= @@ -57,14 +59,16 @@ github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 h1:+r1rSv4gvYn0wmRjC8X7IAzX8QezqtFV9m0MUHFJgts= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0/go.mod h1:b3g59n2Y+T5xmcxJL+UEG2f8cQploZm1mR/v6BW0mU0= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 h1:3ZBs7LAezy8gh0uECsA6CGU43FF3zsx5f4eah5FxTMA= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0/go.mod h1:rZLTje5A9kFBe0pzhpe2TdhRniBF++PRHQuRpR8esVc= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/OpenPeeDeeP/depguard v1.1.1 h1:TSUznLjvp/4IUP+OQ0t/4jF4QUyxIcVX8YnghZdunyA= -github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= +github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= @@ -75,12 +79,14 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/nakedret/v2 v2.0.2 h1:qnXuZNvv3/AxkAb22q/sEsEpcA99YxLFACDtEw9TPxE= +github.com/alexkohler/nakedret/v2 v2.0.2/go.mod h1:2b8Gkk0GsOrqQv/gPWjNLDSKwG8I5moSXG1K4VIBcTQ= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= -github.com/alicebob/miniredis/v2 v2.30.1 h1:HM1rlQjq1bm9yQcsawJqSZBJ9AYgxvjkMsNtddh90+g= -github.com/alicebob/miniredis/v2 v2.30.1/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/alicebob/miniredis/v2 v2.30.5 h1:3r6kTHdKnuP4fkS8k2IrvSfxpxUTcW1SOL0wN7b7Dt0= +github.com/alicebob/miniredis/v2 v2.30.5/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= @@ -89,8 +95,8 @@ github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7D github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/ashanbrown/forbidigo v1.5.1 h1:WXhzLjOlnuDYPYQo/eFlcFMi8X/kLfvWLYu6CSoebis= -github.com/ashanbrown/forbidigo v1.5.1/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= +github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= +github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= @@ -101,28 +107,32 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bkielbasa/cyclop v1.2.0 h1:7Jmnh0yL2DjKfw28p86YTd/B4lRGcNuu12sKE35sM7A= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= +github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8= +github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= +github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= +github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= +github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= -github.com/breml/bidichk v0.2.4 h1:i3yedFWWQ7YzjdZJHnPo9d/xURinSq3OM+gyM43K4/8= -github.com/breml/bidichk v0.2.4/go.mod h1:7Zk0kRFt1LIZxtQdl9W9JwGAcLTTkOs+tN7wuEYGJ3s= -github.com/breml/errchkjson v0.3.1 h1:hlIeXuspTyt8Y/UmP5qy1JocGNR00KQHgfaNtRAjoxQ= -github.com/breml/errchkjson v0.3.1/go.mod h1:XroxrzKjdiutFyW3nWhw34VGg7kiMsDQox73yWCGI2U= +github.com/breml/bidichk v0.2.6 h1:m++e3nzqd4OwgJKFAuNpROkGB5QJFXCTD5/3TEFCfqc= +github.com/breml/bidichk v0.2.6/go.mod h1:Uj07vpi03vZf+TJRNaBzUIcAe/dQ+POeJiuikz/b6Gs= +github.com/breml/errchkjson v0.3.5 h1:KoiihlE4u+DR1Iq5KloYMFAlQ0UAryuSzc0bkvUgCeQ= +github.com/breml/errchkjson v0.3.5/go.mod h1:0ip+8RwJ/ojc1Qkn0YIBqM7A8wnh6GRs/VJx9t9CohE= github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/butuzov/ireturn v0.1.1 h1:QvrO2QF2+/Cx1WA/vETCIYBKtRjc30vesdoPUNo1EbY= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.0-rc3 h1:uNSnscRapXTwUgTyOF0GVljYD08p9X/Lbr9MweSV3V0= -github.com/bytedance/sonic v1.10.0-rc3/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= +github.com/butuzov/ireturn v0.2.0 h1:kCHi+YzC150GE98WFuZQu9yrTn6GEydO2AuPLbTgnO4= +github.com/butuzov/ireturn v0.2.0/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= +github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= +github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= +github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= @@ -134,15 +144,9 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8 h1:W9o46d2kbNL06lq7UNDPV0zYLzkrde/bjIqO02eoll0= -github.com/chavacava/garif v0.0.0-20230227094218-b8c73b2037b8/go.mod h1:gakxgyXaaPkxvLw1XQxNGK4I37ys9iBRzNUx/B7pUCo= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 h1:SKI1/fuSdodxmNNyVBR8d7X/HuLnRpvvFO0AgyQk764= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -152,18 +156,22 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= -github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= github.com/cockroachdb/errors v1.9.1/go.mod h1:2sxOtL2WIc096WSZqZ5h8fa17rdDq9HZOZLBCor4mBk= github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230309163202-51422ae2d449 h1:eSpFD9gBOKKQVKULeH59qsmxg1K+YW3E7eDRC+tnHU8= -github.com/cockroachdb/pebble v0.0.0-20230309163202-51422ae2d449/go.mod h1:9lRMC4XN3/BLPtIp6kAKwIaHu369NOf2rMucPzipz50= +github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 h1:T+Np/xtzIjYM/P5NAw0e2Rf1FGvzDau1h54MKvx8G7w= +github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ= github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.10.0 h1:zRh22SR7o4K35SoNqouS9J/TKHTyU2QWaj5ldehyXtA= +github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnxoKK5nVyZKd+/KhU= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -175,12 +183,14 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHH github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 h1:HVTnpeuvF6Owjd5mniCL8DEXo7uYXdQEmOP4FJbV5tg= github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= +github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= +github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/daixiang0/gci v0.10.1 h1:eheNA3ljF6SxnPD/vE4lCBusVHmV3Rs3dkKvFrJ7MR0= -github.com/daixiang0/gci v0.10.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= +github.com/daixiang0/gci v0.11.1 h1:7UWAchVmYRlULYrkjQUaXX6mpigekVid20xaGo1vKLc= +github.com/daixiang0/gci v0.11.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -192,8 +202,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5il github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/deepmap/oapi-codegen v1.13.4 h1:lRRQ8JAXaz5/4oidKFyk3fFZFQsbv0BzRtvDKDnvIfM= -github.com/deepmap/oapi-codegen v1.13.4/go.mod h1:/h5nFQbTAMz4S/WtBz8sBfamlGByYKDr21O2uoNgCYI= +github.com/deepmap/oapi-codegen v1.15.0 h1:SQqViaeb4k2vMul8gx12oDOIadEtoRqTdLkxjzqtQ90= +github.com/deepmap/oapi-codegen v1.15.0/go.mod h1:a6KoHV7lMRwsPoEg2C6NDHiXYV3EQfiFocOlJ8dgJQE= github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= @@ -204,7 +214,6 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564 h1:I6KUy4CI6hHjqnyJLNCEi7YHVMkwwtfSr2k9splgdSM= github.com/dustinxie/ecc v0.0.0-20210511000915-959544187564/go.mod h1:yekO+3ZShy19S+bsmnERmznGy9Rfg6dWWWpiGJjNAz8= -github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -216,8 +225,10 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= -github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= -github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= +github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= +github.com/ethereum/c-kzg-4844 v0.3.1/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.13.0 h1:dZALM0PlDTtNITTECPiqSrFo0iEYVDfby+mSVc0LxIs= +github.com/ethereum/go-ethereum v1.13.0/go.mod h1:0TDsBNJ7j8jR01vKpk4j2zfVKyAbQuKzy6wLwb5ZMuU= github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= @@ -231,35 +242,29 @@ github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4 github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= -github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= -github.com/getkin/kin-openapi v0.118.0 h1:z43njxPmJ7TaPpMSCQb7PN0dEYno4tyBPQcrFdHoLuM= -github.com/getkin/kin-openapi v0.118.0/go.mod h1:l5e9PaFUo9fyLJCPGQeXI2ML8c3P8BHOEV2VaAVf/pc= +github.com/getkin/kin-openapi v0.120.0 h1:MqJcNJFrMDFNc07iwE8iFC5eT2k/NPUFDIpNeiZv8Jg= +github.com/getkin/kin-openapi v0.120.0/go.mod h1:PCWw/lfBrJY4HcdqE3jj+QFkaFK8ABoqo7PvqVhXXqw= github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.19.0 h1:BcCH3CN5tXt5aML+gwmbFwVptLLQA+eT866fCO9wVOM= github.com/getsentry/sentry-go v0.19.0/go.mod h1:y3+lGEFEFexZtpbG1GUE2WD/f9zGyKYwpEqryTOC/nE= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.10 h1:rLz5avzKpjqxrYwXNfmjkrYYXOyLJd37pz53UFHC6vk= github.com/go-chi/chi/v5 v5.0.10/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= -github.com/go-critic/go-critic v0.7.0 h1:tqbKzB8pqi0NsRZ+1pyU4aweAF7A7QN0Pi4Q02+rYnQ= -github.com/go-critic/go-critic v0.7.0/go.mod h1:moYzd7GdVXE2C2hYTwd7h0CPcqlUeclsyBRwMa38v64= +github.com/go-critic/go-critic v0.9.0 h1:Pmys9qvU3pSML/3GEQ2Xd9RZ/ip+aXHKILuxczKGV/U= +github.com/go-critic/go-critic v0.9.0/go.mod h1:5P8tdXL7m/6qnyG6oRAlYLORvoXH0WDypYgAEmagT40= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -277,26 +282,17 @@ github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= -github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= -github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= -github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/cache/v8 v8.4.4 h1:Rm0wZ55X22BA2JMqVtRQNHYyzDd0I5f+Ec/C9Xx3mXY= github.com/go-redis/cache/v8 v8.4.4/go.mod h1:JM6CkupsPvAu/LYEVGQy6UB4WDAzQSXkR0lUCbeIcKc= github.com/go-redis/redis/v8 v8.11.3/go.mod h1:xNJ9xDG09FsIPwh3bWdk+0oDWHbtF9rPN0F/oD9XeKc= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= @@ -304,7 +300,6 @@ github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg78 github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= -github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= @@ -335,6 +330,7 @@ github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -375,8 +371,9 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= +github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= @@ -385,16 +382,16 @@ github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6 github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 h1:amWTbTGqOZ71ruzrdA+Nx5WA3tV1N0goTspwmKCQvBY= github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2/go.mod h1:9wOXstvyDRshQ9LggQuzBCGysxs3b6Uo/1MvYCR2NMs= -github.com/golangci/golangci-lint v1.52.2 h1:FrPElUUI5rrHXg1mQ7KxI1MXPAw5lBVskiz7U7a8a1A= -github.com/golangci/golangci-lint v1.52.2/go.mod h1:S5fhC5sHM5kE22/HcATKd1XLWQxX+y7mHj8B5H91Q/0= +github.com/golangci/golangci-lint v1.54.2 h1:oR9zxfWYxt7hFqk6+fw6Enr+E7F0SN2nqHhJYyIb0yo= +github.com/golangci/golangci-lint v1.54.2/go.mod h1:vnsaCTPKCI2wreL9tv7RkHDwUrz3htLjed6+6UsvcwU= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.4.0 h1:KtVB/hTK4bbL/S6bs64rYyk8adjmh1BygbBiaAiX+a0= -github.com/golangci/misspell v0.4.0/go.mod h1:W6O/bwV6lGDxUCChm2ykw9NQdd5bYd1Xkjo88UcWyJc= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 h1:DIPQnGy2Gv2FSA4B/hh8Q7xx3B7AIDk3DAMeHclH1vQ= -github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6/go.mod h1:0AKcRCkMoKvUvlf89F6O7H2LYdhr1zBh736mBItOdRs= +github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= +github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= +github.com/golangci/revgrep v0.5.0 h1:GGBqHFtFOeHiSUQtFVZXPJtVZYOGB4iVlAjaoFRBQvY= +github.com/golangci/revgrep v0.5.0/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -432,16 +429,16 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= +github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 h1:9alfqbrhuD+9fLZ4iaAVwhlp5PEhmnBt7yvK2Oy5C1U= -github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 h1:mrEEilTAUmaAORhssPPkxj84TsHrPMLBGW2Z4SoTxm8= +github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -471,8 +468,8 @@ github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHh github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= @@ -491,37 +488,40 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.9.2 h1:YjkZLJ7K3inKgMZ0wzCU9OHqc+UqMQyXsPXnf3Cl2as= -github.com/hashicorp/vault/api v1.9.2/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= -github.com/hashicorp/vault/api/auth/userpass v0.4.1 h1:k/OJOeFqPWdp3H4buyjRF2nPMdgk2qLnEqAAUkDQikU= -github.com/hashicorp/vault/api/auth/userpass v0.4.1/go.mod h1:PJJd/rurbT65M1nNu9LesRyCb9HI3ywfE10hVeO7gEA= +github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= +github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= +github.com/hashicorp/vault/api/auth/userpass v0.5.0 h1:u//BC15YJviWSpeTlxsmt96FPULsCF7dYhPHg5oOAzo= +github.com/hashicorp/vault/api/auth/userpass v0.5.0/go.mod h1:TNxl3X6ZaeILi1rfxP/mhGnWuiCiP7SNv2qeZ5aSAMQ= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.2.2 h1:TXKcSGc2WaxPD2+bmzAsVthL4+pEN0YwXcL5qED83vk= -github.com/holiman/uint256 v1.2.2/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= +github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/iden3/contracts-abi/state/go/abi v1.0.0-beta.3 h1:ZHFnK2dU3NJglY+igY48JLHWtNGN/Vhf5/L/qrFk/tM= -github.com/iden3/contracts-abi/state/go/abi v1.0.0-beta.3/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= -github.com/iden3/go-circuits v1.0.3 h1:mZqHvuXIAjCQdwRFiq2472KYfKHtzomYoKu0BtF3+5c= -github.com/iden3/go-circuits v1.0.3/go.mod h1:YbuzfvSyr8BwNHnjRJEvnRQ2lJKzVQ9Sgz3OAdqv5Is= -github.com/iden3/go-iden3-auth v1.2.0 h1:4Eyybrp7zWRRRTHNMTRrk1KqeTSpJWUONYprIWn2a/4= -github.com/iden3/go-iden3-auth v1.2.0/go.mod h1:U4cIskebspRrtg1I3WAbT3mKVb4w83xmXRPqiVBnji0= +github.com/iden3/contracts-abi/state/go/abi v1.0.1 h1:FsaLJSy3NSyJl5k1yfDxc5DhUHRY7Z/UCj0/1YueMrY= +github.com/iden3/contracts-abi/state/go/abi v1.0.1/go.mod h1:TxgIrXCvxms3sbOdsy8kTvffUCIpEEifNy0fSXdkU4w= +github.com/iden3/go-circuits/v2 v2.0.0 h1:Bw0mpsqeip06d6I2ktgfhTVB7Jk9mSHi8myHZWkoc6w= +github.com/iden3/go-circuits/v2 v2.0.0/go.mod h1:VIFIp51+IH0hOzjnKhb84bCeyq7hq76zX/C14ua6zh4= +github.com/iden3/go-iden3-auth/v2 v2.0.0-beta.2 h1:r5vjH+MyPFzaJ7U62SO5Gz9N9O0RZfDORNHVd9JymNg= +github.com/iden3/go-iden3-auth/v2 v2.0.0-beta.2/go.mod h1:bYr47aev7sh23RL7Ru+TQQSlYDS94+wO8P8SDrwdifc= github.com/iden3/go-iden3-core v1.0.2 h1:HwNDFeqcUv4ybZj5tH+58JKWKarn/qqBpNCqTLxGP0Y= github.com/iden3/go-iden3-core v1.0.2/go.mod h1:X4PjlJG8OsEQEsSbzzYqqAk2olYGZ2nuGqiUPyEYjOo= +github.com/iden3/go-iden3-core/v2 v2.0.0 h1:sQEuuq3RLfyYSY8qPiqxQ6YBpGbiAwepHJD/vjf1adA= +github.com/iden3/go-iden3-core/v2 v2.0.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= github.com/iden3/go-iden3-crypto v0.0.15 h1:4MJYlrot1l31Fzlo2sF56u7EVFeHHJkxGXXZCtESgK4= github.com/iden3/go-iden3-crypto v0.0.15/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= -github.com/iden3/go-jwz v1.0.0 h1:tRyAMK9unf21z8uNvJ8V2LFvXdlYZe7pgRE7V19Q/vs= -github.com/iden3/go-jwz v1.0.0/go.mod h1:vX0kANbDvoNUAevlWyU1UDVQ0PWgplOK0YK1+8BaOz4= +github.com/iden3/go-jwz/v2 v2.0.0 h1:VsU2PrmcchPMx/V0IhamMZRNjiQYZoyJopO8K8uSZOY= +github.com/iden3/go-jwz/v2 v2.0.0/go.mod h1:JBJ58Cef8h+4Uz8qaVRsNjiT/Ubqb800dGKTZt66NkU= github.com/iden3/go-merkletree-sql/db/pgx/v2 v2.0.5 h1:CKry110riXxBu1bM9vhdPia37tlbqoKYg0s0dwGA4l4= github.com/iden3/go-merkletree-sql/db/pgx/v2 v2.0.5/go.mod h1:J17cXiT4pBP/c5FWN4nv0J7q2yT9I8JSzUfdIKyZIj4= -github.com/iden3/go-merkletree-sql/v2 v2.0.5 h1:fgIocQMTrK0KQ9jJFyOmwQhEfnchxHXrMMUTs2OPE30= -github.com/iden3/go-merkletree-sql/v2 v2.0.5/go.mod h1:kRhHKYpui5DUsry5RpveP6IC4XMe6iApdV9VChRYuEk= +github.com/iden3/go-merkletree-sql/v2 v2.0.6 h1:vsVDImnvnHf7Ggr45ptFOXJyWNA/8IwVQO1jzRLUlY8= +github.com/iden3/go-merkletree-sql/v2 v2.0.6/go.mod h1:kRhHKYpui5DUsry5RpveP6IC4XMe6iApdV9VChRYuEk= github.com/iden3/go-rapidsnark/prover v0.0.10 h1:NvOfRPpex/k646UsqOcUy7a7uVl17t4ok9kWvpQg4+k= github.com/iden3/go-rapidsnark/prover v0.0.10/go.mod h1:wgDsmKOGCuWGtgVtuW9ARWNguNr4NJAIyg2G7+uTax0= github.com/iden3/go-rapidsnark/types v0.0.3 h1:f0s1Qdut1qHe1O67+m+xUVRBPwSXnq5j0xSrBi0jqM4= @@ -530,27 +530,32 @@ github.com/iden3/go-rapidsnark/verifier v0.0.5 h1:J7y0ovrEjDQoWtZmlrp4tgGng1A9fa github.com/iden3/go-rapidsnark/verifier v0.0.5/go.mod h1:KgL3Yr9NehlFDI4EIWVLE3UDUi8ulyjbp7HcXSBfiGI= github.com/iden3/go-rapidsnark/witness v0.0.6 h1:p+6QBymSV3XWm1kB2PL2vlXxKXJN8GyWuqNJv/0PGGU= github.com/iden3/go-rapidsnark/witness v0.0.6/go.mod h1:57IHQpnvx0CeS6cAT07oN/lqwT5LRc4zicYoZ1cnAPE= +github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 h1:mkY6VDfwKVJc83QGKmwVXY2LYepidPrFAxskrjr8UCs= +github.com/iden3/go-rapidsnark/witness/v2 v2.0.0/go.mod h1:3JRjqUfW1hgI9hzLDO0v8z/DUkR0ZUehhYLlnIfRxnA= +github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e h1:WeiFCrpj5pLRtSA4Mg03yTrSZhHHqN/k5b6bwxd9/tY= +github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e/go.mod h1:UEBifEzw62T6VzIHJeHuUgeLg2U/J9ttf7hOwQEqnYk= github.com/iden3/go-schema-processor v1.3.1 h1:LJfFInfYGMOp0bTKKC17R8q4XI+VtqhFLPTEqnOIvlM= github.com/iden3/go-schema-processor v1.3.1/go.mod h1:NwJ1nuGdRlCFaN1/V6mS0AOAdvpLcGf4KKq0mluLG7U= -github.com/iden3/iden3comm v1.0.1-0.20230609100900-191d60f4f566 h1:jZBYVc3D+wN2jCaD8Z4KyhOF3OFuIdV1G5hW0G0+HoE= -github.com/iden3/iden3comm v1.0.1-0.20230609100900-191d60f4f566/go.mod h1:1bJHz0xNhwbQGDxYfVwMVYsdsMjFQRkHJF/eq5Rc9wE= +github.com/iden3/go-schema-processor/v2 v2.0.1 h1:eh54MdgEm+Au9LZzFpx56YxW342t3H/tgJAPgm6iR8A= +github.com/iden3/go-schema-processor/v2 v2.0.1/go.mod h1:eWRQDbxixZ/9k/uPlciKIy6TUYlKX/6hdqyTuAQi3wE= +github.com/iden3/iden3comm/v2 v2.0.0 h1:cFDfF6aJ589ENg5zlTBEPK6Qqv4I11C/gliAWZORpyY= +github.com/iden3/iden3comm/v2 v2.0.0/go.mod h1:wrXoxi8eoQSLopatRW5+hYF9lDRvzGL2As9ZE88q/kA= github.com/iden3/merkletree-proof v0.0.3 h1:01fSpjv2JIwVBYqV7ugLm0gjF+yo0aw41zDTWP5+81s= github.com/iden3/merkletree-proof v0.0.3/go.mod h1:cNPG00p4ALlIXnRFmM1T2zy4547jV8cgyOZsObDrORg= github.com/iden3/wasmer-go v0.0.1 h1:TZKh8Se8B/73PvWrcu+FTU9L1k5XYAmtFbioj7l0Uog= github.com/iden3/wasmer-go v0.0.1/go.mod h1:ZnZBAO012M7o+Q1INXLRIxKQgEcH2FuwL0Iga8A4ufg= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/invopop/yaml v0.1.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= -github.com/ipfs/boxo v0.10.2 h1:kspw9HmMyKzLQxpKk417sF69i6iuf50AXtRjFqCYyL4= -github.com/ipfs/boxo v0.10.2/go.mod h1:1qgKq45mPRCxf4ZPoJV2lnXxyxucigILMJOrQrVivv8= +github.com/ipfs/boxo v0.12.0 h1:AXHg/1ONZdRQHQLgG5JHsSC3XoE4DjCAMgK+asZvUcQ= +github.com/ipfs/boxo v0.12.0/go.mod h1:xAnfiU6PtxWCnRqu7dcXQ10bB5/kvI1kXRotuGqGBhg= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= -github.com/ipfs/go-ipfs-api v0.6.0 h1:JARgG0VTbjyVhO5ZfesnbXv9wTcMvoKRBLF1SzJqzmg= -github.com/ipfs/go-ipfs-api v0.6.0/go.mod h1:iDC2VMwN9LUpQV/GzEeZ2zNqd8NUdRmWcFM+K/6odf0= +github.com/ipfs/go-ipfs-api v0.7.0 h1:CMBNCUl0b45coC+lQCXEVpMhwoqjiaCwUIrM+coYW2Q= +github.com/ipfs/go-ipfs-api v0.7.0/go.mod h1:AIxsTNB0+ZhkqIfTZpdZ0VR/cpX5zrXjATa3prSay3g= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk= @@ -566,8 +571,9 @@ github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsU github.com/jackc/pgconn v1.8.0/go.mod h1:1C2Pb36bGIP9QHGBYCjnyhqu7Rv3sGshaQUvmfGIB/o= github.com/jackc/pgconn v1.9.0/go.mod h1:YctiPyvzfU11JFxoXokUOOKQXQmDMoJL9vJzHH8/2JY= github.com/jackc/pgconn v1.9.1-0.20210724152538-d89c8390a530/go.mod h1:4z2w8XhRbP1hYxkpTuBjTS3ne3J48K83+u0zoyvg2pI= -github.com/jackc/pgconn v1.14.0 h1:vrbA9Ud87g6JdFWkHTJXppVce58qPIdP7N8y0Ml/A7Q= github.com/jackc/pgconn v1.14.0/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= +github.com/jackc/pgconn v1.14.1 h1:smbxIaZA08n6YuxEX1sDyjV/qkbtUtkH20qLkR9MUR4= +github.com/jackc/pgconn v1.14.1/go.mod h1:9mBNlny0UvkgJdCDvdVHYSjI+8tD2rnKK69Wz8ti++E= github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= @@ -606,8 +612,8 @@ github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dv github.com/jackc/puddle v1.3.0 h1:eHK/5clGOatcjX3oWGBO/MpxpbHzSwud5EWTSCI+MX0= github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= -github.com/jgautheron/goconst v1.5.1 h1:HxVbL1MhydKs8R8n/HE5NPvzfaYmQJA3o879lE4+WcM= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jgautheron/goconst v1.6.0 h1:gbMLWKRMkzAc6kYsQL6/TxaoBUg3Jm9LSF/Ih1ADWGA= +github.com/jgautheron/goconst v1.6.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= @@ -623,7 +629,6 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -633,8 +638,6 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/junk1tm/musttag v0.5.0 h1:bV1DTdi38Hi4pG4OVWa7Kap0hi0o7EczuK6wQt9zPOM= -github.com/junk1tm/musttag v0.5.0/go.mod h1:PcR7BA+oREQYvHwgjIDmw3exJeds5JzRcvEJTfjrA0M= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= @@ -655,10 +658,8 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -675,24 +676,20 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.6 h1:FCKYMF1OF2+RveWlABsdnmsvJrei5aoyZoaGS+Ugg8g= -github.com/kunwardeep/paralleltest v1.0.6/go.mod h1:Y0Y0XISdZM5IKm3TREQMZ6iteqn1YuwCsJO/0kL9Zes= +github.com/kunwardeep/paralleltest v1.0.8 h1:Ul2KsqtzFxTlSU7IP0JusWlLiNqQaloB9vguyjbE558= +github.com/kunwardeep/paralleltest v1.0.8/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= -github.com/labstack/echo/v4 v4.11.1 h1:dEpLU2FLg4UVmvCGPuk/APjlH6GDpbEPti61srUUUs4= -github.com/labstack/echo/v4 v4.11.1/go.mod h1:YuYRTSM3CHs2ybfrL8Px48bO6BAnYIN4l8wSTMP6BDQ= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.4.0 h1:sylp7d9kh6AdXN2DpVGHBRb5guTVAgOxqNGhbqc4b1c= -github.com/ldez/tagliatelle v0.4.0/go.mod h1:mNtTfrHy2haaBAw+VT7IBV6VXBThS7TCreYWbBcJ87I= +github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= +github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= github.com/lestrrat-go/blackmagic v1.0.1 h1:lS5Zts+5HIC/8og6cGHb0uCcNCa3OUt1ygh3Qz2Fe80= @@ -703,8 +700,8 @@ github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJG github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo= github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI= github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4= -github.com/lestrrat-go/jwx/v2 v2.0.9-0.20230429214153-5090ec1bd2cd h1:jzU4xunmLFc7uF97O5PhEFmAuiRSuG7/RKrX2gkKWeY= -github.com/lestrrat-go/jwx/v2 v2.0.9-0.20230429214153-5090ec1bd2cd/go.mod h1:6etqt12jS77WEY6WPM9nmnIaG6fMo5yQmtTSqB2eLk4= +github.com/lestrrat-go/jwx/v2 v2.0.12 h1:3d589+5w/b9b7S3DneICPW16AqTyYXB7VRjgluSDWeA= +github.com/lestrrat-go/jwx/v2 v2.0.12/go.mod h1:Mq4KN1mM7bp+5z/W5HS8aCNs5RKZ911G/0y2qUjAQuQ= github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU= github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= @@ -712,8 +709,8 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= -github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= +github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= +github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= @@ -725,8 +722,6 @@ github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xq github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -771,8 +766,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfr github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= -github.com/mgechev/revive v1.3.1 h1:OlQkcH40IB2cGuprTPcjB0iIUddgVZgGmDX3IAMR8D4= -github.com/mgechev/revive v1.3.1/go.mod h1:YlD6TTWl2B8A103R9KWJSPVI9DrEf+oqr15q21Ld+5I= +github.com/mgechev/revive v1.3.3 h1:GUWzV3g185agbHN4ZdaQvR6zrLVYTUSA2ktvIinivK0= +github.com/mgechev/revive v1.3.3/go.mod h1:NhpOtVtDbjYNDj697eDUBTobijCDHQKar4HDKc0TuTo= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= @@ -785,12 +780,13 @@ github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= @@ -803,8 +799,8 @@ github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aG github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI= github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0= github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4= -github.com/multiformats/go-multiaddr v0.10.1 h1:HghtFrWyZEPrpTvgAMFJi6gFdgHfs2cb0pyfDsk+lqU= -github.com/multiformats/go-multiaddr v0.10.1/go.mod h1:jLEZsA61rwWNZQTHHnqq2HNa+4os/Hz54eqiRnsRqYQ= +github.com/multiformats/go-multiaddr v0.11.0 h1:XqGyJ8ufbCE0HmTDwx2kPdsrQ36AGPZNZX6s6xfJH10= +github.com/multiformats/go-multiaddr v0.11.0/go.mod h1:gWUm0QLR4thQ6+ZF6SXUw8YjtwQSPapICM+NmCkxHSM= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= @@ -823,17 +819,17 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 h1:4kuARK6Y6FxaNu/BnU2OAaLF86eTVhP2hjTB6iMvItA= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= -github.com/nishanths/exhaustive v0.9.5 h1:TzssWan6orBiLYVqewCG8faud9qlFntJE30ACpzmGME= -github.com/nishanths/exhaustive v0.9.5/go.mod h1:IbwrGdVMizvDcIxPYGVdQn5BqWJaOwpCvg4RGb8r/TA= +github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8pzda2l0= +github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.9.0 h1:Sm0zX5QfjJzkeCjEp+t6d3Ha0jwvoDjleP9XCsrEzOA= -github.com/nunnatsa/ginkgolinter v0.9.0/go.mod h1:FHaMLURXP7qImeH6bvxWJUpyH+2tuqe5j4rW1gxJRmI= +github.com/nunnatsa/ginkgolinter v0.13.5 h1:fOsPB4CEZOPkyMqF4B9hoqOpooFWU7vWSVkCSscVpgU= +github.com/nunnatsa/ginkgolinter v0.13.5/go.mod h1:OBHy4536xtuX3102NM63XRtOyxqZOO02chsaeDWXVO8= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= +github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/olomix/go-test-pg v1.0.2 h1:4ey3mFBhPx93PdgyshOJI1WrQzqzkWEnb0wL/7UbFMI= @@ -847,8 +843,7 @@ github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.27.8 h1:gegWiwZjBsf2DgiSbf5hpokZ98JVDMcWkUiigk6/KXc= -github.com/onsi/gomega v1.27.8/go.mod h1:2J8vzI/s+2shY9XHRApDkdgPo1TKT7P2u6fXeJKFnNQ= +github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= @@ -858,9 +853,8 @@ github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/perimeterx/marshmallow v1.1.4/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -875,20 +869,20 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.4.0 h1:b+sQ5HibPIAjEZwtuwU8Wz/u0dMZ7YL+bk+9yWyHVJk= -github.com/polyfloyd/go-errorlint v1.4.0/go.mod h1:qJCkPeBn+0EXkdKTrUCcuFStM2xrDKfxI3MGLXPexUs= +github.com/polyfloyd/go-errorlint v1.4.4 h1:A9gytp+p6TYqeALTYRoxJESYP8wJRETRX2xzGWFsEBU= +github.com/polyfloyd/go-errorlint v1.4.4/go.mod h1:ry5NqF7l9Q77V+XqAfUg1zfryrEtyac3G5+WVpIK0xU= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.1.0 h1:yJMy84ti9h/+OEWa752kBTKv4XC30OtVVHYv/8cTqKc= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= -github.com/pressly/goose/v3 v3.10.0 h1:Gn5E9CkPqTtWvfaDVqtJqMjYtsrZ9K5mU/8wzTsvg04= -github.com/pressly/goose/v3 v3.10.0/go.mod h1:c5D3a7j66cT0fhRPj7KsXolfduVrhLlxKZjmCVSey5w= +github.com/pressly/goose/v3 v3.15.0 h1:6tY5aDqFknY6VZkorFGgZtWygodZQxfmmEF4rqyJW9k= +github.com/pressly/goose/v3 v3.15.0/go.mod h1:LlIo3zGccjb/YUgG+Svdb9Er14vefRdlDI7URCDrwYo= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= -github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -899,17 +893,17 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= -github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= +github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= -github.com/quasilyte/go-ruleguard v0.3.19 h1:tfMnabXle/HzOb5Xe9CUZYWXKfkS1KwRmZyPmD9nVcc= -github.com/quasilyte/go-ruleguard v0.3.19/go.mod h1:lHSn69Scl48I7Gt9cX3VrbsZYvYiBYszZOZW4A+oTEw= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= +github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= @@ -936,8 +930,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= -github.com/ryanrolds/sqlclosecheck v0.4.0 h1:i8SX60Rppc1wRuyQjMciLqIzV3xnoHB7/tXbr6RGYNI= -github.com/ryanrolds/sqlclosecheck v0.4.0/go.mod h1:TBRRjzL31JONc9i4XMinicuo+s+E8yKZ5FN8X3G6CKQ= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= @@ -947,12 +941,14 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.3.0 h1:uIkTLo0AGRc8l7h5l9r+GcYi9qfVP github.com/santhosh-tekuri/jsonschema/v5 v5.3.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.23.0 h1:01h+/2Kd+NblNItNeux0veSL5cBF1jbEOPrEhDzGYq0= -github.com/sashamelentyev/usestdlibvars v1.23.0/go.mod h1:YPwr/Y1LATzHI93CqoPUN/2BzGQ/6N/cl/KwgR0B/aU= +github.com/sashamelentyev/usestdlibvars v1.24.0 h1:MKNzmXtGh5N0y74Z/CIaJh4GlB364l0K1RUT08WSWAc= +github.com/sashamelentyev/usestdlibvars v1.24.0/go.mod h1:9cYkq+gYJ+a5W2RPdhfaSCnTVUC1OQP/bSiiBhq3OZE= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= -github.com/securego/gosec/v2 v2.15.0 h1:v4Ym7FF58/jlykYmmhZ7mTm7FQvN/setNm++0fgIAtw= -github.com/securego/gosec/v2 v2.15.0/go.mod h1:VOjTrZOkUtSDt2QLSJmQBMWnvwiQPEjg0l+5juIqGk8= +github.com/securego/gosec/v2 v2.17.0 h1:ZpAStTDKY39insEG9OH6kV3IkhQZPTq9a9eGOLOjcdI= +github.com/securego/gosec/v2 v2.17.0/go.mod h1:lt+mgC91VSmriVoJLentrMkRCYs+HLTBnUFUBuhV2hc= +github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= +github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= @@ -968,10 +964,10 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.2 h1:0hLQKpgC53OVF1VT7CeoFHk9YKstur1XOgfYIc1yrHI= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= +github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= @@ -988,11 +984,11 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= -github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1000,8 +996,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU= -github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA= +github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc= +github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= @@ -1015,7 +1011,6 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1029,8 +1024,10 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8= -github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.11 h1:LyU6FolezeWAhvQk0k6O/d49jqgO52MSDDfYgbeoEm4= +github.com/supranational/blst v0.3.11/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= @@ -1041,39 +1038,37 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.11 h1:BVoBIqAf/2QdbFmSwAWnaIqDivZdOV0ZRwEm6jivLKw= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e h1:MV6KaVu/hzByHP0UvJ4HcMGE/8a6A4Rggc/0wx2AvJo= -github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= +github.com/tetafro/godot v1.4.14 h1:ScO641OHpf9UpHPk8fCknSuXNMpi4iFlwuWoBs3L+1s= +github.com/tetafro/godot v1.4.14/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetratelabs/wazero v1.5.0 h1:Yz3fZHivfDiZFUXnWMPUoiW7s8tC1sjdBtlJn08qYa0= +github.com/tetratelabs/wazero v1.5.0/go.mod h1:0U0G41+ochRKoPKCJlh0jMg1CHkyfK8kDqiirMmKY8A= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= -github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= -github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= -github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= -github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= +github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= -github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= +github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= +github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= +github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/uudashr/gocognit v1.0.6 h1:2Cgi6MweCsdB6kpcVQp7EW4U23iBFQWfTXiWlyp842Y= -github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= +github.com/uudashr/gocognit v1.0.7 h1:e9aFXgKgUJrQ5+bs61zBigmj7bFJ/5cC6HmMahVzuDo= +github.com/uudashr/gocognit v1.0.7/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= @@ -1089,11 +1084,11 @@ github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9 github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b h1:wA3QeTsaAXybLL2kb2cKhCAQTHgYTMwuI8lBlJSv5V8= -github.com/whyrusleeping/tar-utils v0.0.0-20201201191210-20a61371de5b/go.mod h1:xT1Y5p2JR2PfSZihE0s4mjdJaRGp1waCTf5JzhQLBck= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= @@ -1101,6 +1096,8 @@ github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsT github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= +github.com/ykadowak/zerologlint v0.1.3 h1:TLy1dTW3Nuc+YE3bYRPToG1Q9Ej78b5UUN6bjbGdxPE= +github.com/ykadowak/zerologlint v0.1.3/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= @@ -1113,24 +1110,25 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= -gitlab.com/bosi/decorder v0.2.3 h1:gX4/RgK16ijY8V+BRQHAySfQAb354T7/xQpDB2n10P0= -gitlab.com/bosi/decorder v0.2.3/go.mod h1:9K1RB5+VPNQYtXtTDAzd2OEftsZb1oV0IrJrzChSdGE= +gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= +gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= +go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= +go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= -go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -1140,11 +1138,8 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc= -golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +go.uber.org/zap v1.25.0 h1:4Hvk6GtkucQ790dqmj7l1eEnRdKm3k3ZUrUMS2d5+5c= +go.uber.org/zap v1.25.0/go.mod h1:JIAUzQIH94IC4fOJQm7gMmBJP5k7wQfdcnYdPoEXJYk= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1166,9 +1161,9 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= -golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= +golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1179,12 +1174,12 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 h1:MGwJjxBy0HJshjDNfLsYO8xppfqWlA5ZT9OhtUUhTNw= -golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= +golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2 h1:J74nGeMgeFnYQJN59eFwh06jX/V8g0lB7LWpjSLxtgU= -golang.org/x/exp/typeparams v0.0.0-20230224173230-c95f2b4c22f2/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230905200255-921286631fa9 h1:j3D9DvWRpUfIyFfDPws7LoIZ2MAI1OJHdQXtTnYtN+k= +golang.org/x/exp/typeparams v0.0.0-20230905200255-921286631fa9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1198,6 +1193,7 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -1267,13 +1263,12 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= -golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1371,6 +1366,7 @@ golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1380,22 +1376,22 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1406,12 +1402,12 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1419,7 +1415,6 @@ golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1498,11 +1493,10 @@ golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.11.1 h1:ojD5zOW8+7dOGzdnNgersm8aPfcDjhMp12UfG93NIMc= -golang.org/x/tools v0.11.1/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1621,8 +1615,7 @@ gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1645,30 +1638,30 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.3 h1:o/n5/K5gXqk8Gozvs2cnL0F2S1/g1vcGCAx2vETjITw= -honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= +honnef.co/go/tools v0.4.5 h1:YGD4H+SuIOOqsyoLOpZDWcieM28W47/zRO7f+9V3nvo= +honnef.co/go/tools v0.4.5/go.mod h1:GUV+uIBCLpdf0/v6UhHHG/yzI/z6qPskBeQCjcNB96k= lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= -lukechampine.com/uint128 v1.2.0 h1:mBi/5l91vocEN8otkC5bDLhi2KdCticRiwbdB0O+rjI= -modernc.org/cc/v3 v3.40.0 h1:P3g79IUS/93SYhtoeaHW+kRCIrYaxJ27MFPv+7kaTOw= -modernc.org/ccgo/v3 v3.16.13 h1:Mkgdzl46i5F/CNR/Kj80Ri59hC8TKAhZrYSaqvkwzUw= -modernc.org/libc v1.22.3 h1:D/g6O5ftAfavceqlLOFwaZuA5KYafKwmr30A6iSqoyY= -modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ= -modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds= +lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= +modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= +modernc.org/ccgo/v3 v3.16.14 h1:af6KNtFgsVmnDYrWk3PQCS9XT6BXe7o3ZFJKkIKvXNQ= +modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= +modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= -modernc.org/sqlite v1.21.0 h1:4aP4MdUf15i3R3M2mx6Q90WHKz3nZLoz96zlB6tNdow= +modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= -mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= -mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ= +mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= +mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d h1:3rvTIIM22r9pvXk+q3swxUQAQOxksVMGK7sml4nG57w= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= -nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +mvdan.cc/unparam v0.0.0-20230815095028-f7c6fb1088f0 h1:NAENkqZ+Xofhqs4R4Af+i3HpZj1M23SFn/lHfRh1D4E= +mvdan.cc/unparam v0.0.0-20230815095028-f7c6fb1088f0/go.mod h1:flQN1deud3vIpPdF88533Lpp/MvzGLgPIPjB1kgBf4I= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/internal/api/api.gen.go b/internal/api/api.gen.go index c8c037aa4..e57a1c210 100644 --- a/internal/api/api.gen.go +++ b/internal/api/api.gen.go @@ -1,6 +1,6 @@ // Package api provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT. package api import ( @@ -11,9 +11,10 @@ import ( "net/http" "time" - "github.com/deepmap/oapi-codegen/pkg/runtime" "github.com/go-chi/chi/v5" uuid "github.com/google/uuid" + "github.com/oapi-codegen/runtime" + strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp" ) const ( @@ -1749,8 +1750,8 @@ type StrictServerInterface interface { RetryPublishState(ctx context.Context, request RetryPublishStateRequestObject) (RetryPublishStateResponseObject, error) } -type StrictHandlerFunc = runtime.StrictHttpHandlerFunc -type StrictMiddlewareFunc = runtime.StrictHttpMiddlewareFunc +type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc +type StrictMiddlewareFunc = strictnethttp.StrictHttpMiddlewareFunc type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) @@ -1798,7 +1799,7 @@ func (sh *strictHandler) GetDocumentation(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1822,7 +1823,7 @@ func (sh *strictHandler) GetConfig(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1846,7 +1847,7 @@ func (sh *strictHandler) GetFavicon(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1870,7 +1871,7 @@ func (sh *strictHandler) GetYaml(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1894,7 +1895,7 @@ func (sh *strictHandler) Health(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1926,7 +1927,7 @@ func (sh *strictHandler) Agent(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1950,7 +1951,7 @@ func (sh *strictHandler) GetIdentities(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -1981,7 +1982,7 @@ func (sh *strictHandler) CreateIdentity(w http.ResponseWriter, r *http.Request) sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2007,7 +2008,7 @@ func (sh *strictHandler) GetQrFromStore(w http.ResponseWriter, r *http.Request, sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2034,7 +2035,7 @@ func (sh *strictHandler) GetClaims(w http.ResponseWriter, r *http.Request, ident sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2067,7 +2068,7 @@ func (sh *strictHandler) CreateClaim(w http.ResponseWriter, r *http.Request, ide sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2094,7 +2095,7 @@ func (sh *strictHandler) GetRevocationStatus(w http.ResponseWriter, r *http.Requ sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2121,7 +2122,7 @@ func (sh *strictHandler) RevokeClaim(w http.ResponseWriter, r *http.Request, ide sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2148,7 +2149,7 @@ func (sh *strictHandler) GetClaim(w http.ResponseWriter, r *http.Request, identi sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2175,7 +2176,7 @@ func (sh *strictHandler) GetClaimQrCode(w http.ResponseWriter, r *http.Request, sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2201,7 +2202,7 @@ func (sh *strictHandler) PublishIdentityState(w http.ResponseWriter, r *http.Req sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -2227,6 +2228,6 @@ func (sh *strictHandler) RetryPublishState(w http.ResponseWriter, r *http.Reques sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } diff --git a/internal/api/main_test.go b/internal/api/main_test.go index 94b7f50ec..3207ffc2b 100644 --- a/internal/api/main_test.go +++ b/internal/api/main_test.go @@ -8,8 +8,11 @@ import ( "github.com/go-chi/chi/v5" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/iden3comm" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/loaders" + "github.com/iden3/iden3comm/v2" + shell "github.com/ipfs/go-ipfs-api" + "github.com/piprate/json-gold/ld" "github.com/polygonid/sh-id-platform/internal/config" "github.com/polygonid/sh-id-platform/internal/core/ports" @@ -29,9 +32,10 @@ var ( bjjKeyProvider kms.KeyProvider keyStore *kms.KMS cachex cache.Cache + schemaLoader ld.DocumentLoader ) -const ipfsGateway = "http://localhost:8080" +const ipfsGatewayURL = "http://localhost:8080" func TestMain(m *testing.M) { ctx := context.Background() @@ -80,6 +84,8 @@ func TestMain(m *testing.M) { cfg.ServerUrl = "https://testing.env/" + schemaLoader = loaders.NewDocumentLoader(shell.NewShell(ipfsGatewayURL), "") + m.Run() } @@ -126,7 +132,7 @@ func (kpm *KMSMock) RegisterKeyProvider(kt kms.KeyType, kp kms.KeyProvider) erro return nil } -func (kpm *KMSMock) CreateKey(kt kms.KeyType, identity *core.DID) (kms.KeyID, error) { +func (kpm *KMSMock) CreateKey(kt kms.KeyType, identity *w3c.DID) (kms.KeyID, error) { var key kms.KeyID return key, nil } @@ -141,12 +147,12 @@ func (kpm *KMSMock) Sign(ctx context.Context, keyID kms.KeyID, data []byte) ([]b return signed, nil } -func (kpm *KMSMock) KeysByIdentity(ctx context.Context, identity core.DID) ([]kms.KeyID, error) { +func (kpm *KMSMock) KeysByIdentity(ctx context.Context, identity w3c.DID) ([]kms.KeyID, error) { var keys []kms.KeyID return keys, nil } -func (kpm *KMSMock) LinkToIdentity(ctx context.Context, keyID kms.KeyID, identity core.DID) (kms.KeyID, error) { +func (kpm *KMSMock) LinkToIdentity(ctx context.Context, keyID kms.KeyID, identity w3c.DID) (kms.KeyID, error) { var key kms.KeyID return key, nil } diff --git a/internal/api/server.go b/internal/api/server.go index 49ffd0885..25c88a525 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -11,11 +11,11 @@ import ( "github.com/go-chi/chi/v5" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" - "github.com/iden3/iden3comm" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" + "github.com/iden3/iden3comm/v2" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/config" @@ -114,7 +114,7 @@ func (s *Server) CreateIdentity(ctx context.Context, request CreateIdentityReque // CreateClaim is claim creation controller func (s *Server) CreateClaim(ctx context.Context, request CreateClaimRequestObject) (CreateClaimResponseObject, error) { - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return CreateClaim400JSONResponse{N400JSONResponse{Message: err.Error()}}, nil } @@ -155,7 +155,7 @@ func (s *Server) CreateClaim(ctx context.Context, request CreateClaimRequestObje // RevokeClaim is the revocation claim controller func (s *Server) RevokeClaim(ctx context.Context, request RevokeClaimRequestObject) (RevokeClaimResponseObject, error) { - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { log.Warn(ctx, "revoke claim invalid did", "err", err, "req", request) return RevokeClaim400JSONResponse{N400JSONResponse{err.Error()}}, nil @@ -177,7 +177,7 @@ func (s *Server) RevokeClaim(ctx context.Context, request RevokeClaimRequestObje // GetRevocationStatus is the controller to get revocation status func (s *Server) GetRevocationStatus(ctx context.Context, request GetRevocationStatusRequestObject) (GetRevocationStatusResponseObject, error) { - issuerDID, err := core.ParseDID(request.Identifier) + issuerDID, err := w3c.ParseDID(request.Identifier) if err != nil { return GetRevocationStatus500JSONResponse{N500JSONResponse{ Message: err.Error(), @@ -228,7 +228,7 @@ func (s *Server) GetClaim(ctx context.Context, request GetClaimRequestObject) (G return GetClaim400JSONResponse{N400JSONResponse{"invalid did, cannot be empty"}}, nil } - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return GetClaim400JSONResponse{N400JSONResponse{"invalid did"}}, nil } @@ -264,7 +264,7 @@ func (s *Server) GetClaims(ctx context.Context, request GetClaimsRequestObject) return GetClaims400JSONResponse{N400JSONResponse{"invalid did, cannot be empty"}}, nil } - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return GetClaims400JSONResponse{N400JSONResponse{"invalid did"}}, nil } @@ -302,7 +302,7 @@ func (s *Server) GetClaimQrCode(ctx context.Context, request GetClaimQrCodeReque return GetClaimQrCode400JSONResponse{N400JSONResponse{"invalid did, cannot be empty"}}, nil } - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return GetClaimQrCode400JSONResponse{N400JSONResponse{"invalid did"}}, nil } @@ -376,7 +376,7 @@ func (s *Server) Agent(ctx context.Context, request AgentRequestObject) (AgentRe // PublishIdentityState - publish identity state on chain func (s *Server) PublishIdentityState(ctx context.Context, request PublishIdentityStateRequestObject) (PublishIdentityStateResponseObject, error) { - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return PublishIdentityState400JSONResponse{N400JSONResponse{"invalid did"}}, nil } @@ -400,7 +400,7 @@ func (s *Server) PublishIdentityState(ctx context.Context, request PublishIdenti // RetryPublishState - retry to publish the current state if it failed previously. func (s *Server) RetryPublishState(ctx context.Context, request RetryPublishStateRequestObject) (RetryPublishStateResponseObject, error) { - did, err := core.ParseDID(request.Identifier) + did, err := w3c.ParseDID(request.Identifier) if err != nil { return RetryPublishState400JSONResponse{N400JSONResponse{"invalid did"}}, nil } diff --git a/internal/api/server_test.go b/internal/api/server_test.go index 9c7cdc147..e3e94566f 100644 --- a/internal/api/server_test.go +++ b/internal/api/server_test.go @@ -13,10 +13,10 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" "github.com/mitchellh/mapstructure" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -27,7 +27,6 @@ import ( "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/core/services" "github.com/polygonid/sh-id-platform/internal/db/tests" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/pubsub" @@ -49,12 +48,11 @@ func TestServer_CreateIdentity(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) handler := getHandler(context.Background(), server) @@ -177,12 +175,11 @@ func TestServer_RevokeClaim(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -330,14 +327,12 @@ func TestServer_CreateClaim(t *testing.T) { connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, qrService, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) - claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } pubSub := pubsub.NewMock() - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) handler := getHandler(ctx, server) @@ -490,12 +485,11 @@ func TestServer_GetIdentities(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) handler := getHandler(context.Background(), server) @@ -564,7 +558,6 @@ func TestServer_GetClaimQrCode(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", @@ -572,7 +565,7 @@ func TestServer_GetClaimQrCode(t *testing.T) { idStr := "did:polygonid:polygon:mumbai:2qPrv5Yx8s1qAmEnPym68LfT7gTbASGampiGU7TseL" idNoClaims := "did:polygonid:polygon:mumbai:2qGjTUuxZKqKS4Q8UmxHUPw55g15QgEVGnj6Wkq8Vk" - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) identity := &domain.Identity{ Identifier: idStr, @@ -711,13 +704,12 @@ func TestServer_GetClaim(t *testing.T) { connectionsRepository := repositories.NewConnections() rhsp := reverse_hash.NewRhsPublisher(nil, false) identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -884,12 +876,11 @@ func TestServer_GetClaims(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) fixture := tests.NewFixture(storage) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -1211,7 +1202,6 @@ func TestServer_GetRevocationStatus(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "https://host.com", @@ -1219,12 +1209,12 @@ func TestServer_GetRevocationStatus(t *testing.T) { identity, err := identityService.Create(ctx, method, blockchain, network, "http://localhost:3001") assert.NoError(t, err) - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, nil, NewPublisherMock(), NewPackageManagerMock(), nil) handler := getHandler(context.Background(), server) schema := "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json" - did, _ := core.ParseDID(identity.Identifier) + did, _ := w3c.ParseDID(identity.Identifier) credentialSubject := map[string]any{ "id": "did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ", "birthday": 19960424, diff --git a/internal/api_ui/api.gen.go b/internal/api_ui/api.gen.go index f8e4a134a..303046df2 100644 --- a/internal/api_ui/api.gen.go +++ b/internal/api_ui/api.gen.go @@ -1,6 +1,6 @@ // Package api_ui provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.13.4 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.15.0 DO NOT EDIT. package api_ui import ( @@ -11,10 +11,11 @@ import ( "net/http" "time" - "github.com/deepmap/oapi-codegen/pkg/runtime" - openapi_types "github.com/deepmap/oapi-codegen/pkg/types" "github.com/go-chi/chi/v5" uuid "github.com/google/uuid" + "github.com/oapi-codegen/runtime" + strictnethttp "github.com/oapi-codegen/runtime/strictmiddleware/nethttp" + openapi_types "github.com/oapi-codegen/runtime/types" ) const ( @@ -3305,8 +3306,8 @@ type StrictServerInterface interface { GetStateTransactions(ctx context.Context, request GetStateTransactionsRequestObject) (GetStateTransactionsResponseObject, error) } -type StrictHandlerFunc = runtime.StrictHttpHandlerFunc -type StrictMiddlewareFunc = runtime.StrictHttpMiddlewareFunc +type StrictHandlerFunc = strictnethttp.StrictHttpHandlerFunc +type StrictMiddlewareFunc = strictnethttp.StrictHttpMiddlewareFunc type StrictHTTPServerOptions struct { RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) @@ -3354,7 +3355,7 @@ func (sh *strictHandler) GetDocumentation(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3378,7 +3379,7 @@ func (sh *strictHandler) GetConfig(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3402,7 +3403,7 @@ func (sh *strictHandler) GetFavicon(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3426,7 +3427,7 @@ func (sh *strictHandler) GetYaml(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3450,7 +3451,7 @@ func (sh *strictHandler) Health(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3482,7 +3483,7 @@ func (sh *strictHandler) Agent(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3516,7 +3517,7 @@ func (sh *strictHandler) AuthCallback(w http.ResponseWriter, r *http.Request, pa sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3540,7 +3541,7 @@ func (sh *strictHandler) AuthQRCode(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3566,7 +3567,7 @@ func (sh *strictHandler) GetConnections(w http.ResponseWriter, r *http.Request, sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3593,7 +3594,7 @@ func (sh *strictHandler) DeleteConnection(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3619,7 +3620,7 @@ func (sh *strictHandler) GetConnection(w http.ResponseWriter, r *http.Request, i sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3645,7 +3646,7 @@ func (sh *strictHandler) DeleteConnectionCredentials(w http.ResponseWriter, r *h sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3671,7 +3672,7 @@ func (sh *strictHandler) RevokeConnectionCredentials(w http.ResponseWriter, r *h sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3697,7 +3698,7 @@ func (sh *strictHandler) GetCredentials(w http.ResponseWriter, r *http.Request, sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3728,7 +3729,7 @@ func (sh *strictHandler) CreateCredential(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3754,7 +3755,7 @@ func (sh *strictHandler) GetLinks(w http.ResponseWriter, r *http.Request, params sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3785,7 +3786,7 @@ func (sh *strictHandler) CreateLink(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3819,7 +3820,7 @@ func (sh *strictHandler) CreateLinkQrCodeCallback(w http.ResponseWriter, r *http sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3845,7 +3846,7 @@ func (sh *strictHandler) DeleteLink(w http.ResponseWriter, r *http.Request, id I sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3871,7 +3872,7 @@ func (sh *strictHandler) GetLink(w http.ResponseWriter, r *http.Request, id Id) sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3904,7 +3905,7 @@ func (sh *strictHandler) AcivateLink(w http.ResponseWriter, r *http.Request, id sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3931,7 +3932,7 @@ func (sh *strictHandler) GetLinkQRCode(w http.ResponseWriter, r *http.Request, i sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3957,7 +3958,7 @@ func (sh *strictHandler) CreateLinkQrCode(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -3983,7 +3984,7 @@ func (sh *strictHandler) GetRevocationStatus(w http.ResponseWriter, r *http.Requ sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4009,7 +4010,7 @@ func (sh *strictHandler) RevokeCredential(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4035,7 +4036,7 @@ func (sh *strictHandler) DeleteCredential(w http.ResponseWriter, r *http.Request sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4061,7 +4062,7 @@ func (sh *strictHandler) GetCredential(w http.ResponseWriter, r *http.Request, i sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4087,7 +4088,7 @@ func (sh *strictHandler) GetCredentialQrCode(w http.ResponseWriter, r *http.Requ sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4113,7 +4114,7 @@ func (sh *strictHandler) GetQrFromStore(w http.ResponseWriter, r *http.Request, sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4139,7 +4140,7 @@ func (sh *strictHandler) GetSchemas(w http.ResponseWriter, r *http.Request, para sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4170,7 +4171,7 @@ func (sh *strictHandler) ImportSchema(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4196,7 +4197,7 @@ func (sh *strictHandler) GetSchema(w http.ResponseWriter, r *http.Request, id Id sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4220,7 +4221,7 @@ func (sh *strictHandler) PublishState(w http.ResponseWriter, r *http.Request) { sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4244,7 +4245,7 @@ func (sh *strictHandler) RetryPublishState(w http.ResponseWriter, r *http.Reques sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4268,7 +4269,7 @@ func (sh *strictHandler) GetStateStatus(w http.ResponseWriter, r *http.Request) sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } @@ -4292,6 +4293,6 @@ func (sh *strictHandler) GetStateTransactions(w http.ResponseWriter, r *http.Req sh.options.ResponseErrorHandlerFunc(w, r, err) } } else if response != nil { - sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("Unexpected response type: %T", response)) + sh.options.ResponseErrorHandlerFunc(w, r, fmt.Errorf("unexpected response type: %T", response)) } } diff --git a/internal/api_ui/main_test.go b/internal/api_ui/main_test.go index 2bb080d5a..305979b73 100644 --- a/internal/api_ui/main_test.go +++ b/internal/api_ui/main_test.go @@ -10,8 +10,10 @@ import ( "github.com/go-chi/chi/v5" vaultApi "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/iden3comm" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/loaders" + "github.com/iden3/iden3comm/v2" + shell "github.com/ipfs/go-ipfs-api" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -21,6 +23,7 @@ import ( "github.com/polygonid/sh-id-platform/internal/db/tests" "github.com/polygonid/sh-id-platform/internal/errors" "github.com/polygonid/sh-id-platform/internal/kms" + "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/pkg/cache" @@ -33,9 +36,10 @@ var ( bjjKeyProvider kms.KeyProvider keyStore *kms.KMS cachex cache.Cache + schemaLoader loader.DocumentLoader ) -const ipfsGateway = "http://localhost:8080" +const ipfsGatewayURL = "http://localhost:8080" func TestMain(m *testing.M) { ctx := context.Background() @@ -84,6 +88,8 @@ func TestMain(m *testing.M) { cfg.ServerUrl = "https://testing.env/" + schemaLoader = loaders.NewDocumentLoader(shell.NewShell(ipfsGatewayURL), "") + m.Run() } @@ -160,7 +166,7 @@ func (kpm *KMSMock) RegisterKeyProvider(kt kms.KeyType, kp kms.KeyProvider) erro return nil } -func (kpm *KMSMock) CreateKey(kt kms.KeyType, identity *core.DID) (kms.KeyID, error) { +func (kpm *KMSMock) CreateKey(kt kms.KeyType, identity *w3c.DID) (kms.KeyID, error) { var key kms.KeyID return key, nil } @@ -175,12 +181,12 @@ func (kpm *KMSMock) Sign(ctx context.Context, keyID kms.KeyID, data []byte) ([]b return signed, nil } -func (kpm *KMSMock) KeysByIdentity(ctx context.Context, identity core.DID) ([]kms.KeyID, error) { +func (kpm *KMSMock) KeysByIdentity(ctx context.Context, identity w3c.DID) ([]kms.KeyID, error) { var keys []kms.KeyID return keys, nil } -func (kpm *KMSMock) LinkToIdentity(ctx context.Context, keyID kms.KeyID, identity core.DID) (kms.KeyID, error) { +func (kpm *KMSMock) LinkToIdentity(ctx context.Context, keyID kms.KeyID, identity w3c.DID) (kms.KeyID, error) { var key kms.KeyID return key, nil } diff --git a/internal/api_ui/responses.go b/internal/api_ui/responses.go index d1dd874a4..950fe1cc1 100644 --- a/internal/api_ui/responses.go +++ b/internal/api_ui/responses.go @@ -5,11 +5,11 @@ import ( "strings" "time" - openapi_types "github.com/deepmap/oapi-codegen/pkg/types" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" + openapitypes "github.com/oapi-codegen/runtime/types" "github.com/polygonid/sh-id-platform/internal/core/domain" - link_state "github.com/polygonid/sh-id-platform/pkg/link" + linkstate "github.com/polygonid/sh-id-platform/pkg/link" "github.com/polygonid/sh-id-platform/pkg/schema" ) @@ -217,9 +217,9 @@ func deleteConnection500Response(deleteCredentials bool, revokeCredentials bool) func getLinkResponse(link domain.Link) Link { hash, _ := link.Schema.Hash.MarshalText() - var date *openapi_types.Date + var date *openapitypes.Date if link.CredentialExpiration != nil { - date = &openapi_types.Date{Time: *link.CredentialExpiration} + date = &openapitypes.Date{Time: *link.CredentialExpiration} } return Link{ @@ -271,7 +271,7 @@ func getLinkResponses(links []domain.Link) []Link { return res } -func getLinkQrCodeResponse(linkQrCode *link_state.QRCodeMessage) *QrCodeResponse { +func getLinkQrCodeResponse(linkQrCode *linkstate.QRCodeMessage) *QrCodeResponse { if linkQrCode == nil { return nil } diff --git a/internal/api_ui/server.go b/internal/api_ui/server.go index 59ea7c24a..f720d8954 100644 --- a/internal/api_ui/server.go +++ b/internal/api_ui/server.go @@ -11,9 +11,9 @@ import ( "time" "github.com/go-chi/chi/v5" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/iden3comm" - "github.com/iden3/iden3comm/packers" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/iden3comm/v2" + "github.com/iden3/iden3comm/v2/packers" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/config" @@ -580,7 +580,7 @@ func (s *Server) CreateLinkQrCodeCallback(ctx context.Context, request CreateLin return CreateLinkQrCodeCallback500JSONResponse{}, nil } - userDID, err := core.ParseDID(arm.From) + userDID, err := w3c.ParseDID(arm.From) if err != nil { log.Debug(ctx, "error getting user DID", err.Error()) return CreateLinkQrCodeCallback500JSONResponse{}, nil @@ -672,7 +672,7 @@ func (s *Server) GetQrFromStore(ctx context.Context, request GetQrFromStoreReque func getCredentialsFilter(ctx context.Context, userDID *string, status *GetCredentialsParamsStatus, query *string) (*ports.ClaimsFilter, error) { filter := &ports.ClaimsFilter{} if userDID != nil { - did, err := core.ParseDID(*userDID) + did, err := w3c.ParseDID(*userDID) if err != nil { log.Warn(ctx, "get credentials. Parsing did", "err", err, "did", *userDID) return nil, errors.New("cannot parse did parameter: wrong format") diff --git a/internal/api_ui/server_test.go b/internal/api_ui/server_test.go index b6a2c48a6..73316bfd7 100644 --- a/internal/api_ui/server_test.go +++ b/internal/api_ui/server_test.go @@ -13,12 +13,11 @@ import ( "testing" "time" - "github.com/deepmap/oapi-codegen/pkg/types" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/utils" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/iden3comm/v2/protocol" "github.com/mitchellh/mapstructure" + "github.com/oapi-codegen/runtime/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -30,7 +29,6 @@ import ( "github.com/polygonid/sh-id-platform/internal/core/services" "github.com/polygonid/sh-id-platform/internal/db/tests" "github.com/polygonid/sh-id-platform/internal/health" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/repositories" linkState "github.com/polygonid/sh-id-platform/pkg/link" @@ -48,14 +46,13 @@ func TestServer_CheckStatus(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) - schemaService := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaService := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, identityService, claimsService, schemaService, NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), &health.Status{}) handler := getHandler(context.Background(), server) @@ -135,7 +132,7 @@ func TestServer_AuthQRCode(t *testing.T) { identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, qrService, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, sessionRepository, pubsub.NewMock()) server := NewServer(&cfg, identityService, NewClaimsMock(), NewSchemaMock(), NewConnectionsMock(), NewLinkMock(), qrService, NewPublisherMock(), NewPackageManagerMock(), nil) - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) server.cfg.APIUI.IssuerDID = *issuerDID server.cfg.APIUI.ServerURL = "https://testing.env" @@ -206,9 +203,9 @@ func TestServer_AuthQRCode(t *testing.T) { func TestServer_GetSchema(t *testing.T) { ctx := context.Background() - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) server := NewServer(&cfg, NewIdentityMock(), NewClaimsMock(), schemaSrv, NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) server.cfg.APIUI.IssuerDID = *issuerDID server.cfg.APIUI.ServerURL = "https://testing.env" @@ -222,7 +219,7 @@ func TestServer_GetSchema(t *testing.T) { Words: domain.SchemaWordsFromString("attr1, attr2, attr3"), CreatedAt: time.Now(), } - s.Hash = utils.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) + s.Hash = common.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) fixture.CreateSchema(t, ctx, s) sHash, _ := s.Hash.MarshalText() @@ -326,9 +323,9 @@ func TestServer_GetSchemas(t *testing.T) { require.NoError(t, err) defer teardown() - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) server := NewServer(&cfg, NewIdentityMock(), NewClaimsMock(), schemaSrv, NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) server.cfg.APIUI.IssuerDID = *issuerDID server.cfg.APIUI.ServerURL = "https://testing.env" @@ -343,7 +340,7 @@ func TestServer_GetSchemas(t *testing.T) { Words: domain.SchemaWordsFromString("attr1, attr2, attr3"), CreatedAt: time.Now(), } - s.Hash = utils.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) + s.Hash = common.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) fixture.CreateSchema(t, ctx, s) } s := &domain.Schema{ @@ -354,7 +351,7 @@ func TestServer_GetSchemas(t *testing.T) { Words: domain.SchemaWordsFromString("attr1, attr2, attr3"), CreatedAt: time.Now(), } - s.Hash = utils.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) + s.Hash = common.CreateSchemaHash([]byte(s.URL + "#" + s.Type)) fixture.CreateSchema(t, ctx, s) handler := getHandler(ctx, server) @@ -449,10 +446,9 @@ func TestServer_ImportSchema(t *testing.T) { const url = "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json" const schemaType = "KYCCountryOfResidenceCredential" ctx := context.Background() - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) server := NewServer(&cfg, NewIdentityMock(), NewClaimsMock(), schemaSrv, NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) server.cfg.APIUI.IssuerDID = *issuerDID server.cfg.APIUI.ServerURL = "https://testing.env" @@ -547,10 +543,9 @@ func TestServer_ImportSchemaIPFS(t *testing.T) { const url = "ipfs://QmQVeb5dkz5ekDqBrYVVxBFQZoCbzamnmMUn9B8twCEgDL" const schemaType = "testNewType" ctx := context.Background() - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) server := NewServer(&cfg, NewIdentityMock(), NewClaimsMock(), schemaSrv, NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) server.cfg.APIUI.IssuerDID = *issuerDID server.cfg.APIUI.ServerURL = "https://testing.env" @@ -655,18 +650,17 @@ func TestServer_DeleteConnection(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - issuerDID, err := core.ParseDID(iden.Identifier) + issuerDID, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -675,10 +669,10 @@ func TestServer_DeleteConnection(t *testing.T) { fixture := tests.NewFixture(storage) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) - userDID2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qNytPv6dKKhfqopjBdXJU1vSVb3Lbgcidved32R64") + userDID2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qNytPv6dKKhfqopjBdXJU1vSVb3Lbgcidved32R64") require.NoError(t, err) conn := fixture.CreateConnection(t, &domain.Connection{ @@ -811,9 +805,9 @@ func TestServer_DeleteConnectionCredentials(t *testing.T) { fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) conn := fixture.CreateConnection(t, &domain.Connection{ @@ -907,18 +901,17 @@ func TestServer_RevokeConnectionCredentials(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - issuerDID, err := core.ParseDID(iden.Identifier) + issuerDID, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -927,7 +920,7 @@ func TestServer_RevokeConnectionCredentials(t *testing.T) { fixture := tests.NewFixture(storage) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) conn := fixture.CreateConnection(t, &domain.Connection{ @@ -1021,18 +1014,17 @@ func TestServer_CreateCredential(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } pubSub := pubsub.NewMock() - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did @@ -1201,19 +1193,18 @@ func TestServer_DeleteCredential(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), NewConnectionsMock(), NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) handler := getHandler(context.Background(), server) fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) cred := fixture.NewClaim(t, issuerDID.String()) @@ -1307,17 +1298,16 @@ func TestServer_GetCredential(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -1502,18 +1492,17 @@ func TestServer_GetCredentials(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) schemaService := services.NewSchema(schemaRepository, schemaLoader) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -1547,7 +1536,7 @@ func TestServer_GetCredentials(t *testing.T) { revoked, err := claimsService.Save(ctx, ports.NewCreateClaimRequest(did, schemaURL, credentialSubject, &future, typeC, nil, nil, &merklizedRootPosition, common.ToPointer(false), common.ToPointer(true), nil, false)) require.NoError(t, err) - id, err := core.ParseDID(*revoked.Identifier) + id, err := w3c.ParseDID(*revoked.Identifier) require.NoError(t, err) require.NoError(t, claimsService.Revoke(ctx, *id, uint64(revoked.RevNonce), "because I can")) @@ -1783,17 +1772,16 @@ func TestServer_GetCredentialQrCode(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, qrService, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, qrService, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, qrService, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), qrService, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -1910,18 +1898,17 @@ func TestServer_GetConnection(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -1930,10 +1917,10 @@ func TestServer_GetConnection(t *testing.T) { claim := fixture.NewClaim(t, did.String()) fixture.CreateClaim(t, claim) - usrDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + usrDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) - usrDID2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qFBp1sRF1bFbTybVHHZQRgSWE2nKrdWeAxyZ67PdG") + usrDID2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qFBp1sRF1bFbTybVHHZQRgSWE2nKrdWeAxyZ67PdG") require.NoError(t, err) connID := fixture.CreateConnection(t, &domain.Connection{ @@ -2098,18 +2085,17 @@ func TestServer_GetConnections(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did server := NewServer(&cfg, NewIdentityMock(), claimsService, NewSchemaMock(), connectionsService, NewLinkMock(), nil, NewPublisherMock(), NewPackageManagerMock(), nil) @@ -2126,7 +2112,7 @@ func TestServer_GetConnections(t *testing.T) { Type: schemaType, Words: []string{"birthday", "id", "hello"}, CreatedAt: time.Now(), - Hash: utils.CreateSchemaHash([]byte(schemaContext + "#" + schemaType)), + Hash: common.CreateSchemaHash([]byte(schemaContext + "#" + schemaType)), } fixture.CreateSchema(t, ctx, s) @@ -2147,10 +2133,10 @@ func TestServer_GetConnections(t *testing.T) { _, err = claimsService.Save(ctx, ports.NewCreateClaimRequest(did, schemaURL, credentialSubject2, nil, schemaType, nil, nil, &merklizedRootPosition, common.ToPointer(true), common.ToPointer(true), nil, false)) require.NoError(t, err) - usrDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + usrDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") require.NoError(t, err) - usrDID2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qFBp1sRF1bFbTybVHHZQRgSWE2nKrdWeAxyZ67PdG") + usrDID2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qFBp1sRF1bFbTybVHHZQRgSWE2nKrdWeAxyZ67PdG") require.NoError(t, err) uuid1, err := uuid.Parse("9736cf94-cd42-11ed-9618-debe37e1cbd6") @@ -2554,19 +2540,18 @@ func TestServer_RevokeCredential(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(&KMSMock{}, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) fixture := tests.NewFixture(storage) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did @@ -2697,22 +2682,21 @@ func TestServer_CreateLink(t *testing.T) { schemaRespository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } pubSub := pubsub.NewMock() - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRespository, loader.HTTPFactory, sessionRepository, pubSub, ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRespository, schemaLoader, sessionRepository, pubSub, ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -2926,21 +2910,20 @@ func TestServer_ActivateLink(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3078,21 +3061,20 @@ func TestServer_GetLink(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3250,21 +3232,20 @@ func TestServer_GetAllLinks(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(sUrl, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3466,21 +3447,20 @@ func TestServer_DeleteLink(t *testing.T) { linkRepository := repositories.NewLink(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3584,29 +3564,28 @@ func TestServer_DeleteLinkForDifferentDID(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) iden2, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) - did2, err := core.ParseDID(iden2.Identifier) + did2, err := w3c.ParseDID(iden2.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did2 @@ -3700,21 +3679,20 @@ func TestServer_CreateLinkQRCode(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, qrService, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, qrService, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, qrService, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3850,21 +3828,20 @@ func TestServer_GetLinkQRCode(t *testing.T) { schemaRepository := repositories.NewSchema(*storage) sessionRepository := repositories.NewSessionCached(cachex) identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.HTTPFactory, cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, loader.HTTPFactory, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGatewayURL) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - schemaSrv := services.NewSchema(repositories.NewSchema(*storage), loader.HTTPFactory) + schemaSrv := services.NewSchema(repositories.NewSchema(*storage), schemaLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer("someTitle"), uuid.NewString(), common.ToPointer("someDescription")) importedSchema, err := schemaSrv.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) @@ -3881,7 +3858,7 @@ func TestServer_GetLinkQRCode(t *testing.T) { handler := getHandler(ctx, server) sessionID := uuid.New() - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qP8KN3KRwBi37jB2ENXrWxhTo3pefaU5u5BFPbjYo") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qP8KN3KRwBi37jB2ENXrWxhTo3pefaU5u5BFPbjYo") assert.NoError(t, err) qrcode := &linkState.QRCodeMessage{ ID: uuid.New().String(), @@ -4022,12 +3999,11 @@ func TestServer_GetStateStatus(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) schema := "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json" credentialSubject := map[string]any{ @@ -4040,7 +4016,7 @@ func TestServer_GetStateStatus(t *testing.T) { iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did @@ -4129,17 +4105,16 @@ func TestServer_GetStateTransactions(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did @@ -4218,18 +4193,17 @@ func TestServer_GetRevocationStatus(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } pubSub := pubsub.NewMock() - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubSub, ipfsGatewayURL) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) cfg.APIUI.IssuerDID = *did diff --git a/internal/common/common.go b/internal/common/common.go index fb8928cca..17a075400 100644 --- a/internal/common/common.go +++ b/internal/common/common.go @@ -1,7 +1,7 @@ package common import ( - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" "github.com/iden3/go-merkletree-sql/v2" jsonSuite "github.com/iden3/go-schema-processor/json" "github.com/iden3/go-schema-processor/utils" diff --git a/internal/common/schemahash.go b/internal/common/schemahash.go new file mode 100644 index 000000000..c020316a7 --- /dev/null +++ b/internal/common/schemahash.go @@ -0,0 +1,23 @@ +package common + +import ( + core "github.com/iden3/go-iden3-core/v2" + "golang.org/x/crypto/sha3" +) + +// keccak256 calculates the Keccak256 hash of the input data. +func keccak256(data ...[]byte) []byte { + d := sha3.NewLegacyKeccak256() + for _, b := range data { + d.Write(b) + } + return d.Sum(nil) +} + +// CreateSchemaHash computes schema hash from schemaID +func CreateSchemaHash(schemaID []byte) core.SchemaHash { + var sHash core.SchemaHash + h := keccak256(schemaID) + copy(sHash[:], h[len(h)-16:]) + return sHash +} diff --git a/internal/common/util.go b/internal/common/util.go index 6d3da2bf9..1108c2185 100644 --- a/internal/common/util.go +++ b/internal/common/util.go @@ -10,15 +10,16 @@ import ( "strings" "time" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" - jsonSuite "github.com/iden3/go-schema-processor/json" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" ) // CredentialRequest is a model for credential creation type CredentialRequest struct { CredentialSchema string `json:"credentialSchema"` + LDContext string `json:"ldContext"` Type string `json:"type"` CredentialSubject json.RawMessage `json:"credentialSubject"` Expiration int64 `json:"expiration,omitempty"` @@ -29,14 +30,14 @@ type CredentialRequest struct { } // CreateCredential is util to create a Verifiable credential -func CreateCredential(issuer *core.DID, req CredentialRequest, schema jsonSuite.Schema) (verifiable.W3CCredential, error) { +func CreateCredential(issuer *w3c.DID, req CredentialRequest) (verifiable.W3CCredential, error) { var cred verifiable.W3CCredential - jsonLdContext, ok := schema.Metadata.Uris["jsonLdContext"].(string) - if !ok { - return verifiable.W3CCredential{}, fmt.Errorf("invalid jsonLdContext, expected string") + credentialCtx := []string{ + verifiable.JSONLDSchemaW3CCredential2018, + verifiable.JSONLDSchemaIden3Credential, + req.LDContext, } - credentialCtx := []string{verifiable.JSONLDSchemaW3CCredential2018, verifiable.JSONLDSchemaIden3Credential, jsonLdContext} credentialType := []string{verifiable.TypeW3CVerifiableCredential, req.Type} @@ -53,7 +54,7 @@ func CreateCredential(issuer *core.DID, req CredentialRequest, schema jsonSuite. idSubject, ok := credentialSubject["id"].(string) if ok { - did, err := core.ParseDID(idSubject) + did, err := w3c.ParseDID(idSubject) if err != nil { return verifiable.W3CCredential{}, err } @@ -89,17 +90,17 @@ func RandInt64() (uint64, error) { } // CheckGenesisStateDID return nil if state is genesis state. -func CheckGenesisStateDID(did *core.DID, state *big.Int) error { +func CheckGenesisStateDID(did *w3c.DID, state *big.Int) error { stateHash, err := merkletree.NewHashFromBigInt(state) if err != nil { return err } - t, err := core.BuildDIDType(did.Method, did.Blockchain, did.NetworkID) + id, err := core.IDFromDID(*did) if err != nil { return err } - DIDFromState, err := core.DIDGenesisFromIdenState(t, stateHash.BigInt()) + DIDFromState, err := core.NewDIDFromIdenState(id.Type(), stateHash.BigInt()) if err != nil { return err } diff --git a/internal/config/config.go b/internal/config/config.go index 50f228c28..c121e47f7 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -12,7 +12,7 @@ import ( "time" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/spf13/viper" "github.com/polygonid/sh-id-platform/internal/common" @@ -43,7 +43,7 @@ type Configuration struct { OnChainCheckStatusFrequency time.Duration `mapstructure:"OnChainCheckStatusFrequency"` SchemaCache *bool `mapstructure:"SchemaCache"` APIUI APIUI `mapstructure:"APIUI"` - IFPS IPFS `mapstructure:"IPFS"` + IPFS IPFS `mapstructure:"IPFS"` VaultUserPassAuthEnabled bool VaultUserPassAuthPassword string } @@ -138,7 +138,7 @@ type APIUI struct { IssuerName string `mapstructure:"IssuerName" tip:"Server UI API backend issuer name"` IssuerLogo string `mapstructure:"IssuerLogo" tip:"Server UI API backend issuer logo (URL)"` Issuer string `mapstructure:"IssuerDID" tip:"Server UI API backend issuer DID (already created in the issuer node)"` - IssuerDID core.DID `mapstructure:"-"` + IssuerDID w3c.DID `mapstructure:"-"` SchemaCache *bool `mapstructure:"SchemaCache" tip:"Server UI API backend for enabling schema caching"` IdentityMethod string `mapstructure:"IdentityMethod" tip:"Server UI API backend Identity Method"` IdentityBlockchain string `mapstructure:"IdentityBlockchain" tip:"Server UI API backend Identity Blockchain"` @@ -185,7 +185,7 @@ func (c *Configuration) SanitizeAPIUI(ctx context.Context) (err error) { } if c.APIUI.Issuer != "" { - issuerDID, err := core.ParseDID(c.APIUI.Issuer) + issuerDID, err := w3c.ParseDID(c.APIUI.Issuer) if err != nil { log.Error(ctx, "invalid issuer did format", "error", err) return fmt.Errorf("invalid issuer did format") @@ -210,7 +210,7 @@ func CheckDID(ctx context.Context, cfg *Configuration, vaultCli *api.Client) err return err } log.Info(ctx, "Issuer Did loaded from vault", "did", cfg.APIUI.Issuer) - issuerDID, err := core.ParseDID(cfg.APIUI.Issuer) + issuerDID, err := w3c.ParseDID(cfg.APIUI.Issuer) if err != nil { log.Error(ctx, "invalid issuer did format", "error", err) return err @@ -389,9 +389,9 @@ func bindEnv() { // nolint:gocyclo func checkEnvVars(ctx context.Context, cfg *Configuration) { - if cfg.IFPS.GatewayURL == "" { + if cfg.IPFS.GatewayURL == "" { log.Warn(ctx, "ISSUER_IPFS_GATEWAY_URL value is missing, using default value: "+ipfsGateway) - cfg.IFPS.GatewayURL = ipfsGateway + cfg.IPFS.GatewayURL = ipfsGateway } if cfg.ServerUrl == "" { diff --git a/internal/core/domain/IdentityMerkleTrees.go b/internal/core/domain/IdentityMerkleTrees.go index 93b7832e2..4aaef2e6b 100644 --- a/internal/core/domain/IdentityMerkleTrees.go +++ b/internal/core/domain/IdentityMerkleTrees.go @@ -6,7 +6,7 @@ import ( "fmt" "math/big" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" "github.com/polygonid/sh-id-platform/internal/db" @@ -25,7 +25,7 @@ const ( // IdentityMerkleTrees defines the merkle tree structure type IdentityMerkleTrees struct { - Identifier *core.DID + Identifier *w3c.DID Trees []*merkletree.MerkleTree ImtModels []*IdentityMerkleTree } @@ -77,7 +77,7 @@ func (imts *IdentityMerkleTrees) ClaimsTree() (*merkletree.MerkleTree, error) { } // BindToIdentifier swaps temporary Identifier for real one in IdentityMerkleTree models -func (imts *IdentityMerkleTrees) BindToIdentifier(conn db.Querier, identifier *core.DID) error { +func (imts *IdentityMerkleTrees) BindToIdentifier(conn db.Querier, identifier *w3c.DID) error { if imts.Identifier != nil { return errors.New("can't change not empty Identifier") } diff --git a/internal/core/domain/agent.go b/internal/core/domain/agent.go index 7dae6e32a..da087deb3 100644 --- a/internal/core/domain/agent.go +++ b/internal/core/domain/agent.go @@ -1,6 +1,6 @@ package domain -import "github.com/iden3/iden3comm" +import "github.com/iden3/iden3comm/v2" // Agent struct type Agent struct { diff --git a/internal/core/domain/claim.go b/internal/core/domain/claim.go index 19cf86722..9dc611dca 100644 --- a/internal/core/domain/claim.go +++ b/internal/core/domain/claim.go @@ -8,9 +8,9 @@ import ( "time" "github.com/google/uuid" - "github.com/iden3/go-circuits" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-circuits/v2" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/jackc/pgtype" "github.com/polygonid/sh-id-platform/internal/common" diff --git a/internal/core/domain/connection.go b/internal/core/domain/connection.go index 041b327ce..b68b7107c 100644 --- a/internal/core/domain/connection.go +++ b/internal/core/domain/connection.go @@ -5,14 +5,14 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" ) // Connection struct type Connection struct { ID uuid.UUID - IssuerDID core.DID - UserDID core.DID + IssuerDID w3c.DID + UserDID w3c.DID IssuerDoc json.RawMessage UserDoc json.RawMessage CreatedAt time.Time diff --git a/internal/core/domain/identity.go b/internal/core/domain/identity.go index 7249f7cf9..2e7122681 100644 --- a/internal/core/domain/identity.go +++ b/internal/core/domain/identity.go @@ -1,6 +1,6 @@ package domain -import core "github.com/iden3/go-iden3-core" +import "github.com/iden3/go-iden3-core/v2/w3c" // Identity struct type Identity struct { @@ -9,7 +9,7 @@ type Identity struct { } // NewIdentityFromIdentifier default identity model from identity and root state -func NewIdentityFromIdentifier(id *core.DID, rootState string) *Identity { +func NewIdentityFromIdentifier(id *w3c.DID, rootState string) *Identity { return &Identity{ Identifier: id.String(), State: IdentityState{ diff --git a/internal/core/domain/identity_state.go b/internal/core/domain/identity_state.go index 3d4a9c6d6..26fc54bae 100644 --- a/internal/core/domain/identity_state.go +++ b/internal/core/domain/identity_state.go @@ -3,8 +3,8 @@ package domain import ( "time" - "github.com/iden3/go-circuits" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-circuits/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/common" ) @@ -65,7 +65,7 @@ func (i *IdentityState) TreeState() circuits.TreeState { } // ContainsID check if states contains id -func ContainsID(states []IdentityState, id *core.DID) bool { +func ContainsID(states []IdentityState, id *w3c.DID) bool { for i := range states { if states[i].Identifier == id.String() { return true diff --git a/internal/core/domain/link.go b/internal/core/domain/link.go index be089858b..e980e9e14 100644 --- a/internal/core/domain/link.go +++ b/internal/core/domain/link.go @@ -6,9 +6,9 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/iden3comm" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/iden3comm/v2" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/common" ) @@ -57,7 +57,7 @@ const ( ) // LinkCoreDID - represents a credential offer ID -type LinkCoreDID core.DID +type LinkCoreDID w3c.DID // Link - represents a credential offer type Link struct { @@ -78,7 +78,7 @@ type Link struct { // NewLink - Constructor func NewLink( - issuerDID core.DID, + issuerDID w3c.DID, maxIssuance *int, validUntil *time.Time, schemaID uuid.UUID, @@ -103,8 +103,8 @@ func NewLink( } // IssuerCoreDID - return the Core DID value -func (l *Link) IssuerCoreDID() *core.DID { - return common.ToPointer(core.DID(l.IssuerDID)) +func (l *Link) IssuerCoreDID() *w3c.DID { + return common.ToPointer(w3c.DID(l.IssuerDID)) } // Scan - scan the value for LinkCoreDID @@ -113,7 +113,7 @@ func (l *LinkCoreDID) Scan(value interface{}) error { if !ok { return fmt.Errorf("invalid value type, expected string") } - did, err := core.ParseDID(didStr) + did, err := w3c.ParseDID(didStr) if err != nil { return err } diff --git a/internal/core/domain/notification.go b/internal/core/domain/notification.go index b796ca37b..5bdb59317 100644 --- a/internal/core/domain/notification.go +++ b/internal/core/domain/notification.go @@ -3,7 +3,7 @@ package domain import ( "encoding/json" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" ) const ( diff --git a/internal/core/domain/proof.go b/internal/core/domain/proof.go index dae677a1a..2f4b52db5 100644 --- a/internal/core/domain/proof.go +++ b/internal/core/domain/proof.go @@ -3,7 +3,7 @@ package domain import ( "math/big" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/polygonid/sh-id-platform/internal/common" ) diff --git a/internal/core/domain/revocation.go b/internal/core/domain/revocation.go index 225d779c2..6d9538916 100644 --- a/internal/core/domain/revocation.go +++ b/internal/core/domain/revocation.go @@ -4,8 +4,8 @@ import ( "database/sql/driver" "strconv" - "github.com/iden3/go-circuits" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-circuits/v2" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/polygonid/sh-id-platform/internal/common" ) diff --git a/internal/core/domain/schema.go b/internal/core/domain/schema.go index 1837a43d0..5e241d3c8 100644 --- a/internal/core/domain/schema.go +++ b/internal/core/domain/schema.go @@ -5,7 +5,8 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" ) //nolint:gosec //reason: constant @@ -14,6 +15,8 @@ const ( AuthBJJCredentialJSONSchemaURL = "https://schema.iden3.io/core/json/auth.json" AuthBJJCredentialSchemaJSON = `{"$schema":"http://json-schema.org/draft-07/schema#","$metadata":{"uris":{"jsonLdContext":"https://schema.iden3.io/core/jsonld/auth.jsonld","jsonSchema":"https://schema.iden3.io/core/json/auth.json"},"serialization":{"indexDataSlotA":"x","indexDataSlotB":"y"}},"type":"object","required":["@context","id","type","issuanceDate","credentialSubject","credentialSchema","credentialStatus","issuer"],"properties":{"@context":{"type":["string","array","object"]},"id":{"type":"string"},"type":{"type":["string","array"],"items":{"type":"string"}},"issuer":{"type":["string","object"],"format":"uri","required":["id"],"properties":{"id":{"type":"string","format":"uri"}}},"issuanceDate":{"type":"string","format":"date-time"},"expirationDate":{"type":"string","format":"date-time"},"credentialSchema":{"type":"object","required":["id","type"],"properties":{"id":{"type":"string","format":"uri"},"type":{"type":"string"}}},"credentialSubject":{"type":"object","required":["x","y"],"properties":{"id":{"title":"Credential Subject ID","type":"string","format":"uri"},"x":{"type":"string"},"y":{"type":"string"}}}}}` AuthBJJCredentialSchemaType = "https://schema.iden3.io/core/jsonld/auth.jsonld#AuthBJJCredential" + + AuthBJJCredentialJSONLDContext = "https://schema.iden3.io/core/jsonld/auth.jsonld" ) // SchemaFormat type @@ -54,7 +57,7 @@ func SchemaWordsFromString(commaAttrs string) SchemaWords { // Schema defines a domain.Schema entity type Schema struct { ID uuid.UUID - IssuerDID core.DID + IssuerDID w3c.DID URL string Type string Title *string diff --git a/internal/core/ports/claims_repository.go b/internal/core/ports/claims_repository.go index d105ec580..7ef52e11a 100644 --- a/internal/core/ports/claims_repository.go +++ b/internal/core/ports/claims_repository.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -16,17 +16,17 @@ type ClaimsRepository interface { Save(ctx context.Context, conn db.Querier, claim *domain.Claim) (uuid.UUID, error) Revoke(ctx context.Context, conn db.Querier, revocation *domain.Revocation) error RevokeNonce(ctx context.Context, conn db.Querier, revocation *domain.Revocation) error - GetByRevocationNonce(ctx context.Context, conn db.Querier, identifier *core.DID, revocationNonce domain.RevNonceUint64) (*domain.Claim, error) - GetByIdAndIssuer(ctx context.Context, conn db.Querier, identifier *core.DID, claimID uuid.UUID) (*domain.Claim, error) - FindOneClaimBySchemaHash(ctx context.Context, conn db.Querier, subject *core.DID, schemaHash string) (*domain.Claim, error) - GetAllByIssuerID(ctx context.Context, conn db.Querier, identifier core.DID, filter *ClaimsFilter) ([]*domain.Claim, error) - GetNonRevokedByConnectionAndIssuerID(ctx context.Context, conn db.Querier, connID uuid.UUID, issuerID core.DID) ([]*domain.Claim, error) - GetAllByState(ctx context.Context, conn db.Querier, did *core.DID, state *merkletree.Hash) (claims []domain.Claim, err error) - GetAllByStateWithMTProof(ctx context.Context, conn db.Querier, did *core.DID, state *merkletree.Hash) (claims []domain.Claim, err error) + GetByRevocationNonce(ctx context.Context, conn db.Querier, identifier *w3c.DID, revocationNonce domain.RevNonceUint64) (*domain.Claim, error) + GetByIdAndIssuer(ctx context.Context, conn db.Querier, identifier *w3c.DID, claimID uuid.UUID) (*domain.Claim, error) + FindOneClaimBySchemaHash(ctx context.Context, conn db.Querier, subject *w3c.DID, schemaHash string) (*domain.Claim, error) + GetAllByIssuerID(ctx context.Context, conn db.Querier, identifier w3c.DID, filter *ClaimsFilter) ([]*domain.Claim, error) + GetNonRevokedByConnectionAndIssuerID(ctx context.Context, conn db.Querier, connID uuid.UUID, issuerID w3c.DID) ([]*domain.Claim, error) + GetAllByState(ctx context.Context, conn db.Querier, did *w3c.DID, state *merkletree.Hash) (claims []domain.Claim, err error) + GetAllByStateWithMTProof(ctx context.Context, conn db.Querier, did *w3c.DID, state *merkletree.Hash) (claims []domain.Claim, err error) UpdateState(ctx context.Context, conn db.Querier, claim *domain.Claim) (int64, error) - GetAuthClaimsForPublishing(ctx context.Context, conn db.Querier, identifier *core.DID, publishingState string, schemaHash string) ([]*domain.Claim, error) + GetAuthClaimsForPublishing(ctx context.Context, conn db.Querier, identifier *w3c.DID, publishingState string, schemaHash string) ([]*domain.Claim, error) UpdateClaimMTP(ctx context.Context, conn db.Querier, claim *domain.Claim) (int64, error) Delete(ctx context.Context, conn db.Querier, id uuid.UUID) error - GetClaimsIssuedForUser(ctx context.Context, conn db.Querier, identifier core.DID, userDID core.DID, linkID uuid.UUID) ([]*domain.Claim, error) - GetByStateIDWithMTPProof(ctx context.Context, conn db.Querier, did *core.DID, state string) (claims []*domain.Claim, err error) + GetClaimsIssuedForUser(ctx context.Context, conn db.Querier, identifier w3c.DID, userDID w3c.DID, linkID uuid.UUID) ([]*domain.Claim, error) + GetByStateIDWithMTPProof(ctx context.Context, conn db.Querier, did *w3c.DID, state string) (claims []*domain.Claim, err error) } diff --git a/internal/core/ports/claims_service.go b/internal/core/ports/claims_service.go index 46fd3853a..b3a1f8d8b 100644 --- a/internal/core/ports/claims_service.go +++ b/internal/core/ports/claims_service.go @@ -7,10 +7,10 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" - comm "github.com/iden3/iden3comm" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" + comm "github.com/iden3/iden3comm/v2" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -18,7 +18,7 @@ import ( // CreateClaimRequest struct type CreateClaimRequest struct { - DID *core.DID + DID *w3c.DID Schema string CredentialSubject map[string]any Expiration *time.Time @@ -36,8 +36,8 @@ type CreateClaimRequest struct { type AgentRequest struct { Body json.RawMessage ThreadID string - IssuerDID *core.DID - UserDID *core.DID + IssuerDID *w3c.DID + UserDID *w3c.DID ClaimID uuid.UUID Typ comm.MediaType Type comm.ProtocolMessage @@ -91,7 +91,7 @@ func NewClaimsFilter(schemaHash, schemaType, subject, queryField, queryValue *st } // NewCreateClaimRequest returns a new claim object with the given parameters -func NewCreateClaimRequest(did *core.DID, credentialSchema string, credentialSubject map[string]any, expiration *time.Time, typ string, cVersion *uint32, subjectPos *string, merklizedRootPosition *string, sigProof *bool, mtProof *bool, linkID *uuid.UUID, singleIssuer bool) *CreateClaimRequest { +func NewCreateClaimRequest(did *w3c.DID, credentialSchema string, credentialSubject map[string]any, expiration *time.Time, typ string, cVersion *uint32, subjectPos *string, merklizedRootPosition *string, sigProof *bool, mtProof *bool, linkID *uuid.UUID, singleIssuer bool) *CreateClaimRequest { if sigProof == nil { sigProof = common.ToPointer(false) } @@ -133,7 +133,7 @@ func NewAgentRequest(basicMessage *comm.BasicMessage) (*AgentRequest, error) { return nil, fmt.Errorf("'to' field cannot be empty") } - toDID, err := core.ParseDID(basicMessage.To) + toDID, err := w3c.ParseDID(basicMessage.To) if err != nil { return nil, err } @@ -142,7 +142,7 @@ func NewAgentRequest(basicMessage *comm.BasicMessage) (*AgentRequest, error) { return nil, fmt.Errorf("'from' field cannot be empty") } - fromDID, err := core.ParseDID(basicMessage.From) + fromDID, err := w3c.ParseDID(basicMessage.From) if err != nil { return nil, err } @@ -179,16 +179,16 @@ func NewAgentRequest(basicMessage *comm.BasicMessage) (*AgentRequest, error) { type ClaimsService interface { Save(ctx context.Context, claimReq *CreateClaimRequest) (*domain.Claim, error) CreateCredential(ctx context.Context, req *CreateClaimRequest) (*domain.Claim, error) - Revoke(ctx context.Context, id core.DID, nonce uint64, description string) error - GetAll(ctx context.Context, did core.DID, filter *ClaimsFilter) ([]*domain.Claim, error) - RevokeAllFromConnection(ctx context.Context, connID uuid.UUID, issuerID core.DID) error - GetRevocationStatus(ctx context.Context, issuerDID core.DID, nonce uint64) (*verifiable.RevocationStatus, error) - GetByID(ctx context.Context, issID *core.DID, id uuid.UUID) (*domain.Claim, error) - GetCredentialQrCode(ctx context.Context, issID *core.DID, id uuid.UUID, hostURL string) (string, error) + Revoke(ctx context.Context, id w3c.DID, nonce uint64, description string) error + GetAll(ctx context.Context, did w3c.DID, filter *ClaimsFilter) ([]*domain.Claim, error) + RevokeAllFromConnection(ctx context.Context, connID uuid.UUID, issuerID w3c.DID) error + GetRevocationStatus(ctx context.Context, issuerDID w3c.DID, nonce uint64) (*verifiable.RevocationStatus, error) + GetByID(ctx context.Context, issID *w3c.DID, id uuid.UUID) (*domain.Claim, error) + GetCredentialQrCode(ctx context.Context, issID *w3c.DID, id uuid.UUID, hostURL string) (string, error) Agent(ctx context.Context, req *AgentRequest) (*domain.Agent, error) - GetAuthClaim(ctx context.Context, did *core.DID) (*domain.Claim, error) - GetAuthClaimForPublishing(ctx context.Context, did *core.DID, state string) (*domain.Claim, error) + GetAuthClaim(ctx context.Context, did *w3c.DID) (*domain.Claim, error) + GetAuthClaimForPublishing(ctx context.Context, did *w3c.DID, state string) (*domain.Claim, error) UpdateClaimsMTPAndState(ctx context.Context, currentState *domain.IdentityState) error Delete(ctx context.Context, id uuid.UUID) error - GetByStateIDWithMTPProof(ctx context.Context, did *core.DID, state string) ([]*domain.Claim, error) + GetByStateIDWithMTPProof(ctx context.Context, did *w3c.DID, state string) ([]*domain.Claim, error) } diff --git a/internal/core/ports/connections_repository.go b/internal/core/ports/connections_repository.go index 9e882c98b..795da5aa6 100644 --- a/internal/core/ports/connections_repository.go +++ b/internal/core/ports/connections_repository.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -13,10 +13,10 @@ import ( // ConnectionsRepository defines the available methods for connections repository type ConnectionsRepository interface { Save(ctx context.Context, conn db.Querier, connection *domain.Connection) (uuid.UUID, error) - Delete(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID core.DID) error - DeleteCredentials(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID core.DID) error - GetByIDAndIssuerID(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID core.DID) (*domain.Connection, error) - GetByUserID(ctx context.Context, conn db.Querier, issuerDID core.DID, userDID core.DID) (*domain.Connection, error) - GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerDID core.DID, query string) ([]*domain.Connection, error) - GetAllWithCredentialsByIssuerID(ctx context.Context, conn db.Querier, issuerDID core.DID, query string) ([]*domain.Connection, error) + Delete(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID w3c.DID) error + DeleteCredentials(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID w3c.DID) error + GetByIDAndIssuerID(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID w3c.DID) (*domain.Connection, error) + GetByUserID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, userDID w3c.DID) (*domain.Connection, error) + GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, query string) ([]*domain.Connection, error) + GetAllWithCredentialsByIssuerID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, query string) ([]*domain.Connection, error) } diff --git a/internal/core/ports/connections_service.go b/internal/core/ports/connections_service.go index 5a387b4b3..5d279d37c 100644 --- a/internal/core/ports/connections_service.go +++ b/internal/core/ports/connections_service.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) @@ -46,9 +46,9 @@ func NewDeleteRequest(connID uuid.UUID, deleteCredentials *bool, revokeCredentia // ConnectionsService is the interface implemented by the Connections service type ConnectionsService interface { - Delete(ctx context.Context, id uuid.UUID, deleteCredentials bool, issuerDID core.DID) error - DeleteCredentials(ctx context.Context, id uuid.UUID, issuerID core.DID) error - GetByIDAndIssuerID(ctx context.Context, id uuid.UUID, issuerDID core.DID) (*domain.Connection, error) - GetByUserID(ctx context.Context, issuerDID core.DID, userID core.DID) (*domain.Connection, error) - GetAllByIssuerID(ctx context.Context, issuerDID core.DID, query string, withCredentials bool) ([]*domain.Connection, error) + Delete(ctx context.Context, id uuid.UUID, deleteCredentials bool, issuerDID w3c.DID) error + DeleteCredentials(ctx context.Context, id uuid.UUID, issuerID w3c.DID) error + GetByIDAndIssuerID(ctx context.Context, id uuid.UUID, issuerDID w3c.DID) (*domain.Connection, error) + GetByUserID(ctx context.Context, issuerDID w3c.DID, userID w3c.DID) (*domain.Connection, error) + GetAllByIssuerID(ctx context.Context, issuerDID w3c.DID, query string, withCredentials bool) ([]*domain.Connection, error) } diff --git a/internal/core/ports/identity_merkletree_repository.go b/internal/core/ports/identity_merkletree_repository.go index bdaccc571..0455d7266 100644 --- a/internal/core/ports/identity_merkletree_repository.go +++ b/internal/core/ports/identity_merkletree_repository.go @@ -3,7 +3,7 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -14,5 +14,5 @@ type IdentityMerkleTreeRepository interface { Save(ctx context.Context, conn db.Querier, identifier string, mtType uint16) (*domain.IdentityMerkleTree, error) UpdateByID(ctx context.Context, conn db.Querier, imt *domain.IdentityMerkleTree) error GetByID(ctx context.Context, conn db.Querier, mtID uint64) (*domain.IdentityMerkleTree, error) - GetByIdentifierAndTypes(ctx context.Context, conn db.Querier, identifier *core.DID, mtTypes []uint16) ([]domain.IdentityMerkleTree, error) + GetByIdentifierAndTypes(ctx context.Context, conn db.Querier, identifier *w3c.DID, mtTypes []uint16) ([]domain.IdentityMerkleTree, error) } diff --git a/internal/core/ports/identity_repository.go b/internal/core/ports/identity_repository.go index 9090f4d18..9cbc6ecf6 100644 --- a/internal/core/ports/identity_repository.go +++ b/internal/core/ports/identity_repository.go @@ -3,7 +3,7 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -12,9 +12,9 @@ import ( // IndentityRepository is the interface implemented by the identity service type IndentityRepository interface { Save(ctx context.Context, conn db.Querier, identity *domain.Identity) error - GetByID(ctx context.Context, conn db.Querier, identifier core.DID) (*domain.Identity, error) + GetByID(ctx context.Context, conn db.Querier, identifier w3c.DID) (*domain.Identity, error) Get(ctx context.Context, conn db.Querier) (identities []string, err error) - GetUnprocessedIssuersIDs(ctx context.Context, conn db.Querier) (issuersIDs []*core.DID, err error) - HasUnprocessedStatesByID(ctx context.Context, conn db.Querier, identifier *core.DID) (bool, error) - HasUnprocessedAndFailedStatesByID(ctx context.Context, conn db.Querier, identifier *core.DID) (bool, error) + GetUnprocessedIssuersIDs(ctx context.Context, conn db.Querier) (issuersIDs []*w3c.DID, err error) + HasUnprocessedStatesByID(ctx context.Context, conn db.Querier, identifier *w3c.DID) (bool, error) + HasUnprocessedAndFailedStatesByID(ctx context.Context, conn db.Querier, identifier *w3c.DID) (bool, error) } diff --git a/internal/core/ports/identity_service.go b/internal/core/ports/identity_service.go index e8502ed4f..e625a8846 100644 --- a/internal/core/ports/identity_service.go +++ b/internal/core/ports/identity_service.go @@ -4,9 +4,10 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" - "github.com/iden3/iden3comm/protocol" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/kms" @@ -14,22 +15,22 @@ import ( // IdentityService is the interface implemented by the identity service type IdentityService interface { - GetByDID(ctx context.Context, identifier core.DID) (*domain.Identity, error) + GetByDID(ctx context.Context, identifier w3c.DID) (*domain.Identity, error) Create(ctx context.Context, DIDMethod string, Blockchain, NetworkID, hostURL string) (*domain.Identity, error) SignClaimEntry(ctx context.Context, authClaim *domain.Claim, claimEntry *core.Claim) (*verifiable.BJJSignatureProof2021, error) Get(ctx context.Context) (identities []string, err error) - UpdateState(ctx context.Context, did core.DID) (*domain.IdentityState, error) - Exists(ctx context.Context, identifier core.DID) (bool, error) - GetLatestStateByID(ctx context.Context, identifier core.DID) (*domain.IdentityState, error) + UpdateState(ctx context.Context, did w3c.DID) (*domain.IdentityState, error) + Exists(ctx context.Context, identifier w3c.DID) (bool, error) + GetLatestStateByID(ctx context.Context, identifier w3c.DID) (*domain.IdentityState, error) GetKeyIDFromAuthClaim(ctx context.Context, authClaim *domain.Claim) (kms.KeyID, error) - GetUnprocessedIssuersIDs(ctx context.Context) ([]*core.DID, error) - HasUnprocessedStatesByID(ctx context.Context, identifier core.DID) (bool, error) - HasUnprocessedAndFailedStatesByID(ctx context.Context, identifier core.DID) (bool, error) + GetUnprocessedIssuersIDs(ctx context.Context) ([]*w3c.DID, error) + HasUnprocessedStatesByID(ctx context.Context, identifier w3c.DID) (bool, error) + HasUnprocessedAndFailedStatesByID(ctx context.Context, identifier w3c.DID) (bool, error) GetNonTransactedStates(ctx context.Context) ([]domain.IdentityState, error) UpdateIdentityState(ctx context.Context, state *domain.IdentityState) error GetTransactedStates(ctx context.Context) ([]domain.IdentityState, error) - GetStates(ctx context.Context, issuerDID core.DID) ([]domain.IdentityState, error) - CreateAuthenticationQRCode(ctx context.Context, serverURL string, issuerDID core.DID) (string, error) - Authenticate(ctx context.Context, message string, sessionID uuid.UUID, serverURL string, issuerDID core.DID) (*protocol.AuthorizationResponseMessage, error) - GetFailedState(ctx context.Context, identifier core.DID) (*domain.IdentityState, error) + GetStates(ctx context.Context, issuerDID w3c.DID) ([]domain.IdentityState, error) + CreateAuthenticationQRCode(ctx context.Context, serverURL string, issuerDID w3c.DID) (string, error) + Authenticate(ctx context.Context, message string, sessionID uuid.UUID, serverURL string, issuerDID w3c.DID) (*protocol.AuthorizationResponseMessage, error) + GetFailedState(ctx context.Context, identifier w3c.DID) (*domain.IdentityState, error) } diff --git a/internal/core/ports/identity_state_repository.go b/internal/core/ports/identity_state_repository.go index 178c9d8bf..d25796606 100644 --- a/internal/core/ports/identity_state_repository.go +++ b/internal/core/ports/identity_state_repository.go @@ -3,7 +3,7 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -12,9 +12,9 @@ import ( // IdentityStateRepository interface that defines the available methods type IdentityStateRepository interface { Save(ctx context.Context, conn db.Querier, state domain.IdentityState) error - GetLatestStateByIdentifier(ctx context.Context, conn db.Querier, identifier *core.DID) (*domain.IdentityState, error) + GetLatestStateByIdentifier(ctx context.Context, conn db.Querier, identifier *w3c.DID) (*domain.IdentityState, error) GetStatesByStatus(ctx context.Context, conn db.Querier, status domain.IdentityStatus) ([]domain.IdentityState, error) - GetStates(ctx context.Context, conn db.Querier, issuerDID core.DID) ([]domain.IdentityState, error) - GetStatesByStatusAndIssuerID(ctx context.Context, conn db.Querier, status domain.IdentityStatus, issuerID core.DID) ([]domain.IdentityState, error) + GetStates(ctx context.Context, conn db.Querier, issuerDID w3c.DID) ([]domain.IdentityState, error) + GetStatesByStatusAndIssuerID(ctx context.Context, conn db.Querier, status domain.IdentityStatus, issuerID w3c.DID) ([]domain.IdentityState, error) UpdateState(ctx context.Context, conn db.Querier, state *domain.IdentityState) (int64, error) } diff --git a/internal/core/ports/link_repository.go b/internal/core/ports/link_repository.go index 448ba7517..1cff5ff2b 100644 --- a/internal/core/ports/link_repository.go +++ b/internal/core/ports/link_repository.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -13,7 +13,7 @@ import ( // LinkRepository the interface that defines the available methods type LinkRepository interface { Save(ctx context.Context, conn db.Querier, link *domain.Link) (*uuid.UUID, error) - GetByID(ctx context.Context, issuerID core.DID, id uuid.UUID) (*domain.Link, error) - GetAll(ctx context.Context, issuerDID core.DID, status LinkStatus, query *string) ([]domain.Link, error) - Delete(ctx context.Context, id uuid.UUID, issuerDID core.DID) error + GetByID(ctx context.Context, issuerID w3c.DID, id uuid.UUID) (*domain.Link, error) + GetAll(ctx context.Context, issuerDID w3c.DID, status LinkStatus, query *string) ([]domain.Link, error) + Delete(ctx context.Context, id uuid.UUID, issuerDID w3c.DID) error } diff --git a/internal/core/ports/link_service.go b/internal/core/ports/link_service.go index 1703976e4..e6bf51d4b 100644 --- a/internal/core/ports/link_service.go +++ b/internal/core/ports/link_service.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" linkState "github.com/polygonid/sh-id-platform/pkg/link" @@ -47,12 +47,12 @@ type GetQRCodeResponse struct { // LinkService - the interface that defines the available methods type LinkService interface { - Save(ctx context.Context, did core.DID, maxIssuance *int, validUntil *time.Time, schemaID uuid.UUID, credentialExpiration *time.Time, credentialSignatureProof bool, credentialMTPProof bool, credentialAttributes domain.CredentialSubject) (*domain.Link, error) - Activate(ctx context.Context, issuerID core.DID, linkID uuid.UUID, active bool) error - Delete(ctx context.Context, id uuid.UUID, did core.DID) error - GetByID(ctx context.Context, issuerID core.DID, id uuid.UUID) (*domain.Link, error) - GetAll(ctx context.Context, issuerDID core.DID, status LinkStatus, query *string) ([]domain.Link, error) - CreateQRCode(ctx context.Context, issuerDID core.DID, linkID uuid.UUID, serverURL string) (*CreateQRCodeResponse, error) - IssueClaim(ctx context.Context, sessionID string, issuerDID core.DID, userDID core.DID, linkID uuid.UUID, hostURL string) error - GetQRCode(ctx context.Context, sessionID uuid.UUID, issuerID core.DID, linkID uuid.UUID) (*GetQRCodeResponse, error) + Save(ctx context.Context, did w3c.DID, maxIssuance *int, validUntil *time.Time, schemaID uuid.UUID, credentialExpiration *time.Time, credentialSignatureProof bool, credentialMTPProof bool, credentialAttributes domain.CredentialSubject) (*domain.Link, error) + Activate(ctx context.Context, issuerID w3c.DID, linkID uuid.UUID, active bool) error + Delete(ctx context.Context, id uuid.UUID, did w3c.DID) error + GetByID(ctx context.Context, issuerID w3c.DID, id uuid.UUID) (*domain.Link, error) + GetAll(ctx context.Context, issuerDID w3c.DID, status LinkStatus, query *string) ([]domain.Link, error) + CreateQRCode(ctx context.Context, issuerDID w3c.DID, linkID uuid.UUID, serverURL string) (*CreateQRCodeResponse, error) + IssueClaim(ctx context.Context, sessionID string, issuerDID w3c.DID, userDID w3c.DID, linkID uuid.UUID, hostURL string) error + GetQRCode(ctx context.Context, sessionID uuid.UUID, issuerID w3c.DID, linkID uuid.UUID) (*GetQRCodeResponse, error) } diff --git a/internal/core/ports/mt_service.go b/internal/core/ports/mt_service.go index 6afe8c15a..e9c5a9bfa 100644 --- a/internal/core/ports/mt_service.go +++ b/internal/core/ports/mt_service.go @@ -3,7 +3,7 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -12,5 +12,5 @@ import ( // MtService is the interface that defines the MT Methods type MtService interface { CreateIdentityMerkleTrees(ctx context.Context, conn db.Querier) (*domain.IdentityMerkleTrees, error) - GetIdentityMerkleTrees(ctx context.Context, conn db.Querier, identifier *core.DID) (*domain.IdentityMerkleTrees, error) + GetIdentityMerkleTrees(ctx context.Context, conn db.Querier, identifier *w3c.DID) (*domain.IdentityMerkleTrees, error) } diff --git a/internal/core/ports/notification_service.go b/internal/core/ports/notification_service.go index ade2ed143..f4da905d9 100644 --- a/internal/core/ports/notification_service.go +++ b/internal/core/ports/notification_service.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/pkg/pubsub" diff --git a/internal/core/ports/proof_service.go b/internal/core/ports/proof_service.go index b62379bb6..91084b817 100644 --- a/internal/core/ports/proof_service.go +++ b/internal/core/ports/proof_service.go @@ -5,7 +5,7 @@ import ( "fmt" "math/big" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) @@ -29,5 +29,5 @@ func (q *Query) SchemaType() string { // ProofService is the interface implemented by the ProofService service type ProofService interface { - PrepareInputs(ctx context.Context, identifier *core.DID, query Query) ([]byte, []*domain.Claim, error) + PrepareInputs(ctx context.Context, identifier *w3c.DID, query Query) ([]byte, []*domain.Claim, error) } diff --git a/internal/core/ports/publisher.go b/internal/core/ports/publisher.go index 4bdc38999..bffbb037b 100644 --- a/internal/core/ports/publisher.go +++ b/internal/core/ports/publisher.go @@ -3,14 +3,14 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) // Publisher - Define the interface for publisher services type Publisher interface { - PublishState(ctx context.Context, identity *core.DID) (*domain.PublishedState, error) - RetryPublishState(ctx context.Context, identifier *core.DID) (*domain.PublishedState, error) + PublishState(ctx context.Context, identity *w3c.DID) (*domain.PublishedState, error) + RetryPublishState(ctx context.Context, identifier *w3c.DID) (*domain.PublishedState, error) CheckTransactionStatus(ctx context.Context) } diff --git a/internal/core/ports/revocation_repository.go b/internal/core/ports/revocation_repository.go index 9f3216859..d9e5eef34 100644 --- a/internal/core/ports/revocation_repository.go +++ b/internal/core/ports/revocation_repository.go @@ -3,7 +3,7 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/db" @@ -11,5 +11,5 @@ import ( // RevocationRepository interface that defines the available methods type RevocationRepository interface { - UpdateStatus(ctx context.Context, conn db.Querier, did *core.DID) ([]*domain.Revocation, error) + UpdateStatus(ctx context.Context, conn db.Querier, did *w3c.DID) ([]*domain.Revocation, error) } diff --git a/internal/core/ports/revocation_service.go b/internal/core/ports/revocation_service.go index 32c35e233..b4d32697e 100644 --- a/internal/core/ports/revocation_service.go +++ b/internal/core/ports/revocation_service.go @@ -3,11 +3,11 @@ package ports import ( "context" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" ) // RevocationService is the interface implemented by the RevocationService service type RevocationService interface { - Status(ctx context.Context, credStatus interface{}, issuerDID *core.DID) (*verifiable.RevocationStatus, error) + Status(ctx context.Context, credStatus interface{}, issuerDID *w3c.DID) (*verifiable.RevocationStatus, error) } diff --git a/internal/core/ports/schema_repository.go b/internal/core/ports/schema_repository.go index 79d85fa0f..b1cbdcb48 100644 --- a/internal/core/ports/schema_repository.go +++ b/internal/core/ports/schema_repository.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) @@ -12,6 +12,6 @@ import ( // SchemaRepository interface that define repo methods for schemas type SchemaRepository interface { Save(ctx context.Context, schema *domain.Schema) error - GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) (*domain.Schema, error) - GetAll(ctx context.Context, issuerDID core.DID, query *string) ([]domain.Schema, error) + GetByID(ctx context.Context, issuerDID w3c.DID, id uuid.UUID) (*domain.Schema, error) + GetAll(ctx context.Context, issuerDID w3c.DID, query *string) ([]domain.Schema, error) } diff --git a/internal/core/ports/schema_service.go b/internal/core/ports/schema_service.go index d92015e77..005243f4e 100644 --- a/internal/core/ports/schema_service.go +++ b/internal/core/ports/schema_service.go @@ -4,16 +4,16 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) // SchemaService defines the methods that Schema manager will expose. type SchemaService interface { - ImportSchema(ctx context.Context, issuerDID core.DID, req *ImportSchemaRequest) (*domain.Schema, error) - GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) (*domain.Schema, error) - GetAll(ctx context.Context, issuerDID core.DID, query *string) ([]domain.Schema, error) + ImportSchema(ctx context.Context, issuerDID w3c.DID, req *ImportSchemaRequest) (*domain.Schema, error) + GetByID(ctx context.Context, issuerDID w3c.DID, id uuid.UUID) (*domain.Schema, error) + GetAll(ctx context.Context, issuerDID w3c.DID, query *string) ([]domain.Schema, error) } // ImportSchemaRequest defines the request for importing a schema diff --git a/internal/core/ports/session_repository.go b/internal/core/ports/session_repository.go index 19d1a7e70..f3ef3dad5 100644 --- a/internal/core/ports/session_repository.go +++ b/internal/core/ports/session_repository.go @@ -3,7 +3,7 @@ package ports import ( "context" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/iden3comm/v2/protocol" link_state "github.com/polygonid/sh-id-platform/pkg/link" ) diff --git a/internal/core/services/claims.go b/internal/core/services/claims.go index d6cae92d2..0d457bac8 100644 --- a/internal/core/services/claims.go +++ b/internal/core/services/claims.go @@ -11,13 +11,14 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" - "github.com/iden3/go-schema-processor/merklize" - "github.com/iden3/go-schema-processor/processor" - "github.com/iden3/go-schema-processor/verifiable" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-schema-processor/v2/merklize" + "github.com/iden3/go-schema-processor/v2/processor" + "github.com/iden3/go-schema-processor/v2/verifiable" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" shell "github.com/ipfs/go-ipfs-api" "github.com/jackc/pgx/v4" @@ -26,6 +27,7 @@ import ( "github.com/polygonid/sh-id-platform/internal/core/event" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/db" + "github.com/polygonid/sh-id-platform/internal/jsonschema" "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/repositories" @@ -61,13 +63,13 @@ type claim struct { qrService ports.QrStoreService identityStateRepository ports.IdentityStateRepository storage *db.Storage - loaderFactory loader.Factory + loader loader.DocumentLoader publisher pubsub.Publisher ipfsClient *shell.Shell } // NewClaim creates a new claim service -func NewClaim(repo ports.ClaimsRepository, idenSrv ports.IdentityService, qrService ports.QrStoreService, mtService ports.MtService, identityStateRepository ports.IdentityStateRepository, ld loader.Factory, storage *db.Storage, cfg ClaimCfg, ps pubsub.Publisher, ipfsGatewayURL string) ports.ClaimsService { +func NewClaim(repo ports.ClaimsRepository, idenSrv ports.IdentityService, qrService ports.QrStoreService, mtService ports.MtService, identityStateRepository ports.IdentityStateRepository, ld loader.DocumentLoader, storage *db.Storage, cfg ClaimCfg, ps pubsub.Publisher, ipfsGatewayURL string) ports.ClaimsService { s := &claim{ cfg: ClaimCfg{ RHSEnabled: cfg.RHSEnabled, @@ -80,7 +82,7 @@ func NewClaim(repo ports.ClaimsRepository, idenSrv ports.IdentityService, qrServ qrService: qrService, identityStateRepository: identityStateRepository, storage: storage, - loaderFactory: ld, + loader: ld, publisher: ps, } if ipfsGatewayURL != "" { @@ -125,7 +127,7 @@ func (c *claim) CreateCredential(ctx context.Context, req *ports.CreateClaimRequ return nil, err } - schema, err := schemaPkg.LoadSchema(ctx, c.loaderFactory(req.Schema)) + schema, err := schemaPkg.LoadSchema(ctx, c.loader, req.Schema) if err != nil { log.Error(ctx, "loading schema", "err", err, "schema", req.Schema) return nil, ErrLoadingSchema @@ -148,12 +150,12 @@ func (c *claim) CreateCredential(ctx context.Context, req *ports.CreateClaimRequ return nil, err } - jsonLDCtxBytes, _, err := c.loaderFactory(jsonLdContext).Load(ctx) + jsonLD, err := jsonschema.Load(ctx, jsonLdContext, c.loader) if err != nil { log.Error(ctx, "loading jsonLdContext", "err", err, "url", jsonLdContext) return nil, err } - credentialType, err := merklize.TypeIDFromContext(jsonLDCtxBytes, req.Type) + credentialType, err := merklize.TypeIDFromContext(jsonLD.BytesNoErr(), req.Type) if err != nil { log.Error(ctx, "getting credential type", "err", err) return nil, err @@ -169,7 +171,7 @@ func (c *claim) CreateCredential(ctx context.Context, req *ports.CreateClaimRequ opts.MerklizerOpts = []merklize.MerklizeOption{merklize.WithIPFSClient(c.ipfsClient)} } - coreClaim, err := schemaPkg.Process(ctx, c.loaderFactory(req.Schema), credentialType, vc, opts) + coreClaim, err := schemaPkg.Process(ctx, c.loader, req.Schema, vc, opts) if err != nil { log.Error(ctx, "credential subject attributes don't match the provided schema", "err", err) if errors.Is(err, schemaPkg.ErrParseClaim) { @@ -243,11 +245,11 @@ func (c *claim) CreateCredential(ctx context.Context, req *ports.CreateClaimRequ return claim, nil } -func (c *claim) Revoke(ctx context.Context, id core.DID, nonce uint64, description string) error { +func (c *claim) Revoke(ctx context.Context, id w3c.DID, nonce uint64, description string) error { return c.revoke(ctx, &id, nonce, description, c.storage.Pgx) } -func (c *claim) RevokeAllFromConnection(ctx context.Context, connID uuid.UUID, issuerID core.DID) error { +func (c *claim) RevokeAllFromConnection(ctx context.Context, connID uuid.UUID, issuerID w3c.DID) error { credentials, err := c.icRepo.GetNonRevokedByConnectionAndIssuerID(ctx, c.storage.Pgx, connID, issuerID) if err != nil { return err @@ -277,7 +279,7 @@ func (c *claim) Delete(ctx context.Context, id uuid.UUID) error { return nil } -func (c *claim) GetByID(ctx context.Context, issID *core.DID, id uuid.UUID) (*domain.Claim, error) { +func (c *claim) GetByID(ctx context.Context, issID *w3c.DID, id uuid.UUID) (*domain.Claim, error) { claim, err := c.icRepo.GetByIdAndIssuer(ctx, c.storage.Pgx, issID, id) if err != nil { if errors.Is(err, repositories.ErrClaimDoesNotExist) { @@ -290,7 +292,7 @@ func (c *claim) GetByID(ctx context.Context, issID *core.DID, id uuid.UUID) (*do } // GetCredentialQrCode creates a credential QR code for the given credential and returns the QR Link to be used -func (c *claim) GetCredentialQrCode(ctx context.Context, issID *core.DID, id uuid.UUID, hostURL string) (string, error) { +func (c *claim) GetCredentialQrCode(ctx context.Context, issID *w3c.DID, id uuid.UUID, hostURL string) (string, error) { getCredentialType := func(credentialType string) string { const schemaParts = 2 parse := strings.Split(credentialType, "#") @@ -349,7 +351,7 @@ func (c *claim) Agent(ctx context.Context, req *ports.AgentRequest) (*domain.Age return c.getAgentCredential(ctx, req) // at this point the type is already validated } -func (c *claim) GetAuthClaim(ctx context.Context, did *core.DID) (*domain.Claim, error) { +func (c *claim) GetAuthClaim(ctx context.Context, did *w3c.DID) (*domain.Claim, error) { authHash, err := core.AuthSchemaHash.MarshalText() if err != nil { return nil, err @@ -357,7 +359,7 @@ func (c *claim) GetAuthClaim(ctx context.Context, did *core.DID) (*domain.Claim, return c.icRepo.FindOneClaimBySchemaHash(ctx, c.storage.Pgx, did, string(authHash)) } -func (c *claim) GetAll(ctx context.Context, did core.DID, filter *ports.ClaimsFilter) ([]*domain.Claim, error) { +func (c *claim) GetAll(ctx context.Context, did w3c.DID, filter *ports.ClaimsFilter) ([]*domain.Claim, error) { claims, err := c.icRepo.GetAllByIssuerID(ctx, c.storage.Pgx, did, filter) if err != nil { if errors.Is(err, repositories.ErrClaimDoesNotExist) { @@ -369,7 +371,7 @@ func (c *claim) GetAll(ctx context.Context, did core.DID, filter *ports.ClaimsFi return claims, nil } -func (c *claim) GetRevocationStatus(ctx context.Context, issuerDID core.DID, nonce uint64) (*verifiable.RevocationStatus, error) { +func (c *claim) GetRevocationStatus(ctx context.Context, issuerDID w3c.DID, nonce uint64) (*verifiable.RevocationStatus, error) { rID := new(big.Int).SetUint64(nonce) revocationStatus := &verifiable.RevocationStatus{} @@ -413,7 +415,7 @@ func (c *claim) GetRevocationStatus(ctx context.Context, issuerDID core.DID, non return revocationStatus, nil } -func (c *claim) GetAuthClaimForPublishing(ctx context.Context, did *core.DID, state string) (*domain.Claim, error) { +func (c *claim) GetAuthClaimForPublishing(ctx context.Context, did *w3c.DID, state string) (*domain.Claim, error) { authHash, err := core.AuthSchemaHash.MarshalText() if err != nil { return nil, err @@ -432,7 +434,7 @@ func (c *claim) GetAuthClaimForPublishing(ctx context.Context, did *core.DID, st // UpdateClaimsMTPAndState update identity status and claim MTP func (c *claim) UpdateClaimsMTPAndState(ctx context.Context, currentState *domain.IdentityState) error { - did, err := core.ParseDID(currentState.Identifier) + did, err := w3c.ParseDID(currentState.Identifier) if err != nil { return err } @@ -520,11 +522,11 @@ func (c *claim) UpdateClaimsMTPAndState(ctx context.Context, currentState *domai return nil } -func (c *claim) GetByStateIDWithMTPProof(ctx context.Context, did *core.DID, state string) ([]*domain.Claim, error) { +func (c *claim) GetByStateIDWithMTPProof(ctx context.Context, did *w3c.DID, state string) ([]*domain.Claim, error) { return c.icRepo.GetByStateIDWithMTPProof(ctx, c.storage.Pgx, did, state) } -func (c *claim) revoke(ctx context.Context, did *core.DID, nonce uint64, description string, pgx db.Querier) error { +func (c *claim) revoke(ctx context.Context, did *w3c.DID, nonce uint64, description string, pgx db.Querier) error { rID := new(big.Int).SetUint64(nonce) revocation := domain.Revocation{ Identifier: did.String(), @@ -629,7 +631,7 @@ func (c *claim) newVerifiableCredential(claimReq *ports.CreateClaimRequest, vcID credentialSubject := claimReq.CredentialSubject if idSubject, ok := credentialSubject["id"].(string); ok { - did, err := core.ParseDID(idSubject) + did, err := w3c.ParseDID(idSubject) if err != nil { return verifiable.W3CCredential{}, err } @@ -677,7 +679,7 @@ func (c *claim) getRevocationSource(issuerDID string, nonce uint64, singleIssuer } } -func (c *claim) buildCredentialID(issuerDID core.DID, credID uuid.UUID, singleIssuer bool) string { +func (c *claim) buildCredentialID(issuerDID w3c.DID, credID uuid.UUID, singleIssuer bool) string { if singleIssuer { return fmt.Sprintf("%s/v1/credentials/%s", strings.TrimSuffix(c.cfg.Host, "/"), credID.String()) } diff --git a/internal/core/services/connections.go b/internal/core/services/connections.go index 6f44e8947..28b55994b 100644 --- a/internal/core/services/connections.go +++ b/internal/core/services/connections.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgx/v4" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -30,7 +30,7 @@ func NewConnection(connRepo ports.ConnectionsRepository, storage *db.Storage) po } } -func (c *connection) Delete(ctx context.Context, id uuid.UUID, deleteCredentials bool, issuerDID core.DID) error { +func (c *connection) Delete(ctx context.Context, id uuid.UUID, deleteCredentials bool, issuerDID w3c.DID) error { return c.storage.Pgx.BeginFunc(ctx, func(tx pgx.Tx) error { if deleteCredentials { @@ -43,11 +43,11 @@ func (c *connection) Delete(ctx context.Context, id uuid.UUID, deleteCredentials }) } -func (c *connection) DeleteCredentials(ctx context.Context, id uuid.UUID, issuerID core.DID) error { +func (c *connection) DeleteCredentials(ctx context.Context, id uuid.UUID, issuerID w3c.DID) error { return c.deleteCredentials(ctx, id, issuerID, c.storage.Pgx) } -func (c *connection) GetByIDAndIssuerID(ctx context.Context, id uuid.UUID, issuerDID core.DID) (*domain.Connection, error) { +func (c *connection) GetByIDAndIssuerID(ctx context.Context, id uuid.UUID, issuerDID w3c.DID) (*domain.Connection, error) { conn, err := c.connRepo.GetByIDAndIssuerID(ctx, c.storage.Pgx, id, issuerDID) if err != nil { if errors.Is(err, repositories.ErrConnectionDoesNotExist) { @@ -59,7 +59,7 @@ func (c *connection) GetByIDAndIssuerID(ctx context.Context, id uuid.UUID, issue return conn, nil } -func (c *connection) GetByUserID(ctx context.Context, issuerDID core.DID, userID core.DID) (*domain.Connection, error) { +func (c *connection) GetByUserID(ctx context.Context, issuerDID w3c.DID, userID w3c.DID) (*domain.Connection, error) { conn, err := c.connRepo.GetByUserID(ctx, c.storage.Pgx, issuerDID, userID) if err != nil { if errors.Is(err, repositories.ErrConnectionDoesNotExist) { @@ -71,7 +71,7 @@ func (c *connection) GetByUserID(ctx context.Context, issuerDID core.DID, userID return conn, nil } -func (c *connection) GetAllByIssuerID(ctx context.Context, issuerDID core.DID, query string, withCredentials bool) ([]*domain.Connection, error) { +func (c *connection) GetAllByIssuerID(ctx context.Context, issuerDID w3c.DID, query string, withCredentials bool) ([]*domain.Connection, error) { if withCredentials { return c.connRepo.GetAllWithCredentialsByIssuerID(ctx, c.storage.Pgx, issuerDID, query) } @@ -79,7 +79,7 @@ func (c *connection) GetAllByIssuerID(ctx context.Context, issuerDID core.DID, q return c.connRepo.GetAllByIssuerID(ctx, c.storage.Pgx, issuerDID, query) } -func (c *connection) delete(ctx context.Context, id uuid.UUID, issuerDID core.DID, pgx db.Querier) error { +func (c *connection) delete(ctx context.Context, id uuid.UUID, issuerDID w3c.DID, pgx db.Querier) error { err := c.connRepo.Delete(ctx, pgx, id, issuerDID) if err != nil { if errors.Is(err, repositories.ErrConnectionDoesNotExist) { @@ -91,6 +91,6 @@ func (c *connection) delete(ctx context.Context, id uuid.UUID, issuerDID core.DI return nil } -func (c *connection) deleteCredentials(ctx context.Context, id uuid.UUID, issuerID core.DID, pgx db.Querier) error { +func (c *connection) deleteCredentials(ctx context.Context, id uuid.UUID, issuerID w3c.DID, pgx db.Querier) error { return c.connRepo.DeleteCredentials(ctx, pgx, id, issuerID) } diff --git a/internal/core/services/identity.go b/internal/core/services/identity.go index e18c68502..ef884bfdd 100644 --- a/internal/core/services/identity.go +++ b/internal/core/services/identity.go @@ -13,15 +13,15 @@ import ( "time" "github.com/google/uuid" - auth "github.com/iden3/go-iden3-auth" - "github.com/iden3/go-iden3-auth/pubsignals" - core "github.com/iden3/go-iden3-core" + auth "github.com/iden3/go-iden3-auth/v2" + "github.com/iden3/go-iden3-auth/v2/pubsignals" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/babyjub" "github.com/iden3/go-merkletree-sql/v2" - jsonSuite "github.com/iden3/go-schema-processor/json" - "github.com/iden3/go-schema-processor/verifiable" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-schema-processor/v2/verifiable" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" "github.com/jackc/pgx/v4" "github.com/polygonid/sh-id-platform/internal/common" @@ -90,12 +90,12 @@ func NewIdentity(kms kms.KMSType, identityRepository ports.IndentityRepository, } } -func (i *identity) GetByDID(ctx context.Context, identifier core.DID) (*domain.Identity, error) { +func (i *identity) GetByDID(ctx context.Context, identifier w3c.DID) (*domain.Identity, error) { return i.identityRepository.GetByID(ctx, i.storage.Pgx, identifier) } func (i *identity) Create(ctx context.Context, DIDMethod string, blockchain, networkID, hostURL string) (*domain.Identity, error) { - var identifier *core.DID + var identifier *w3c.DID var err error err = i.storage.Pgx.BeginFunc(ctx, func(tx pgx.Tx) error { @@ -171,7 +171,7 @@ func (i *identity) SignClaimEntry(ctx context.Context, authClaim *domain.Claim, return &proof, nil } -func (i *identity) Exists(ctx context.Context, identifier core.DID) (bool, error) { +func (i *identity) Exists(ctx context.Context, identifier w3c.DID) (bool, error) { identity, err := i.identityRepository.GetByID(ctx, i.storage.Pgx, identifier) if err != nil { return false, err @@ -189,7 +189,7 @@ func (i *identity) getKeyIDFromAuthClaim(ctx context.Context, authClaim *domain. return keyID, errors.New("identifier is empty in auth claim") } - identity, err := core.ParseDID(*authClaim.Identifier) + identity, err := w3c.ParseDID(*authClaim.Identifier) if err != nil { return keyID, err } @@ -230,7 +230,7 @@ func (i *identity) Get(ctx context.Context) (identities []string, err error) { } // GetLatestStateByID get latest identity state by identifier -func (i *identity) GetLatestStateByID(ctx context.Context, identifier core.DID) (*domain.IdentityState, error) { +func (i *identity) GetLatestStateByID(ctx context.Context, identifier w3c.DID) (*domain.IdentityState, error) { // check that identity exists in the db state, err := i.identityStateRepository.GetLatestStateByIdentifier(ctx, i.storage.Pgx, &identifier) if err != nil { @@ -252,7 +252,7 @@ func (i *identity) GetKeyIDFromAuthClaim(ctx context.Context, authClaim *domain. return keyID, errors.New("identifier is empty in auth claim") } - identity, err := core.ParseDID(*authClaim.Identifier) + identity, err := w3c.ParseDID(*authClaim.Identifier) if err != nil { return keyID, err } @@ -288,7 +288,7 @@ func (i *identity) GetKeyIDFromAuthClaim(ctx context.Context, authClaim *domain. return keyID, errors.New("private key not found") } -func (i *identity) UpdateState(ctx context.Context, did core.DID) (*domain.IdentityState, error) { +func (i *identity) UpdateState(ctx context.Context, did w3c.DID) (*domain.IdentityState, error) { newState := &domain.IdentityState{ Identifier: did.String(), Status: domain.StatusCreated, @@ -374,7 +374,7 @@ func (i *identity) UpdateIdentityState(ctx context.Context, state *domain.Identi return err } -func (i *identity) Authenticate(ctx context.Context, message string, sessionID uuid.UUID, serverURL string, issuerDID core.DID) (*protocol.AuthorizationResponseMessage, error) { +func (i *identity) Authenticate(ctx context.Context, message string, sessionID uuid.UUID, serverURL string, issuerDID w3c.DID) (*protocol.AuthorizationResponseMessage, error) { authReq, err := i.sessionManager.Get(ctx, sessionID.String()) if err != nil { log.Warn(ctx, "authentication session not found") @@ -395,7 +395,7 @@ func (i *identity) Authenticate(ctx context.Context, message string, sessionID u } bytesIssuerDoc = sanitizeIssuerDoc(bytesIssuerDoc) - userDID, err := core.ParseDID(arm.From) + userDID, err := w3c.ParseDID(arm.From) if err != nil { log.Error(ctx, "failed to parse userDID", "err", err) return nil, err @@ -425,7 +425,7 @@ func (i *identity) Authenticate(ctx context.Context, message string, sessionID u return arm, nil } -func (i *identity) CreateAuthenticationQRCode(ctx context.Context, serverURL string, issuerDID core.DID) (string, error) { +func (i *identity) CreateAuthenticationQRCode(ctx context.Context, serverURL string, issuerDID w3c.DID) (string, error) { sessionID := uuid.New().String() reqID := uuid.New().String() @@ -455,7 +455,7 @@ func (i *identity) CreateAuthenticationQRCode(ctx context.Context, serverURL str return i.qrService.ToURL(serverURL, id), nil } -func (i *identity) update(ctx context.Context, conn db.Querier, id *core.DID, currentState domain.IdentityState) error { +func (i *identity) update(ctx context.Context, conn db.Querier, id *w3c.DID, currentState domain.IdentityState) error { claims, err := i.claimsRepository.GetAllByState(ctx, conn, id, nil) if err != nil { return err @@ -531,7 +531,7 @@ func populateIdentityState(ctx context.Context, trees *domain.IdentityMerkleTree return nil } -func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod string, blockchain, networkID, hostURL string) (*core.DID, *big.Int, error) { +func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod string, blockchain, networkID, hostURL string) (*w3c.DID, *big.Int, error) { mts, err := i.mtService.CreateIdentityMerkleTrees(ctx, tx) if err != nil { return nil, nil, fmt.Errorf("can't create identity markle tree: %w", err) @@ -571,13 +571,12 @@ func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod } // TODO: add config options for blockchain and network - // didType, err := core.BuildDIDType(core.DIDMethodPolygonID, core.Polygon, core.Mumbai) didType, err := core.BuildDIDType(core.DIDMethod(DIDMethod), core.Blockchain(blockchain), core.NetworkID(networkID)) if err != nil { return nil, nil, ErrWrongDIDMetada } - identifier, err := core.IdGenesisFromIdenState(didType, currentState.BigInt()) + identifier, err := core.NewIDFromIdenState(didType, currentState.BigInt()) if err != nil { return nil, nil, fmt.Errorf("can't genesis from state: %w", err) } @@ -617,12 +616,15 @@ func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod return nil, nil, fmt.Errorf("can't marshal claim data: %w", err) } + jsonLdContext := domain.AuthBJJCredentialJSONLDContext + cr := common.CredentialRequest{ CredentialSchema: domain.AuthBJJCredentialJSONSchemaURL, Type: domain.AuthBJJCredential, CredentialSubject: marshalledClaimData, Version: 0, RevNonce: &revNonce, + LDContext: jsonLdContext, } exp, ok := authClaim.GetExpirationDate() @@ -632,24 +634,13 @@ func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod cr.Expiration = exp.Unix() } - var schema jsonSuite.Schema - err = json.Unmarshal([]byte(domain.AuthBJJCredentialSchemaJSON), &schema) - if err != nil { - return nil, nil, fmt.Errorf("can't unmarshal the shema: %w", err) - } - - var jsonLdContext string - if jsonLdContext, ok = schema.Metadata.Uris["jsonLdContext"].(string); !ok { - return nil, nil, fmt.Errorf("invalid: %w", err) - } - credentialType := fmt.Sprintf("%s#%s", jsonLdContext, domain.AuthBJJCredential) claimID, err := uuid.NewUUID() if err != nil { return nil, nil, fmt.Errorf("can't crate uuid: %w", err) } - cred, err := common.CreateCredential(did, cr, schema) + cred, err := common.CreateCredential(did, cr) if err != nil { return nil, nil, fmt.Errorf("can't create credential: %w", err) } @@ -723,7 +714,7 @@ func (i *identity) createIdentity(ctx context.Context, tx db.Querier, DIDMethod return did, currentState.BigInt(), nil } -func (i *identity) getAuthClaimMtpProof(ctx context.Context, claimsTree *merkletree.MerkleTree, currentState *merkletree.Hash, authClaim *core.Claim, did *core.DID) (verifiable.Iden3SparseMerkleTreeProof, error) { +func (i *identity) getAuthClaimMtpProof(ctx context.Context, claimsTree *merkletree.MerkleTree, currentState *merkletree.Hash, authClaim *core.Claim, did *w3c.DID) (verifiable.Iden3SparseMerkleTreeProof, error) { index, err := authClaim.HIndex() if err != nil { return verifiable.Iden3SparseMerkleTreeProof{}, err @@ -772,19 +763,19 @@ func (i *identity) GetTransactedStates(ctx context.Context) ([]domain.IdentitySt return states, nil } -func (i *identity) GetStates(ctx context.Context, issuerDID core.DID) ([]domain.IdentityState, error) { +func (i *identity) GetStates(ctx context.Context, issuerDID w3c.DID) ([]domain.IdentityState, error) { return i.identityStateRepository.GetStates(ctx, i.storage.Pgx, issuerDID) } -func (i *identity) GetUnprocessedIssuersIDs(ctx context.Context) ([]*core.DID, error) { +func (i *identity) GetUnprocessedIssuersIDs(ctx context.Context) ([]*w3c.DID, error) { return i.identityRepository.GetUnprocessedIssuersIDs(ctx, i.storage.Pgx) } -func (i *identity) HasUnprocessedStatesByID(ctx context.Context, identifier core.DID) (bool, error) { +func (i *identity) HasUnprocessedStatesByID(ctx context.Context, identifier w3c.DID) (bool, error) { return i.identityRepository.HasUnprocessedStatesByID(ctx, i.storage.Pgx, &identifier) } -func (i *identity) HasUnprocessedAndFailedStatesByID(ctx context.Context, identifier core.DID) (bool, error) { +func (i *identity) HasUnprocessedAndFailedStatesByID(ctx context.Context, identifier w3c.DID) (bool, error) { return i.identityRepository.HasUnprocessedAndFailedStatesByID(ctx, i.storage.Pgx, &identifier) } @@ -797,7 +788,7 @@ func (i *identity) GetNonTransactedStates(ctx context.Context) ([]domain.Identit return states, nil } -func (i *identity) GetFailedState(ctx context.Context, identifier core.DID) (*domain.IdentityState, error) { +func (i *identity) GetFailedState(ctx context.Context, identifier w3c.DID) (*domain.IdentityState, error) { states, err := i.identityStateRepository.GetStatesByStatusAndIssuerID(ctx, i.storage.Pgx, domain.StatusFailed, identifier) if err != nil { return nil, fmt.Errorf("error getting failed state: %w", err) @@ -828,7 +819,7 @@ func bjjPubKey(keyMS kms.KMSType, keyID kms.KeyID) (*babyjub.PublicKey, error) { return kms.DecodeBJJPubKey(keyBytes) } -func newDIDDocument(serverURL string, issuerDID core.DID) verifiable.DIDDocument { +func newDIDDocument(serverURL string, issuerDID w3c.DID) verifiable.DIDDocument { return verifiable.DIDDocument{ Context: []string{serviceContext}, ID: issuerDID.String(), diff --git a/internal/core/services/link.go b/internal/core/services/link.go index 52c36c5a7..122bde508 100644 --- a/internal/core/services/link.go +++ b/internal/core/services/link.go @@ -8,9 +8,9 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" "github.com/jackc/pgx/v4" "github.com/polygonid/sh-id-platform/internal/common" @@ -49,14 +49,14 @@ type Link struct { claimRepository ports.ClaimsRepository linkRepository ports.LinkRepository schemaRepository ports.SchemaRepository - loaderFactory loader.Factory + loader loader.DocumentLoader sessionManager ports.SessionRepository publisher pubsub.Publisher ipfsGateway string } // NewLinkService - constructor -func NewLinkService(storage *db.Storage, claimsService ports.ClaimsService, qrService ports.QrStoreService, claimRepository ports.ClaimsRepository, linkRepository ports.LinkRepository, schemaRepository ports.SchemaRepository, loaderFactory loader.Factory, sessionManager ports.SessionRepository, publisher pubsub.Publisher, ipfsGatewayURL string) ports.LinkService { +func NewLinkService(storage *db.Storage, claimsService ports.ClaimsService, qrService ports.QrStoreService, claimRepository ports.ClaimsRepository, linkRepository ports.LinkRepository, schemaRepository ports.SchemaRepository, ld loader.DocumentLoader, sessionManager ports.SessionRepository, publisher pubsub.Publisher, ipfsGatewayURL string) ports.LinkService { return &Link{ storage: storage, claimsService: claimsService, @@ -64,7 +64,7 @@ func NewLinkService(storage *db.Storage, claimsService ports.ClaimsService, qrSe claimRepository: claimRepository, linkRepository: linkRepository, schemaRepository: schemaRepository, - loaderFactory: loaderFactory, + loader: ld, sessionManager: sessionManager, publisher: publisher, ipfsGateway: ipfsGatewayURL, @@ -74,7 +74,7 @@ func NewLinkService(storage *db.Storage, claimsService ports.ClaimsService, qrSe // Save - save a new credential func (ls *Link) Save( ctx context.Context, - did core.DID, + did w3c.DID, maxIssuance *int, validUntil *time.Time, schemaID uuid.UUID, @@ -105,7 +105,7 @@ func (ls *Link) Save( } // Activate - activates or deactivates a credential link -func (ls *Link) Activate(ctx context.Context, issuerID core.DID, linkID uuid.UUID, active bool) error { +func (ls *Link) Activate(ctx context.Context, issuerID w3c.DID, linkID uuid.UUID, active bool) error { link, err := ls.linkRepository.GetByID(ctx, issuerID, linkID) if err != nil { return err @@ -125,7 +125,7 @@ func (ls *Link) Activate(ctx context.Context, issuerID core.DID, linkID uuid.UUI } // GetByID returns a link by id and issuerDID -func (ls *Link) GetByID(ctx context.Context, issuerID core.DID, id uuid.UUID) (*domain.Link, error) { +func (ls *Link) GetByID(ctx context.Context, issuerID w3c.DID, id uuid.UUID) (*domain.Link, error) { link, err := ls.linkRepository.GetByID(ctx, issuerID, id) if err != nil { if errors.Is(err, repositories.ErrLinkDoesNotExist) { @@ -138,17 +138,17 @@ func (ls *Link) GetByID(ctx context.Context, issuerID core.DID, id uuid.UUID) (* } // GetAll returns all links from issueDID of type lType filtered by query string -func (ls *Link) GetAll(ctx context.Context, issuerDID core.DID, status ports.LinkStatus, query *string) ([]domain.Link, error) { +func (ls *Link) GetAll(ctx context.Context, issuerDID w3c.DID, status ports.LinkStatus, query *string) ([]domain.Link, error) { return ls.linkRepository.GetAll(ctx, issuerDID, status, query) } // Delete - delete a link by id -func (ls *Link) Delete(ctx context.Context, id uuid.UUID, did core.DID) error { +func (ls *Link) Delete(ctx context.Context, id uuid.UUID, did w3c.DID) error { return ls.linkRepository.Delete(ctx, id, did) } // CreateQRCode - generates a qr code for a link -func (ls *Link) CreateQRCode(ctx context.Context, issuerDID core.DID, linkID uuid.UUID, serverURL string) (*ports.CreateQRCodeResponse, error) { +func (ls *Link) CreateQRCode(ctx context.Context, issuerDID w3c.DID, linkID uuid.UUID, serverURL string) (*ports.CreateQRCodeResponse, error) { link, err := ls.GetByID(ctx, issuerDID, linkID) if err != nil { return nil, err @@ -201,7 +201,7 @@ func (ls *Link) CreateQRCode(ctx context.Context, issuerDID core.DID, linkID uui } // IssueClaim - Create a new claim -func (ls *Link) IssueClaim(ctx context.Context, sessionID string, issuerDID core.DID, userDID core.DID, linkID uuid.UUID, hostURL string) error { +func (ls *Link) IssueClaim(ctx context.Context, sessionID string, issuerDID w3c.DID, userDID w3c.DID, linkID uuid.UUID, hostURL string) error { link, err := ls.linkRepository.GetByID(ctx, issuerDID, linkID) if err != nil { log.Error(ctx, "cannot fetch the link", "err", err) @@ -314,7 +314,7 @@ func (ls *Link) IssueClaim(ctx context.Context, sessionID string, issuerDID core } // GetQRCode - return the link qr code. -func (ls *Link) GetQRCode(ctx context.Context, sessionID uuid.UUID, issuerID core.DID, linkID uuid.UUID) (*ports.GetQRCodeResponse, error) { +func (ls *Link) GetQRCode(ctx context.Context, sessionID uuid.UUID, issuerID w3c.DID, linkID uuid.UUID) (*ports.GetQRCodeResponse, error) { link, err := ls.GetByID(ctx, issuerID, linkID) if err != nil { log.Error(ctx, "error fetching the link from the database", "err", err) @@ -352,5 +352,5 @@ func (ls *Link) validate(ctx context.Context, link *domain.Link) error { } func (ls *Link) validateCredentialSubjectAgainstSchema(ctx context.Context, cSubject domain.CredentialSubject, schemaDB *domain.Schema) error { - return jsonschema.ValidateCredentialSubject(ctx, ls.ipfsGateway, schemaDB.URL, schemaDB.Type, cSubject) + return jsonschema.ValidateCredentialSubject(ctx, ls.loader, schemaDB.URL, schemaDB.Type, cSubject) } diff --git a/internal/core/services/mt.go b/internal/core/services/mt.go index 20fe2604d..05c764675 100644 --- a/internal/core/services/mt.go +++ b/internal/core/services/mt.go @@ -5,7 +5,7 @@ import ( "crypto/rand" "fmt" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" sql "github.com/iden3/go-merkletree-sql/db/pgx/v2" "github.com/iden3/go-merkletree-sql/v2" "github.com/mr-tron/base58" @@ -79,7 +79,7 @@ func (mts *mtService) CreateIdentityMerkleTrees(ctx context.Context, conn db.Que return imts, nil } -func (mts *mtService) GetIdentityMerkleTrees(ctx context.Context, conn db.Querier, identifier *core.DID) (*domain.IdentityMerkleTrees, error) { +func (mts *mtService) GetIdentityMerkleTrees(ctx context.Context, conn db.Querier, identifier *w3c.DID) (*domain.IdentityMerkleTrees, error) { trees := make([]*merkletree.MerkleTree, mtTypesCount) imtModels := make([]*domain.IdentityMerkleTree, mtTypesCount) imts, err := mts.imtRepo.GetByIdentifierAndTypes(ctx, conn, identifier, mtTypes) diff --git a/internal/core/services/notification.go b/internal/core/services/notification.go index d42036508..5dbe13adb 100644 --- a/internal/core/services/notification.go +++ b/internal/core/services/notification.go @@ -7,8 +7,8 @@ import ( "fmt" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/event" @@ -52,7 +52,7 @@ func (n *notification) SendCreateConnectionNotification(ctx context.Context, e p } func (n *notification) sendCreateCredentialNotification(ctx context.Context, issuerID string, credIDs []string) error { - issuerDID, err := core.ParseDID(issuerID) + issuerDID, err := w3c.ParseDID(issuerID) if err != nil { log.Error(ctx, "sendCreateCredentialNotification: failed to parse issuerID", "err", err.Error(), "issuerID", issuerID) return err @@ -75,7 +75,7 @@ func (n *notification) sendCreateCredentialNotification(ctx context.Context, iss } if credentialsUserID == "" { - userDID, err := core.ParseDID(credential.OtherIdentifier) + userDID, err := w3c.ParseDID(credential.OtherIdentifier) if err != nil { log.Error(ctx, "sendCreateCredentialNotification: failed to parse credential userID", "err", err.Error(), "issuerID", issuerID, "credID", credID) return err @@ -109,7 +109,7 @@ func (n *notification) sendCreateCredentialNotification(ctx context.Context, iss } func (n *notification) sendCreateConnectionNotification(ctx context.Context, issuerID string, connID string) error { - issuerDID, err := core.ParseDID(issuerID) + issuerDID, err := w3c.ParseDID(issuerID) if err != nil { log.Error(ctx, "sendCreateConnectionNotification: failed to parse issuerID", "err", err.Error(), "issuerID", issuerID, "connectionID", connID) return err diff --git a/internal/core/services/proof.go b/internal/core/services/proof.go index be2880dcc..7b38f980a 100644 --- a/internal/core/services/proof.go +++ b/internal/core/services/proof.go @@ -11,20 +11,23 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/google/uuid" "github.com/iden3/contracts-abi/state/go/abi" - "github.com/iden3/go-circuits" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-circuits/v2" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/babyjub" "github.com/iden3/go-merkletree-sql/v2" - jsonSuite "github.com/iden3/go-schema-processor/json" - "github.com/iden3/go-schema-processor/merklize" - "github.com/iden3/go-schema-processor/processor" - "github.com/iden3/go-schema-processor/verifiable" + jsonSuite "github.com/iden3/go-schema-processor/v2/json" + "github.com/iden3/go-schema-processor/v2/merklize" + "github.com/iden3/go-schema-processor/v2/processor" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/jackc/pgx/v4" + "github.com/piprate/json-gold/ld" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/db" + "github.com/polygonid/sh-id-platform/internal/jsonschema" "github.com/polygonid/sh-id-platform/internal/kms" "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" @@ -52,11 +55,11 @@ type Proof struct { keyProvider *kms.KMS storage *db.Storage stateContract *abi.State - schemaLoader loader.Factory + schemaLoader loader.DocumentLoader } // NewProofService init proof service -func NewProofService(claimSrv ports.ClaimsService, revocationSrv ports.RevocationService, identitySrv ports.IdentityService, mtService ports.MtService, claimsRepository ports.ClaimsRepository, keyProvider *kms.KMS, storage *db.Storage, stateContract *abi.State, ld loader.Factory) ports.ProofService { +func NewProofService(claimSrv ports.ClaimsService, revocationSrv ports.RevocationService, identitySrv ports.IdentityService, mtService ports.MtService, claimsRepository ports.ClaimsRepository, keyProvider *kms.KMS, storage *db.Storage, stateContract *abi.State, ld ld.DocumentLoader) ports.ProofService { return &Proof{ claimSrv: claimSrv, revocationSrv: revocationSrv, @@ -73,7 +76,7 @@ func NewProofService(claimSrv ports.ClaimsService, revocationSrv ports.Revocatio // PrepareInputs prepare inputs for circuit. // //nolint:gocyclo // refactor later to avoid big PR. -func (p *Proof) PrepareInputs(ctx context.Context, identifier *core.DID, query ports.Query) ([]byte, []*domain.Claim, error) { +func (p *Proof) PrepareInputs(ctx context.Context, identifier *w3c.DID, query ports.Query) ([]byte, []*domain.Claim, error) { var claims []*domain.Claim var err error var claim *domain.Claim @@ -114,7 +117,7 @@ func (p *Proof) PrepareInputs(ctx context.Context, identifier *core.DID, query p return inputs, claims, nil } -func (p *Proof) prepareAtomicQuerySigV2Circuit(ctx context.Context, did *core.DID, query ports.Query) (circuits.InputsMarshaller, *domain.Claim, error) { +func (p *Proof) prepareAtomicQuerySigV2Circuit(ctx context.Context, did *w3c.DID, query ports.Query) (circuits.InputsMarshaller, *domain.Claim, error) { claim, claimNonRevProof, err := p.getClaimDataForAtomicQueryCircuit(ctx, did, query) if err != nil { return nil, nil, err @@ -130,7 +133,7 @@ func (p *Proof) prepareAtomicQuerySigV2Circuit(ctx context.Context, did *core.DI return nil, nil, err } - issuerDID, err := core.ParseDID(claim.Issuer) + issuerDID, err := w3c.ParseDID(claim.Issuer) if err != nil { return nil, nil, err } @@ -166,13 +169,18 @@ func (p *Proof) prepareAtomicQuerySigV2Circuit(ctx context.Context, did *core.DI IssuerAuthNonRevProof: issuerAuthNonRevProof, } + id, err := core.IDFromDID(*did) + if err != nil { + return nil, nil, err + } + inputs := circuits.AtomicQuerySigV2Inputs{ RequestID: big.NewInt(defaultAtomicCircuitsID), - ID: &did.ID, + ID: &id, ProfileNonce: big.NewInt(0), ClaimSubjectProfileNonce: big.NewInt(0), Claim: circuits.ClaimWithSigProof{ - IssuerID: &issuerDID.ID, + IssuerID: &id, Claim: claim.CoreClaim.Get(), NonRevProof: *claimNonRevProof, SignatureProof: sig1, @@ -185,7 +193,7 @@ func (p *Proof) prepareAtomicQuerySigV2Circuit(ctx context.Context, did *core.DI return inputs, claim, nil } -func (p *Proof) prepareAtomicQueryMTPV2Circuit(ctx context.Context, did *core.DID, query ports.Query) (circuits.InputsMarshaller, *domain.Claim, error) { +func (p *Proof) prepareAtomicQueryMTPV2Circuit(ctx context.Context, did *w3c.DID, query ports.Query) (circuits.InputsMarshaller, *domain.Claim, error) { claim, claimNonRevProof, err := p.getClaimDataForAtomicQueryCircuit(ctx, did, query) if err != nil { return nil, nil, err @@ -201,13 +209,18 @@ func (p *Proof) prepareAtomicQueryMTPV2Circuit(ctx context.Context, did *core.DI return nil, nil, err } + id, err := core.IDFromDID(*did) + if err != nil { + return nil, nil, err + } + inputs := circuits.AtomicQueryMTPV2Inputs{ RequestID: big.NewInt(defaultAtomicCircuitsID), - ID: &did.ID, + ID: &id, ProfileNonce: big.NewInt(0), ClaimSubjectProfileNonce: big.NewInt(0), Claim: circuits.ClaimWithMTPProof{ - IssuerID: &did.ID, // claim.Issuer, + IssuerID: &id, // claim.Issuer, Claim: claim.CoreClaim.Get(), NonRevProof: *claimNonRevProof, IncProof: claimInc, @@ -220,7 +233,7 @@ func (p *Proof) prepareAtomicQueryMTPV2Circuit(ctx context.Context, did *core.DI return inputs, claim, nil } -func (p *Proof) getClaimDataForAtomicQueryCircuit(ctx context.Context, identifier *core.DID, query ports.Query) (claim *domain.Claim, revStatus *circuits.MTProof, err error) { +func (p *Proof) getClaimDataForAtomicQueryCircuit(ctx context.Context, identifier *w3c.DID, query ports.Query) (claim *domain.Claim, revStatus *circuits.MTProof, err error) { var claims []*domain.Claim if query.ClaimID != "" { @@ -264,7 +277,7 @@ func (p *Proof) getClaimDataForAtomicQueryCircuit(ctx context.Context, identifie return claim, &claimRs, nil } -func (p *Proof) findClaimForQuery(ctx context.Context, identifier *core.DID, query ports.Query) ([]*domain.Claim, error) { +func (p *Proof) findClaimForQuery(ctx context.Context, identifier *w3c.DID, query ports.Query) ([]*domain.Claim, error) { var err error // TODO "query_value": value, @@ -292,7 +305,7 @@ func (p *Proof) checkRevocationStatus(ctx context.Context, claim *domain.Claim) if err = json.Unmarshal(claim.CredentialStatus.Bytes, &cs); err != nil { return nil, fmt.Errorf("failed unmasrshal credentialStatus: %s", err) } - issuerDID, err := core.ParseDID(claim.Issuer) + issuerDID, err := w3c.ParseDID(claim.Issuer) if err != nil { return nil, err } @@ -405,7 +418,7 @@ func (p *Proof) prepareMerklizedQuery(ctx context.Context, claim domain.Claim, q return circuits.Query{}, err } - schema, _, err := p.schemaLoader(query.Context).Load(ctx) + schema, err := jsonschema.Load(ctx, query.Context, p.schemaLoader) if err != nil { return circuits.Query{}, err } @@ -413,7 +426,7 @@ func (p *Proof) prepareMerklizedQuery(ctx context.Context, claim domain.Claim, q fieldPath := merklize.Path{} if field != "" { - fieldPath, err = merklize.NewFieldPathFromContext(schema, query.Type, field) + fieldPath, err = merklize.NewFieldPathFromContext(schema.BytesNoErr(), query.Type, field) if err != nil { return circuits.Query{}, err } @@ -452,9 +465,9 @@ func (p *Proof) prepareNonMerklizedQuery(ctx context.Context, jsonSchemaURL stri parser := jsonSuite.Parser{} pr := processor.InitProcessorOptions(&processor.Processor{}, processor.WithParser(parser), - processor.WithSchemaLoader(p.schemaLoader(jsonSchemaURL))) + processor.WithDocumentLoader(p.schemaLoader)) - schema, _, err := pr.Load(ctx) + schema, err := jsonschema.Load(ctx, jsonSchemaURL, p.schemaLoader) if err != nil { return circuits.Query{}, err } @@ -468,7 +481,7 @@ func (p *Proof) prepareNonMerklizedQuery(ctx context.Context, jsonSchemaURL stri return circuits.Query{}, err } - circuitQuery.SlotIndex, err = pr.GetFieldSlotIndex(field, schema) + circuitQuery.SlotIndex, err = pr.GetFieldSlotIndex(field, query.Type, schema.BytesNoErr()) if err != nil { return circuits.Query{}, err } @@ -476,7 +489,7 @@ func (p *Proof) prepareNonMerklizedQuery(ctx context.Context, jsonSchemaURL stri return circuitQuery, nil } -func (p *Proof) callNonRevProof(ctx context.Context, issuerData verifiable.IssuerData, issuerDID *core.DID) (circuits.MTProof, error) { +func (p *Proof) callNonRevProof(ctx context.Context, issuerData verifiable.IssuerData, issuerDID *w3c.DID) (circuits.MTProof, error) { nonRevProof, err := p.revocationSrv.Status(ctx, issuerData.CredentialStatus, issuerDID) if err != nil && errors.Is(err, protocol.ErrStateNotFound) { @@ -515,7 +528,7 @@ func (p *Proof) callNonRevProof(ctx context.Context, issuerData verifiable.Issue }, nil } -func (p *Proof) prepareAuthV2Circuit(ctx context.Context, identifier *core.DID, challenge *big.Int) (circuits.AuthV2Inputs, error) { +func (p *Proof) prepareAuthV2Circuit(ctx context.Context, identifier *w3c.DID, challenge *big.Int) (circuits.AuthV2Inputs, error) { authClaim, err := p.claimSrv.GetAuthClaim(ctx, identifier) if err != nil { return circuits.AuthV2Inputs{}, err @@ -529,11 +542,15 @@ func (p *Proof) prepareAuthV2Circuit(ctx context.Context, identifier *core.DID, if err != nil { return circuits.AuthV2Inputs{}, err } - globalTree, err := populateGlobalTree(ctx, identifier, p.stateContract) + globalTree, err := populateGlobalTree(ctx, *identifier, p.stateContract) + if err != nil { + return circuits.AuthV2Inputs{}, err + } + id, err := core.IDFromDID(*identifier) if err != nil { return circuits.AuthV2Inputs{}, err } - circuitInputs := prepareAuthV2CircuitInputs(identifier, authClaimData, challenge, signature, globalTree) + circuitInputs := prepareAuthV2CircuitInputs(id, authClaimData, challenge, signature, globalTree) return circuitInputs, nil } @@ -554,7 +571,7 @@ func (p *Proof) signChallange(ctx context.Context, authClaim *domain.Claim, chal return kms.DecodeBJJSignature(sigBytes) } -func (p *Proof) fillAuthClaimData(ctx context.Context, identifier *core.DID, authClaim *domain.Claim) (circuits.ClaimWithMTPProof, error) { +func (p *Proof) fillAuthClaimData(ctx context.Context, identifier *w3c.DID, authClaim *domain.Claim) (circuits.ClaimWithMTPProof, error) { var authClaimData circuits.ClaimWithMTPProof err := p.storage.Pgx.BeginFunc( @@ -613,9 +630,9 @@ func (p *Proof) fillAuthClaimData(ctx context.Context, identifier *core.DID, aut return authClaimData, nil } -func prepareAuthV2CircuitInputs(did *core.DID, authClaim circuits.ClaimWithMTPProof, challenge *big.Int, signature *babyjub.Signature, globalMTP circuits.GISTProof) circuits.AuthV2Inputs { +func prepareAuthV2CircuitInputs(id core.ID, authClaim circuits.ClaimWithMTPProof, challenge *big.Int, signature *babyjub.Signature, globalMTP circuits.GISTProof) circuits.AuthV2Inputs { return circuits.AuthV2Inputs{ - GenesisID: &did.ID, + GenesisID: &id, ProfileNonce: big.NewInt(0), AuthClaim: authClaim.Claim, AuthClaimIncMtp: authClaim.IncProof.Proof, @@ -627,9 +644,13 @@ func prepareAuthV2CircuitInputs(did *core.DID, authClaim circuits.ClaimWithMTPPr } } -func populateGlobalTree(ctx context.Context, did *core.DID, contract *abi.State) (circuits.GISTProof, error) { +func populateGlobalTree(ctx context.Context, did w3c.DID, contract *abi.State) (circuits.GISTProof, error) { // get global root - globalProof, err := contract.GetGISTProof(&bind.CallOpts{Context: ctx}, did.ID.BigInt()) + id, err := core.IDFromDID(did) + if err != nil { + return circuits.GISTProof{}, err + } + globalProof, err := contract.GetGISTProof(&bind.CallOpts{Context: ctx}, id.BigInt()) if err != nil { return circuits.GISTProof{}, err } diff --git a/internal/core/services/revocation.go b/internal/core/services/revocation.go index 150fc0923..97cc6e037 100644 --- a/internal/core/services/revocation.go +++ b/internal/core/services/revocation.go @@ -12,9 +12,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/iden3/contracts-abi/state/go/abi" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" proof "github.com/iden3/merkletree-proof" "github.com/polygonid/sh-id-platform/internal/log" @@ -47,10 +48,14 @@ func NewRevocationService(ethStore StateStore, contract common.Address) *Revocat } // Status returns the current revocation status -func (r *Revocation) Status(ctx context.Context, credStatus interface{}, issuerDID *core.DID) (*verifiable.RevocationStatus, error) { +func (r *Revocation) Status(ctx context.Context, credStatus interface{}, issuerDID *w3c.DID) (*verifiable.RevocationStatus, error) { switch status := credStatus.(type) { case *verifiable.RHSCredentialStatus: - latestStateInfo, err := r.eth.GetLatestStateByID(ctx, r.contract, issuerDID.ID.BigInt()) + id, err := core.IDFromDID(*issuerDID) + if err != nil { + return nil, fmt.Errorf("failed parse issuer DID '%s': %v", issuerDID, err) + } + latestStateInfo, err := r.eth.GetLatestStateByID(ctx, r.contract, id.BigInt()) if err != nil && strings.Contains(err.Error(), protocol.ErrStateNotFound.Error()) { return nil, protocol.ErrStateNotFound } diff --git a/internal/core/services/schema.go b/internal/core/services/schema.go index 23d887562..c8bfef9ee 100644 --- a/internal/core/services/schema.go +++ b/internal/core/services/schema.go @@ -6,7 +6,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" @@ -17,17 +17,17 @@ import ( ) type schema struct { - repo ports.SchemaRepository - loaderFactory loader.Factory + repo ports.SchemaRepository + loader loader.DocumentLoader } // NewSchema is the schema service constructor -func NewSchema(repo ports.SchemaRepository, lf loader.Factory) *schema { - return &schema{repo: repo, loaderFactory: lf} +func NewSchema(repo ports.SchemaRepository, loader loader.DocumentLoader) *schema { + return &schema{repo: repo, loader: loader} } // GetByID returns a domain.Schema by ID -func (s *schema) GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) (*domain.Schema, error) { +func (s *schema) GetByID(ctx context.Context, issuerDID w3c.DID, id uuid.UUID) (*domain.Schema, error) { schema, err := s.repo.GetByID(ctx, issuerDID, id) if errors.Is(err, repositories.ErrSchemaDoesNotExist) { return nil, ErrSchemaNotFound @@ -39,13 +39,13 @@ func (s *schema) GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) } // GetAll return all schemas in the database that matches the query string -func (s *schema) GetAll(ctx context.Context, issuerDID core.DID, query *string) ([]domain.Schema, error) { +func (s *schema) GetAll(ctx context.Context, issuerDID w3c.DID, query *string) ([]domain.Schema, error) { return s.repo.GetAll(ctx, issuerDID, query) } // ImportSchema process an schema url and imports into the system -func (s *schema) ImportSchema(ctx context.Context, did core.DID, req *ports.ImportSchemaRequest) (*domain.Schema, error) { - remoteSchema, err := jsonschema.Load(ctx, s.loaderFactory(req.URL)) +func (s *schema) ImportSchema(ctx context.Context, did w3c.DID, req *ports.ImportSchemaRequest) (*domain.Schema, error) { + remoteSchema, err := jsonschema.Load(ctx, req.URL, s.loader) if err != nil { log.Error(ctx, "loading jsonschema", "err", err, "jsonschema", req.URL) return nil, ErrLoadingSchema diff --git a/internal/core/services/tests/identity_test.go b/internal/core/services/tests/identity_test.go index 7662132a6..a67b05554 100644 --- a/internal/core/services/tests/identity_test.go +++ b/internal/core/services/tests/identity_test.go @@ -5,14 +5,14 @@ import ( "testing" "time" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/core/services" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/pubsub" "github.com/polygonid/sh-id-platform/pkg/reverse_hash" @@ -35,26 +35,25 @@ func Test_identity_UpdateState(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "https://host.com", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, docLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) identity, err := identityService.Create(ctx, method, blockchain, network, "http://localhost:3001") - assert.NoError(t, err) + require.NoError(t, err) identity2, err := identityService.Create(ctx, method, blockchain, network, "http://localhost:3001") - assert.NoError(t, err) + require.NoError(t, err) schema := "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json" - did, err := core.ParseDID(identity.Identifier) + did, err := w3c.ParseDID(identity.Identifier) assert.NoError(t, err) - did2, err := core.ParseDID(identity2.Identifier) + did2, err := w3c.ParseDID(identity2.Identifier) assert.NoError(t, err) - did3, err := core.ParseDID("did:polygonid:polygon:mumbai:2qD6cqGpLX2dibdFuKfrPxGiybi3wKa8RbR4onw49H") + did3, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qD6cqGpLX2dibdFuKfrPxGiybi3wKa8RbR4onw49H") assert.NoError(t, err) credentialSubject := map[string]any{ "id": "did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ", @@ -69,7 +68,7 @@ func Test_identity_UpdateState(t *testing.T) { type testConfig struct { name string - did *core.DID + did *w3c.DID shouldReturnErr bool } @@ -127,15 +126,15 @@ func Test_identity_GetByDID(t *testing.T) { identity, err := identityService.Create(ctx, method, blockchain, network, "http://localhost:3001") assert.NoError(t, err) - did, err := core.ParseDID(identity.Identifier) + did, err := w3c.ParseDID(identity.Identifier) assert.NoError(t, err) - did2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qD6cqGpLX2dibdFuKfrPxGiybi3wKa8RbR4onw49H") + did2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qD6cqGpLX2dibdFuKfrPxGiybi3wKa8RbR4onw49H") assert.NoError(t, err) type testConfig struct { name string - did *core.DID + did *w3c.DID shouldReturnErr bool } diff --git a/internal/core/services/tests/link_test.go b/internal/core/services/tests/link_test.go index 0f1d83522..217cb98ef 100644 --- a/internal/core/services/tests/link_test.go +++ b/internal/core/services/tests/link_test.go @@ -7,14 +7,14 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/core/services" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/repositories" linkState "github.com/polygonid/sh-id-platform/pkg/link" "github.com/polygonid/sh-id-platform/pkg/pubsub" @@ -33,14 +33,13 @@ func Test_link_issueClaim(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) sessionRepository := repositories.NewSessionCached(cachex) - schemaService := services.NewSchema(schemaRepository, schemaLoader) + schemaService := services.NewSchema(schemaRepository, docLoader) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "https://host.com", } - claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + claimsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, docLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) identity, err := identityService.Create(ctx, method, blockchain, network, "http://localhost:3001") assert.NoError(t, err) @@ -49,20 +48,18 @@ func Test_link_issueClaim(t *testing.T) { assert.NoError(t, err) schemaUrl := "https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json" - did, err := core.ParseDID(identity.Identifier) - assert.NoError(t, err) + did, err := w3c.ParseDID(identity.Identifier) + require.NoError(t, err) iReq := ports.NewImportSchemaRequest(schemaUrl, "KYCAgeCredential", common.ToPointer("some title"), uuid.NewString(), common.ToPointer("some description")) schema, err := schemaService.ImportSchema(ctx, *did, iReq) assert.NoError(t, err) - did2, err := core.ParseDID(identity2.Identifier) - assert.NoError(t, err) - // - //did3, err := core.ParseDID("did:polygonid:polygon:mumbai:2qD6cqGpLX2dibdFuKfrPxGiybi3wKa8RbR4onw49H") - //assert.NoError(t, err) + did2, err := w3c.ParseDID(identity2.Identifier) + require.NoError(t, err) + + userDID1, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ") + require.NoError(t, err) - userDID1 := core.DID{} - assert.NoError(t, userDID1.SetString("did:polygonid:polygon:mumbai:2qE1BZ7gcmEoP2KppvFPCZqyzyb5tK9T6Gec5HFANQ")) credentialSubject := map[string]any{ "id": userDID1.String(), "birthday": 19960424, @@ -75,7 +72,7 @@ func Test_link_issueClaim(t *testing.T) { assert.NoError(t, err) linkRepository := repositories.NewLink(*storage) - linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, schemaLoader, sessionRepository, pubsub.NewMock(), ipfsGateway) + linkService := services.NewLinkService(storage, claimsService, nil, claimsRepo, linkRepository, schemaRepository, docLoader, sessionRepository, pubsub.NewMock(), ipfsGateway) tomorrow := time.Now().Add(24 * time.Hour) nextWeek := time.Now().Add(7 * 24 * time.Hour) @@ -94,8 +91,8 @@ func Test_link_issueClaim(t *testing.T) { type testConfig struct { name string - did core.DID - userDID core.DID + did w3c.DID + userDID w3c.DID LinkID uuid.UUID expected expected } @@ -104,7 +101,7 @@ func Test_link_issueClaim(t *testing.T) { { name: "should return status done", did: *did, - userDID: userDID1, + userDID: *userDID1, LinkID: link.ID, expected: expected{ err: nil, @@ -115,7 +112,7 @@ func Test_link_issueClaim(t *testing.T) { { name: "should return status pending to publish", did: *did, - userDID: userDID1, + userDID: *userDID1, LinkID: link2.ID, expected: expected{ err: nil, @@ -126,7 +123,7 @@ func Test_link_issueClaim(t *testing.T) { { name: "should return error", did: *did, - userDID: userDID1, + userDID: *userDID1, LinkID: link2.ID, expected: expected{ err: services.ErrClaimAlreadyIssued, @@ -137,7 +134,7 @@ func Test_link_issueClaim(t *testing.T) { { name: "should return error wrong did", did: *did2, - userDID: userDID1, + userDID: *userDID1, LinkID: link2.ID, expected: expected{ err: errors.New("link does not exist"), @@ -146,7 +143,7 @@ func Test_link_issueClaim(t *testing.T) { { name: "should return error wrong link id", did: *did, - userDID: userDID1, + userDID: *userDID1, LinkID: uuid.New(), expected: expected{ err: errors.New("link does not exist"), diff --git a/internal/core/services/tests/main_test.go b/internal/core/services/tests/main_test.go index 1b76c660c..1a2fb83ca 100644 --- a/internal/core/services/tests/main_test.go +++ b/internal/core/services/tests/main_test.go @@ -6,11 +6,14 @@ import ( "testing" "github.com/hashicorp/vault/api" + "github.com/iden3/go-schema-processor/v2/loaders" + shell "github.com/ipfs/go-ipfs-api" "github.com/polygonid/sh-id-platform/internal/config" "github.com/polygonid/sh-id-platform/internal/db" "github.com/polygonid/sh-id-platform/internal/db/tests" "github.com/polygonid/sh-id-platform/internal/kms" + "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/providers" "github.com/polygonid/sh-id-platform/pkg/cache" @@ -22,8 +25,11 @@ var ( bjjKeyProvider kms.KeyProvider keyStore *kms.KMS cachex cache.Cache + docLoader loader.DocumentLoader ) +const ipfsGatewayURL = "http://127.0.0.1:8080" + const ipfsGateway = "http://localhost:8080" func TestMain(m *testing.M) { @@ -70,6 +76,8 @@ func TestMain(m *testing.M) { } cachex = cache.NewMemoryCache() + docLoader = loaders.NewDocumentLoader(shell.NewShell(ipfsGatewayURL), "") + m.Run() } diff --git a/internal/core/services/tests/notification_test.go b/internal/core/services/tests/notification_test.go index 8efdc975e..38fb7790e 100644 --- a/internal/core/services/tests/notification_test.go +++ b/internal/core/services/tests/notification_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,7 +16,6 @@ import ( "github.com/polygonid/sh-id-platform/internal/core/services" "github.com/polygonid/sh-id-platform/internal/db/tests" "github.com/polygonid/sh-id-platform/internal/gateways" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/log" "github.com/polygonid/sh-id-platform/internal/repositories" "github.com/polygonid/sh-id-platform/pkg/http" @@ -40,20 +39,19 @@ func TestNotification_SendNotification(t *testing.T) { rhsp := reverse_hash.NewRhsPublisher(nil, false) connectionsRepository := repositories.NewConnections() identityService := services.NewIdentity(keyStore, identityRepo, mtRepo, identityStateRepo, mtService, nil, claimsRepo, revocationRepository, connectionsRepository, storage, rhsp, nil, nil, pubsub.NewMock()) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cachex) claimsConf := services.ClaimCfg{ RHSEnabled: false, Host: "http://host", } - credentialsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, schemaLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) + credentialsService := services.NewClaim(claimsRepo, identityService, nil, mtService, identityStateRepo, docLoader, storage, claimsConf, pubsub.NewMock(), ipfsGateway) connectionsService := services.NewConnection(connectionsRepository, storage) iden, err := identityService.Create(ctx, method, blockchain, network, "polygon-test") require.NoError(t, err) - did, err := core.ParseDID(iden.Identifier) + did, err := w3c.ParseDID(iden.Identifier) require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) notificationGateway := gateways.NewPushNotificationClient(http.DefaultHTTPClientWithRetry) diff --git a/internal/core/services/tests/schema_test.go b/internal/core/services/tests/schema_test.go index 28de2c809..db5016957 100644 --- a/internal/core/services/tests/schema_test.go +++ b/internal/core/services/tests/schema_test.go @@ -6,15 +6,14 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/utils" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/internal/core/services" - "github.com/polygonid/sh-id-platform/internal/loader" "github.com/polygonid/sh-id-platform/internal/repositories" ) @@ -30,14 +29,14 @@ func TestSchema_ImportSchema(t *testing.T) { ctx := context.Background() repo := repositories.NewSchemaInMemory() - issuerDID := core.DID{} - require.NoError(t, issuerDID.SetString(did)) + issuerDID, err := w3c.ParseDID(did) + require.NoError(t, err) expectHash := utils.CreateSchemaHash([]byte(urlLD + "#" + schemaType)) - s := services.NewSchema(repo, loader.HTTPFactory) + s := services.NewSchema(repo, docLoader) iReq := ports.NewImportSchemaRequest(url, schemaType, common.ToPointer(title), version, common.ToPointer(description)) - got, err := s.ImportSchema(ctx, issuerDID, iReq) + got, err := s.ImportSchema(ctx, *issuerDID, iReq) require.NoError(t, err) _, err = uuid.Parse(got.ID.String()) assert.NoError(t, err) diff --git a/internal/core/services/zk_native.go b/internal/core/services/zk_native.go index a89ce5ed5..1043114de 100644 --- a/internal/core/services/zk_native.go +++ b/internal/core/services/zk_native.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - "github.com/iden3/go-circuits" + "github.com/iden3/go-circuits/v2" "github.com/iden3/go-rapidsnark/prover" "github.com/iden3/go-rapidsnark/witness" diff --git a/internal/db/schema/migrations/202304121507181_add_linid_to_claims_table.sql b/internal/db/schema/migrations/202304121507181_add_linid_to_claims_table.sql index cd5e9efdb..7d759ab21 100644 --- a/internal/db/schema/migrations/202304121507181_add_linid_to_claims_table.sql +++ b/internal/db/schema/migrations/202304121507181_add_linid_to_claims_table.sql @@ -4,7 +4,8 @@ ALTER TABLE links DROP COLUMN issued_claims; ALTER TABLE claims ADD COLUMN link_id uuid; -CONSTRAINT claims_links_id_key foreign key (link_id) references links (id), +ALTER TABLE claims + ADD CONSTRAINT claims_links_id_key foreign key (link_id) references links (id); -- +goose StatementEnd diff --git a/internal/db/tests/claims_fixture.go b/internal/db/tests/claims_fixture.go index 49b5878c4..a69d1153a 100644 --- a/internal/db/tests/claims_fixture.go +++ b/internal/db/tests/claims_fixture.go @@ -7,8 +7,8 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -40,7 +40,7 @@ func (f *Fixture) CreateSchema(t *testing.T, ctx context.Context, s *domain.Sche func (f *Fixture) GetDefaultAuthClaimOfIssuer(t *testing.T, issuerID string) *domain.Claim { t.Helper() ctx := context.Background() - did, err := core.ParseDID(issuerID) + did, err := w3c.ParseDID(issuerID) assert.NoError(t, err) claims, err := f.claimRepository.GetAllByIssuerID(ctx, f.storage.Pgx, *did, &ports.ClaimsFilter{}) assert.NoError(t, err) diff --git a/internal/gateways/notification.go b/internal/gateways/notification.go index 841233f37..1337a66a9 100644 --- a/internal/gateways/notification.go +++ b/internal/gateways/notification.go @@ -4,7 +4,7 @@ import ( "context" "encoding/json" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/pkg/errors" "github.com/polygonid/sh-id-platform/internal/core/domain" diff --git a/internal/gateways/publisher.go b/internal/gateways/publisher.go index b82d844e7..4a623875a 100644 --- a/internal/gateways/publisher.go +++ b/internal/gateways/publisher.go @@ -9,8 +9,9 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/google/uuid" - "github.com/iden3/go-circuits" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-circuits/v2" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/poseidon" "github.com/iden3/go-merkletree-sql/v2" "github.com/jackc/pgx/v4" @@ -44,7 +45,7 @@ const ( // PublisherGateway - Define the interface for publishers. type PublisherGateway interface { - PublishState(ctx context.Context, identifier *core.DID, latestState *merkletree.Hash, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) (*string, error) + PublishState(ctx context.Context, identifier *w3c.DID, latestState *merkletree.Hash, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) (*string, error) } type publisher struct { @@ -81,7 +82,7 @@ func NewPublisher(storage *db.Storage, identityService ports.IdentityService, cl } } -func (p *publisher) PublishState(ctx context.Context, identifier *core.DID) (*domain.PublishedState, error) { +func (p *publisher) PublishState(ctx context.Context, identifier *w3c.DID) (*domain.PublishedState, error) { idStr := identifier.String() processingEntity := p.pendingTransactions.Load(idStr) if processingEntity != nil { @@ -97,7 +98,7 @@ func (p *publisher) PublishState(ctx context.Context, identifier *core.DID) (*do return newState, err } -func (p *publisher) RetryPublishState(ctx context.Context, identifier *core.DID) (*domain.PublishedState, error) { +func (p *publisher) RetryPublishState(ctx context.Context, identifier *w3c.DID) (*domain.PublishedState, error) { idStr := identifier.String() processingEntity := p.pendingTransactions.Load(idStr) if processingEntity != nil { @@ -113,7 +114,7 @@ func (p *publisher) RetryPublishState(ctx context.Context, identifier *core.DID) return newState, err } -func (p *publisher) publishState(ctx context.Context, identifier *core.DID) (*domain.PublishedState, error) { +func (p *publisher) publishState(ctx context.Context, identifier *w3c.DID) (*domain.PublishedState, error) { exists, err := p.identityService.HasUnprocessedStatesByID(ctx, *identifier) if err != nil { log.Error(ctx, "error fetching unprocessed issuers did", "err", err) @@ -153,7 +154,7 @@ func (p *publisher) publishState(ctx context.Context, identifier *core.DID) (*do }, nil } -func (p *publisher) retrypublishFailedState(ctx context.Context, identifier *core.DID) (*domain.PublishedState, error) { +func (p *publisher) retrypublishFailedState(ctx context.Context, identifier *w3c.DID) (*domain.PublishedState, error) { failedState, err := p.identityService.GetFailedState(ctx, *identifier) if err != nil { log.Error(ctx, "error fetching failed state", "err", err) @@ -181,8 +182,8 @@ func (p *publisher) retrypublishFailedState(ctx context.Context, identifier *cor } // PublishProof publishes new proof using the latest state -func (p *publisher) publishProof(ctx context.Context, identifier *core.DID, newState domain.IdentityState) (*string, error) { - did, err := core.ParseDID(newState.Identifier) +func (p *publisher) publishProof(ctx context.Context, identifier *w3c.DID, newState domain.IdentityState) (*string, error) { + did, err := w3c.ParseDID(newState.Identifier) if err != nil { return nil, err } @@ -245,9 +246,14 @@ func (p *publisher) publishProof(ctx context.Context, identifier *core.DID, newS return nil, err } + id, err := core.IDFromDID(*did) + if err != nil { + return nil, err + } + isLatestStateGenesis := latestState.PreviousState == nil stateTransitionInputs := circuits.StateTransitionInputs{ - ID: &did.ID, + ID: &id, NewTreeState: newTreeState, OldTreeState: oldTreeState, IsOldStateGenesis: isLatestStateGenesis, @@ -302,7 +308,7 @@ func (p *publisher) publishProof(ctx context.Context, identifier *core.DID, newS return txID, nil } -func (p *publisher) fillAuthClaimData(ctx context.Context, identifier *core.DID, authClaim *domain.Claim, newState domain.IdentityState) ( +func (p *publisher) fillAuthClaimData(ctx context.Context, identifier *w3c.DID, authClaim *domain.Claim, newState domain.IdentityState) ( authClaimData *circuits.ClaimWithMTPProof, authClaimNewStateIncProof *merkletree.Proof, err error, ) { err = p.storage.Pgx.BeginFunc( @@ -421,7 +427,7 @@ func (p *publisher) updateIdentityStateTxStatus(ctx context.Context, state *doma if receipt.Status == types.ReceiptStatusSuccessful { state.Status = domain.StatusConfirmed err = p.claimService.UpdateClaimsMTPAndState(ctx, state) - did, err := core.ParseDID(state.Identifier) + did, err := w3c.ParseDID(state.Identifier) if err != nil { log.Error(ctx, "error getting did from state: ", "err", err, "state", state.StateID) return err diff --git a/internal/gateways/publisher_gateway.go b/internal/gateways/publisher_gateway.go index f90edb5f2..88e53e200 100644 --- a/internal/gateways/publisher_gateway.go +++ b/internal/gateways/publisher_gateway.go @@ -12,7 +12,8 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/iden3/contracts-abi/state/go/abi" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" "github.com/polygonid/sh-id-platform/internal/common" @@ -49,7 +50,7 @@ func NewPublisherEthGateway(_client *eth.Client, contract ethCommon.Address, key } // PublishState creates or updates state in the blockchain -func (pb *PublisherEthGateway) PublishState(ctx context.Context, identifier *core.DID, latestState, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) (*string, error) { +func (pb *PublisherEthGateway) PublishState(ctx context.Context, identifier *w3c.DID, latestState, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) (*string, error) { pb.rw.Lock() defer pb.rw.Unlock() @@ -131,7 +132,7 @@ func (pb *PublisherEthGateway) getAddressForTxInitiator() (ethCommon.Address, er return fromAddress, nil } -func (pb *PublisherEthGateway) getStatePayload(identifier *core.DID, latestState, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) ([]byte, error) { +func (pb *PublisherEthGateway) getStatePayload(identifier *w3c.DID, latestState, newState *merkletree.Hash, isOldStateGenesis bool, proof *domain.ZKProof) ([]byte, error) { a, b, c, err := proof.ProofToBigInts() if err != nil { return nil, err @@ -148,7 +149,12 @@ func (pb *PublisherEthGateway) getStatePayload(identifier *core.DID, latestState return nil, err } - payload, err := ab.Pack("transitState", identifier.ID.BigInt(), latestState.BigInt(), newState.BigInt(), isOldStateGenesis, + id, err := core.IDFromDID(*identifier) + if err != nil { + return nil, err + } + + payload, err := ab.Pack("transitState", id.BigInt(), latestState.BigInt(), newState.BigInt(), isOldStateGenesis, proofA, proofB, proofC) if err != nil { return nil, err diff --git a/internal/jsonschema/schema.go b/internal/jsonschema/schema.go index ae0e7fd28..a42f1c5da 100644 --- a/internal/jsonschema/schema.go +++ b/internal/jsonschema/schema.go @@ -6,17 +6,15 @@ import ( "errors" "fmt" - core "github.com/iden3/go-iden3-core" - jsonSuite "github.com/iden3/go-schema-processor/json" - "github.com/iden3/go-schema-processor/merklize" - "github.com/iden3/go-schema-processor/processor" - "github.com/iden3/go-schema-processor/utils" - shell "github.com/ipfs/go-ipfs-api" + core "github.com/iden3/go-iden3-core/v2" + jsonSuite "github.com/iden3/go-schema-processor/v2/json" + "github.com/iden3/go-schema-processor/v2/merklize" + "github.com/iden3/go-schema-processor/v2/processor" "github.com/mitchellh/mapstructure" "github.com/piprate/json-gold/ld" + "github.com/polygonid/sh-id-platform/internal/common" "github.com/polygonid/sh-id-platform/internal/loader" - "github.com/polygonid/sh-id-platform/pkg/cache" ) const ( @@ -57,14 +55,14 @@ type JSONSchema struct { content map[string]any } -// Load loads the json file doing some validations.. -func Load(ctx context.Context, loader loader.Loader) (*JSONSchema, error) { +// Load loads the json file +func Load(ctx context.Context, jsonSchemaURL string, loader loader.DocumentLoader) (*JSONSchema, error) { pr := processor.InitProcessorOptions( &processor.Processor{}, processor.WithValidator(jsonSuite.Validator{}), processor.WithParser(jsonSuite.Parser{}), - processor.WithSchemaLoader(loader)) - raw, _, err := pr.Load(ctx) + processor.WithDocumentLoader(loader)) + raw, err := pr.Load(ctx, jsonSchemaURL) if err != nil { return nil, err } @@ -112,6 +110,17 @@ func (s *JSONSchema) AttributeByID(id string) (*Attribute, error) { return &attrs[i], nil } +// Bytes returns the json representation of the schema +func (s *JSONSchema) Bytes() ([]byte, error) { + return json.Marshal(s.content) +} + +// BytesNoErr returns the json representation of the schema ignoring errors, which should never happen +func (s *JSONSchema) BytesNoErr() []byte { + b, _ := s.Bytes() + return b +} + // JSONLdContext returns the value of $metadata.uris.jsonLdContext func (s *JSONSchema) JSONLdContext() (string, error) { var metadata map[string]any @@ -138,14 +147,12 @@ func (s *JSONSchema) SchemaHash(schemaType string) (core.SchemaHash, error) { return core.SchemaHash{}, err } id := jsonLdContext + "#" + schemaType - return utils.CreateSchemaHash([]byte(id)), nil + return common.CreateSchemaHash([]byte(id)), nil } // ValidateCredentialSubject validates that the given credential subject matches the given schema -func ValidateCredentialSubject(ctx context.Context, ipfsGateway string, schemaURL string, schemaType string, cSubject map[string]interface{}) error { - documentLoader := merklize.NewDocumentLoader(shell.NewShell(ipfsGateway), ipfsGateway) - schemaLoader := loader.CachedFactory(loader.MultiProtocolFactory(ipfsGateway), cache.NewMemoryCache()) // nolint: contextcheck - schema, err := Load(ctx, schemaLoader(schemaURL)) +func ValidateCredentialSubject(ctx context.Context, loader loader.DocumentLoader, schemaURL string, schemaType string, cSubject map[string]interface{}) error { + schema, err := Load(ctx, schemaURL, loader) if err != nil { return err } @@ -165,7 +172,7 @@ func ValidateCredentialSubject(ctx context.Context, ipfsGateway string, schemaUR return err } - return validateDummyVCEntries(dummyVC, documentLoader) + return validateDummyVCEntries(dummyVC, loader) } func validateDummyVCAgainstSchema(dummyVC map[string]interface{}, schema *JSONSchema) error { @@ -217,7 +224,7 @@ func createDummyVC(cSubject map[string]interface{}, schemaType string, schemaCon return resp, err } -func validateDummyVCEntries(vc map[string]interface{}, loader ld.DocumentLoader) error { +func validateDummyVCEntries(vc map[string]interface{}, loader loader.DocumentLoader) error { proc := ld.NewJsonLdProcessor() options := ld.NewJsonLdOptions("") options.Algorithm = ld.AlgorithmURDNA2015 diff --git a/internal/jsonschema/schema_test.go b/internal/jsonschema/schema_test.go index d9f85e8fe..70ca871ff 100644 --- a/internal/jsonschema/schema_test.go +++ b/internal/jsonschema/schema_test.go @@ -4,12 +4,15 @@ import ( "context" "testing" + "github.com/iden3/go-schema-processor/v2/loaders" + shell "github.com/ipfs/go-ipfs-api" "github.com/stretchr/testify/assert" ) func TestValidateCredentialSubject(t *testing.T) { const ipfsGatewayURL = "http://127.0.0.1:8080" ctx := context.Background() + ld := loaders.NewDocumentLoader(shell.NewShell(ipfsGatewayURL), "") type config struct { name string @@ -188,7 +191,7 @@ func TestValidateCredentialSubject(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - err := ValidateCredentialSubject(ctx, ipfsGatewayURL, tc.schemaURL, tc.schemaType, tc.credentialSubject) + err := ValidateCredentialSubject(ctx, ld, tc.schemaURL, tc.schemaType, tc.credentialSubject) if tc.expectedError { assert.Error(t, err) } else { diff --git a/internal/kms/kms.go b/internal/kms/kms.go index 22296312a..84c94c807 100644 --- a/internal/kms/kms.go +++ b/internal/kms/kms.go @@ -7,7 +7,7 @@ import ( "sync" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/pkg/errors" ) @@ -15,28 +15,28 @@ import ( // revive:disable-next-line type KMSType interface { RegisterKeyProvider(kt KeyType, kp KeyProvider) error - CreateKey(kt KeyType, identity *core.DID) (KeyID, error) + CreateKey(kt KeyType, identity *w3c.DID) (KeyID, error) PublicKey(keyID KeyID) ([]byte, error) Sign(ctx context.Context, keyID KeyID, data []byte) ([]byte, error) - KeysByIdentity(ctx context.Context, identity core.DID) ([]KeyID, error) - LinkToIdentity(ctx context.Context, keyID KeyID, identity core.DID) (KeyID, error) + KeysByIdentity(ctx context.Context, identity w3c.DID) ([]KeyID, error) + LinkToIdentity(ctx context.Context, keyID KeyID, identity w3c.DID) (KeyID, error) } // KeyProvider describes the interface that key providers should match. type KeyProvider interface { // New generates random key. // If identity is nil, create new key without binding to identity. - New(identity *core.DID) (KeyID, error) + New(identity *w3c.DID) (KeyID, error) // PublicKey returns byte representation of public key PublicKey(keyID KeyID) ([]byte, error) // Sign the data and return signature. Sign(ctx context.Context, keyID KeyID, data []byte) ([]byte, error) // ListByIdentity returns all keys associated with identity - ListByIdentity(ctx context.Context, identity core.DID) ([]KeyID, error) + ListByIdentity(ctx context.Context, identity w3c.DID) ([]KeyID, error) // LinkToIdentity links unbound key to identity. // KeyID can be changed after linking. // Returning new KeyID. - LinkToIdentity(ctx context.Context, keyID KeyID, identity core.DID) (KeyID, error) + LinkToIdentity(ctx context.Context, keyID KeyID, identity w3c.DID) (KeyID, error) } // KMS stores keys and secrets @@ -89,7 +89,7 @@ func (k *KMS) RegisterKeyProvider(kt KeyType, kp KeyProvider) error { // CreateKey creates new random key of specified type. // If identity is not nil, store key for that identity. If nil, do not bind // key to identity. -func (k *KMS) CreateKey(kt KeyType, identity *core.DID) (KeyID, error) { +func (k *KMS) CreateKey(kt KeyType, identity *w3c.DID) (KeyID, error) { var id KeyID kp, ok := k.registry[kt] if !ok { @@ -118,7 +118,7 @@ func (k *KMS) Sign(ctx context.Context, keyID KeyID, data []byte) ([]byte, error } // KeysByIdentity lists keys by identity -func (k *KMS) KeysByIdentity(ctx context.Context, identity core.DID) ([]KeyID, error) { +func (k *KMS) KeysByIdentity(ctx context.Context, identity w3c.DID) ([]KeyID, error) { ctx, cancel := context.WithCancel(ctx) defer cancel() @@ -165,7 +165,7 @@ func (k *KMS) KeysByIdentity(ctx context.Context, identity core.DID) ([]KeyID, e // Returning new KeyID. // Old key may be removed after vault. Not all key providers can support this // operation. -func (k *KMS) LinkToIdentity(ctx context.Context, keyID KeyID, identity core.DID) (KeyID, error) { +func (k *KMS) LinkToIdentity(ctx context.Context, keyID KeyID, identity w3c.DID) (KeyID, error) { kp, ok := k.registry[keyID.Type] if !ok { return keyID, errors.WithStack(ErrUnknownKeyType) diff --git a/internal/kms/vaultPluginIden3KeyProvider.go b/internal/kms/vaultPluginIden3KeyProvider.go index 2241730bf..1278ee431 100644 --- a/internal/kms/vaultPluginIden3KeyProvider.go +++ b/internal/kms/vaultPluginIden3KeyProvider.go @@ -14,7 +14,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/utils" ) @@ -48,7 +48,7 @@ func (v *vaultPluginIden3KeyProvider) keyPathFromID(keyID KeyID) keyPathT { } } -func (v *vaultPluginIden3KeyProvider) LinkToIdentity(_ context.Context, keyID KeyID, identity core.DID) (KeyID, error) { +func (v *vaultPluginIden3KeyProvider) LinkToIdentity(_ context.Context, keyID KeyID, identity w3c.DID) (KeyID, error) { if keyID.Type != v.keyType { return keyID, ErrIncorrectKeyType } @@ -98,7 +98,7 @@ func (v *vaultPluginIden3KeyProvider) Sign(_ context.Context, keyID KeyID, dataT return signData(v.vaultCli, v.keyPathFromID(keyID), dataToSign) } -func (v *vaultPluginIden3KeyProvider) ListByIdentity(_ context.Context, identity core.DID) ([]KeyID, error) { +func (v *vaultPluginIden3KeyProvider) ListByIdentity(_ context.Context, identity w3c.DID) ([]KeyID, error) { identityKeysPath := keyPathT{ keyID: v.identityPath(identity), mountPath: v.keysMountPath, @@ -138,7 +138,7 @@ func (v *vaultPluginIden3KeyProvider) PublicKey(keyID KeyID) ([]byte, error) { return val, err } -func (v *vaultPluginIden3KeyProvider) New(identity *core.DID) (KeyID, error) { +func (v *vaultPluginIden3KeyProvider) New(identity *w3c.DID) (KeyID, error) { randomKeyPath, err := v.randomKeyPath() if err != nil { return KeyID{}, err @@ -178,7 +178,7 @@ func (v *vaultPluginIden3KeyProvider) randomKeyPath() (keyPathT, error) { }, nil } -func (v *vaultPluginIden3KeyProvider) keyPathFromPublic(identity *core.DID, publicKey string) keyPathT { +func (v *vaultPluginIden3KeyProvider) keyPathFromPublic(identity *w3c.DID, publicKey string) keyPathT { basePath := v.keysPathPrefix if identity != nil { basePath = v.identityPath(*identity) @@ -189,7 +189,7 @@ func (v *vaultPluginIden3KeyProvider) keyPathFromPublic(identity *core.DID, publ } } -func (v *vaultPluginIden3KeyProvider) identityPath(identity core.DID) string { +func (v *vaultPluginIden3KeyProvider) identityPath(identity w3c.DID) string { return path.Join(v.keysPathPrefix, identity.String()) } diff --git a/internal/kms/vaultPluginIden3KeyProvider_test.go b/internal/kms/vaultPluginIden3KeyProvider_test.go index 95fa4bc00..9c74ced46 100644 --- a/internal/kms/vaultPluginIden3KeyProvider_test.go +++ b/internal/kms/vaultPluginIden3KeyProvider_test.go @@ -11,7 +11,8 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/require" "github.com/polygonid/sh-id-platform/internal/providers" @@ -109,7 +110,7 @@ func randString(t *testing.T, ln int) string { return hex.EncodeToString(bs) } -func randomDID(t *testing.T) core.DID { +func randomDID(t *testing.T) w3c.DID { t.Helper() typ, err := core.BuildDIDType(core.DIDMethodIden3, core.Polygon, core.Mumbai) var genesis [27]byte diff --git a/internal/kms/vault_bjj_key_provider.go b/internal/kms/vault_bjj_key_provider.go index 598775d49..9c413e63a 100644 --- a/internal/kms/vault_bjj_key_provider.go +++ b/internal/kms/vault_bjj_key_provider.go @@ -9,7 +9,7 @@ import ( "regexp" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/babyjub" "github.com/iden3/go-iden3-crypto/utils" ) @@ -37,7 +37,7 @@ func NewVaultBJJKeyProvider(vaultCli *api.Client, keyType KeyType) KeyProvider { return &vaultBJJKeyProvider{keyType, vaultCli, reIdenKeyPathHex, reAnonKeyPathHex} } -func (v *vaultBJJKeyProvider) New(identity *core.DID) (KeyID, error) { +func (v *vaultBJJKeyProvider) New(identity *w3c.DID) (KeyID, error) { bjjPrivKey := babyjub.NewRandPrivKey() keyID := KeyID{ Type: v.keyType, @@ -50,7 +50,7 @@ func (v *vaultBJJKeyProvider) New(identity *core.DID) (KeyID, error) { return keyID, saveKeyMaterial(v.vaultCli, keyID.ID, keyMaterial) } -func (v *vaultBJJKeyProvider) LinkToIdentity(_ context.Context, keyID KeyID, identity core.DID) (KeyID, error) { +func (v *vaultBJJKeyProvider) LinkToIdentity(_ context.Context, keyID KeyID, identity w3c.DID) (KeyID, error) { if keyID.Type != v.keyType { return keyID, ErrIncorrectKeyType } @@ -94,7 +94,7 @@ func (v *vaultBJJKeyProvider) Sign(_ context.Context, keyID KeyID, data []byte) return sig[:], nil } -func (v *vaultBJJKeyProvider) ListByIdentity(_ context.Context, identity core.DID) ([]KeyID, error) { +func (v *vaultBJJKeyProvider) ListByIdentity(_ context.Context, identity w3c.DID) ([]KeyID, error) { path := identityPath(&identity) entries, err := listDirectoryEntries(v.vaultCli, path) if err != nil { diff --git a/internal/kms/vault_bjj_key_provider_test.go b/internal/kms/vault_bjj_key_provider_test.go index 92d3df2b0..bff06c42e 100644 --- a/internal/kms/vault_bjj_key_provider_test.go +++ b/internal/kms/vault_bjj_key_provider_test.go @@ -7,7 +7,8 @@ import ( "strings" "testing" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/babyjub" "github.com/iden3/go-iden3-crypto/constants" "github.com/iden3/go-iden3-crypto/utils" @@ -135,14 +136,14 @@ func testBJJKeyContent(t testing.TB, k TestKMS, keyID KeyID) babyjub.PrivateKey return privKey } -func testBoundedBJJKey(t *testing.T, k TestKMS, keyID KeyID, identity core.DID) { +func testBoundedBJJKey(t *testing.T, k TestKMS, keyID KeyID, identity w3c.DID) { t.Helper() privKey := testBJJKeyContent(t, k, keyID) - // Try to bind already bounded key to other identity: expect error - otherIdentity, err := core.IDFromString("x2Uw18ATvY7mEsgfrrDipBmQQdPWAao4NmF56wGvp") + otherID, err := core.IDFromString("x2Uw18ATvY7mEsgfrrDipBmQQdPWAao4NmF56wGvp") require.NoError(t, err) - otherDID, err := core.ParseDIDFromID(otherIdentity) + + otherDID, err := core.ParseDIDFromID(otherID) require.NoError(t, err) _, err = k.KMS.LinkToIdentity(context.Background(), keyID, *otherDID) diff --git a/internal/kms/vault_providers_helpers.go b/internal/kms/vault_providers_helpers.go index 6338a489e..412134195 100644 --- a/internal/kms/vault_providers_helpers.go +++ b/internal/kms/vault_providers_helpers.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/hashicorp/vault/api" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/pkg/errors" ) @@ -54,11 +54,11 @@ func listDirectoryEntries(vaultCli *api.Client, path string) ([]string, error) { return result, nil } -func identityPath(identity *core.DID) string { +func identityPath(identity *w3c.DID) string { return fmt.Sprintf("%v%v", keysPathPrefix, identity.String()) } -func keyPath(identity *core.DID, keyType KeyType, keyID string) string { +func keyPath(identity *w3c.DID, keyType KeyType, keyID string) string { basePath := "" if identity != nil { basePath = identityPath(identity) + "/" diff --git a/internal/loader/loader.go b/internal/loader/loader.go index ba3174930..99597c2b3 100644 --- a/internal/loader/loader.go +++ b/internal/loader/loader.go @@ -2,8 +2,12 @@ package loader import ( "github.com/iden3/go-schema-processor/processor" + "github.com/piprate/json-gold/ld" ) +// DocumentLoader is an alias for json-gold DocumentLoader +type DocumentLoader ld.DocumentLoader + // Loader defines a Loader interface type Loader interface { processor.SchemaLoader diff --git a/internal/repositories/claims.go b/internal/repositories/claims.go index 5547ec9e3..8f7b96301 100644 --- a/internal/repositories/claims.go +++ b/internal/repositories/claims.go @@ -8,9 +8,9 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-merkletree-sql/v2" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" "github.com/labstack/gommon/log" @@ -232,7 +232,7 @@ func (c *claims) Delete(ctx context.Context, conn db.Querier, id uuid.UUID) erro return nil } -func (c *claims) GetByRevocationNonce(ctx context.Context, conn db.Querier, identifier *core.DID, revocationNonce domain.RevNonceUint64) (*domain.Claim, error) { +func (c *claims) GetByRevocationNonce(ctx context.Context, conn db.Querier, identifier *w3c.DID, revocationNonce domain.RevNonceUint64) (*domain.Claim, error) { claim := domain.Claim{} row := conn.QueryRow( ctx, @@ -288,7 +288,7 @@ func (c *claims) GetByRevocationNonce(ctx context.Context, conn db.Querier, iden return &claim, nil } -func (c *claims) FindOneClaimBySchemaHash(ctx context.Context, conn db.Querier, subject *core.DID, schemaHash string) (*domain.Claim, error) { +func (c *claims) FindOneClaimBySchemaHash(ctx context.Context, conn db.Querier, subject *w3c.DID, schemaHash string) (*domain.Claim, error) { var claim domain.Claim row := conn.QueryRow(ctx, @@ -355,7 +355,7 @@ func (c *claims) RevokeNonce(ctx context.Context, conn db.Querier, revocation *d } // GetByIdAndIssuer get claim by id -func (c *claims) GetByIdAndIssuer(ctx context.Context, conn db.Querier, identifier *core.DID, claimID uuid.UUID) (*domain.Claim, error) { +func (c *claims) GetByIdAndIssuer(ctx context.Context, conn db.Querier, identifier *w3c.DID, claimID uuid.UUID) (*domain.Claim, error) { claim := domain.Claim{} err := conn.QueryRow(ctx, `SELECT id, @@ -409,7 +409,7 @@ func (c *claims) GetByIdAndIssuer(ctx context.Context, conn db.Querier, identifi } // GetAllByIssuerID returns all the claims of the given issuer -func (c *claims) GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerID core.DID, filter *ports.ClaimsFilter) ([]*domain.Claim, error) { +func (c *claims) GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerID w3c.DID, filter *ports.ClaimsFilter) ([]*domain.Claim, error) { query, args := buildGetAllQueryAndFilters(issuerID, filter) rows, err := conn.Query(ctx, query, args...) @@ -425,7 +425,7 @@ func (c *claims) GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerID return processClaims(rows) } -func (c *claims) GetNonRevokedByConnectionAndIssuerID(ctx context.Context, conn db.Querier, connID uuid.UUID, issuerID core.DID) ([]*domain.Claim, error) { +func (c *claims) GetNonRevokedByConnectionAndIssuerID(ctx context.Context, conn db.Querier, connID uuid.UUID, issuerID w3c.DID) ([]*domain.Claim, error) { query := `SELECT claims.id, issuer, schema_hash, @@ -463,7 +463,7 @@ func (c *claims) GetNonRevokedByConnectionAndIssuerID(ctx context.Context, conn return processClaims(rows) } -func (c *claims) GetAllByState(ctx context.Context, conn db.Querier, did *core.DID, state *merkletree.Hash) (claims []domain.Claim, err error) { +func (c *claims) GetAllByState(ctx context.Context, conn db.Querier, did *w3c.DID, state *merkletree.Hash) (claims []domain.Claim, err error) { claims = make([]domain.Claim, 0) var rows pgx.Rows if state == nil { @@ -552,7 +552,7 @@ func (c *claims) GetAllByState(ctx context.Context, conn db.Querier, did *core.D return claims, err } -func (c *claims) GetAllByStateWithMTProof(ctx context.Context, conn db.Querier, did *core.DID, state *merkletree.Hash) (claims []domain.Claim, err error) { +func (c *claims) GetAllByStateWithMTProof(ctx context.Context, conn db.Querier, did *w3c.DID, state *merkletree.Hash) (claims []domain.Claim, err error) { claims = make([]domain.Claim, 0) var rows pgx.Rows if state == nil { @@ -684,7 +684,7 @@ func processClaims(rows pgx.Rows) ([]*domain.Claim, error) { return claims, rows.Err() } -func buildGetAllQueryAndFilters(issuerID core.DID, filter *ports.ClaimsFilter) (string, []interface{}) { +func buildGetAllQueryAndFilters(issuerID w3c.DID, filter *ports.ClaimsFilter) (string, []interface{}) { query := `SELECT claims.id, issuer, schema_hash, @@ -788,7 +788,7 @@ func (c *claims) UpdateClaimMTP(ctx context.Context, conn db.Querier, claim *dom } // GetAuthClaimsForPublishing of all claims for identity -func (c *claims) GetAuthClaimsForPublishing(ctx context.Context, conn db.Querier, identifier *core.DID, publishingState string, schemaHash string) ([]*domain.Claim, error) { +func (c *claims) GetAuthClaimsForPublishing(ctx context.Context, conn db.Querier, identifier *w3c.DID, publishingState string, schemaHash string) ([]*domain.Claim, error) { var err error query := `SELECT claims.id, issuer, @@ -832,7 +832,7 @@ func (c *claims) GetAuthClaimsForPublishing(ctx context.Context, conn db.Querier return claims, nil } -func (c *claims) GetClaimsIssuedForUser(ctx context.Context, conn db.Querier, identifier core.DID, userDID core.DID, linkID uuid.UUID) ([]*domain.Claim, error) { +func (c *claims) GetClaimsIssuedForUser(ctx context.Context, conn db.Querier, identifier w3c.DID, userDID w3c.DID, linkID uuid.UUID) ([]*domain.Claim, error) { query := `SELECT claims.id, issuer, schema_hash, @@ -893,7 +893,7 @@ func (c *claims) GetClaimsIssuedForUser(ctx context.Context, conn db.Querier, id return claims, nil } -func (c *claims) GetByStateIDWithMTPProof(ctx context.Context, conn db.Querier, did *core.DID, state string) ([]*domain.Claim, error) { +func (c *claims) GetByStateIDWithMTPProof(ctx context.Context, conn db.Querier, did *w3c.DID, state string) ([]*domain.Claim, error) { query := `SELECT claims.id, issuer, schema_hash, diff --git a/internal/repositories/connections.go b/internal/repositories/connections.go index d8330b584..32b431aec 100644 --- a/internal/repositories/connections.go +++ b/internal/repositories/connections.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" @@ -53,7 +53,7 @@ func (c *connections) Save(ctx context.Context, conn db.Querier, connection *dom return id, err } -func (c *connections) Delete(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID core.DID) error { +func (c *connections) Delete(ctx context.Context, conn db.Querier, id uuid.UUID, issuerDID w3c.DID) error { sql := `DELETE FROM connections WHERE id = $1 AND issuer_id = $2` cmd, err := conn.Exec(ctx, sql, id.String(), issuerDID.String()) if err != nil { @@ -67,14 +67,14 @@ func (c *connections) Delete(ctx context.Context, conn db.Querier, id uuid.UUID, return nil } -func (c *connections) DeleteCredentials(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID core.DID) error { +func (c *connections) DeleteCredentials(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID w3c.DID) error { sql := `DELETE FROM claims USING connections WHERE claims.issuer = connections.issuer_id AND claims.other_identifier = connections.user_id AND connections.id = $1 AND connections.issuer_id = $2` _, err := conn.Exec(ctx, sql, id.String(), issuerID.String()) return err } -func (c *connections) GetByIDAndIssuerID(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID core.DID) (*domain.Connection, error) { +func (c *connections) GetByIDAndIssuerID(ctx context.Context, conn db.Querier, id uuid.UUID, issuerID w3c.DID) (*domain.Connection, error) { connection := dbConnection{} err := conn.QueryRow(ctx, `SELECT id, issuer_id,user_id,issuer_doc,user_doc,created_at,modified_at @@ -98,7 +98,7 @@ func (c *connections) GetByIDAndIssuerID(ctx context.Context, conn db.Querier, i return toConnectionDomain(&connection) } -func (c *connections) GetByUserID(ctx context.Context, conn db.Querier, issuerDID core.DID, userDID core.DID) (*domain.Connection, error) { +func (c *connections) GetByUserID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, userDID w3c.DID) (*domain.Connection, error) { connection := dbConnection{} err := conn.QueryRow(ctx, `SELECT id, issuer_id,user_id,issuer_doc,user_doc,created_at,modified_at @@ -122,7 +122,7 @@ func (c *connections) GetByUserID(ctx context.Context, conn db.Querier, issuerDI return toConnectionDomain(&connection) } -func (c *connections) GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerDID core.DID, query string) ([]*domain.Connection, error) { +func (c *connections) GetAllByIssuerID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, query string) ([]*domain.Connection, error) { all := `SELECT id, issuer_id,user_id,issuer_doc,user_doc,created_at,modified_at FROM connections WHERE connections.issuer_id = $1` @@ -156,7 +156,7 @@ WHERE connections.issuer_id = $1` return domainConns, nil } -func (c *connections) GetAllWithCredentialsByIssuerID(ctx context.Context, conn db.Querier, issuerDID core.DID, query string) ([]*domain.Connection, error) { +func (c *connections) GetAllWithCredentialsByIssuerID(ctx context.Context, conn db.Querier, issuerDID w3c.DID, query string) ([]*domain.Connection, error) { sqlQuery, filters := buildGetAllWithCredentialsQueryAndFilters(issuerDID, query) rows, err := conn.Query(ctx, sqlQuery, filters...) if err != nil { @@ -167,7 +167,7 @@ func (c *connections) GetAllWithCredentialsByIssuerID(ctx context.Context, conn return toConnectionsWithCredentials(rows) } -func buildGetAllWithCredentialsQueryAndFilters(issuerDID core.DID, query string) (string, []interface{}) { +func buildGetAllWithCredentialsQueryAndFilters(issuerDID w3c.DID, query string) (string, []interface{}) { sqlQuery := `SELECT connections.id, connections.issuer_id, connections.user_id, @@ -300,12 +300,12 @@ func toConnectionWithCredentialsDomain(dbConn dbConnectionWithCredentials) (*dom } func toConnectionDomain(c *dbConnection) (*domain.Connection, error) { - issID, err := core.ParseDID(c.IssuerDID) + issID, err := w3c.ParseDID(c.IssuerDID) if err != nil { return nil, fmt.Errorf("parsing issuer DID from connection: %w", err) } - usrDID, err := core.ParseDID(c.UserDID) + usrDID, err := w3c.ParseDID(c.UserDID) if err != nil { return nil, fmt.Errorf("parsing user DID from connection: %w", err) } diff --git a/internal/repositories/identity.go b/internal/repositories/identity.go index 4bfa5edd2..be8510828 100644 --- a/internal/repositories/identity.go +++ b/internal/repositories/identity.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" @@ -23,7 +23,7 @@ func (i *identity) Save(ctx context.Context, conn db.Querier, identity *domain.I return err } -func (i *identity) GetByID(ctx context.Context, conn db.Querier, identifier core.DID) (*domain.Identity, error) { +func (i *identity) GetByID(ctx context.Context, conn db.Querier, identifier w3c.DID) (*domain.Identity, error) { identity := domain.Identity{ State: domain.IdentityState{}, } @@ -86,7 +86,7 @@ func (i *identity) Get(ctx context.Context, conn db.Querier) (identities []strin return identities, err } -func (i *identity) GetUnprocessedIssuersIDs(ctx context.Context, conn db.Querier) (issuersIDs []*core.DID, err error) { +func (i *identity) GetUnprocessedIssuersIDs(ctx context.Context, conn db.Querier) (issuersIDs []*w3c.DID, err error) { rows, err := conn.Query(ctx, `WITH issuers_to_process AS ( @@ -108,7 +108,7 @@ SELECT issuer FROM issuers_to_process WHERE issuer NOT IN (SELECT identifier FRO defer rows.Close() - issuersIDs = make([]*core.DID, 0) + issuersIDs = make([]*w3c.DID, 0) for rows.Next() { var issuerIDStr string @@ -116,10 +116,10 @@ SELECT issuer FROM issuers_to_process WHERE issuer NOT IN (SELECT identifier FRO if err != nil { return nil, err } - var did *core.DID - did, err = core.ParseDID(issuerIDStr) + var did *w3c.DID + did, err = w3c.ParseDID(issuerIDStr) if err != nil { - return []*core.DID{}, err + return []*w3c.DID{}, err } issuersIDs = append(issuersIDs, did) @@ -132,7 +132,7 @@ SELECT issuer FROM issuers_to_process WHERE issuer NOT IN (SELECT identifier FRO return issuersIDs, nil } -func (i *identity) HasUnprocessedStatesByID(ctx context.Context, conn db.Querier, identifier *core.DID) (bool, error) { +func (i *identity) HasUnprocessedStatesByID(ctx context.Context, conn db.Querier, identifier *w3c.DID) (bool, error) { row := conn.QueryRow(ctx, `WITH issuers_to_process AS ( @@ -156,7 +156,7 @@ func (i *identity) HasUnprocessedStatesByID(ctx context.Context, conn db.Querier return res > 0, nil } -func (i *identity) HasUnprocessedAndFailedStatesByID(ctx context.Context, conn db.Querier, identifier *core.DID) (bool, error) { +func (i *identity) HasUnprocessedAndFailedStatesByID(ctx context.Context, conn db.Querier, identifier *w3c.DID) (bool, error) { row := conn.QueryRow(ctx, `WITH issuers_to_process AS ( diff --git a/internal/repositories/identity_state.go b/internal/repositories/identity_state.go index be18a8917..eaaaed41f 100644 --- a/internal/repositories/identity_state.go +++ b/internal/repositories/identity_state.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgx/v4" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -53,7 +53,7 @@ func (isr *identityState) Save(ctx context.Context, conn db.Querier, state domai // GetLatestStateByIdentifier returns the latest confirmed state or genesis state. // Firstly try to return a 'confirmed' and non-genesis state. // If 'confirmed' and non-genesis state are not found. Return genesis state. -func (isr *identityState) GetLatestStateByIdentifier(ctx context.Context, conn db.Querier, identifier *core.DID) (*domain.IdentityState, error) { +func (isr *identityState) GetLatestStateByIdentifier(ctx context.Context, conn db.Querier, identifier *w3c.DID) (*domain.IdentityState, error) { row := conn.QueryRow(ctx, `SELECT state_id, identifier, state, root_of_roots, claims_tree_root, revocation_tree_root, block_timestamp, block_number, tx_id, previous_state, status, modified_at, created_at FROM identity_states @@ -92,7 +92,7 @@ func (isr *identityState) GetStatesByStatus(ctx context.Context, conn db.Querier } // GetPublishedStates returns all the states -func (isr *identityState) GetStates(ctx context.Context, conn db.Querier, issuerDID core.DID) ([]domain.IdentityState, error) { +func (isr *identityState) GetStates(ctx context.Context, conn db.Querier, issuerDID w3c.DID) ([]domain.IdentityState, error) { rows, err := conn.Query(ctx, `SELECT state_id, identifier, state, root_of_roots, claims_tree_root, revocation_tree_root, block_timestamp, block_number, tx_id, previous_state, status, modified_at, created_at FROM identity_states WHERE identifier = $1 and previous_state IS NOT NULL ORDER BY state_id ASC`, issuerDID.String()) @@ -145,7 +145,7 @@ func toIdentityStatesDomain(rows pgx.Rows) ([]domain.IdentityState, error) { } // GetStatesByStatus returns states which are not transated -func (isr *identityState) GetStatesByStatusAndIssuerID(ctx context.Context, conn db.Querier, status domain.IdentityStatus, issuerID core.DID) ([]domain.IdentityState, error) { +func (isr *identityState) GetStatesByStatusAndIssuerID(ctx context.Context, conn db.Querier, status domain.IdentityStatus, issuerID w3c.DID) ([]domain.IdentityState, error) { rows, err := conn.Query(ctx, `SELECT state_id, identifier, state, root_of_roots, claims_tree_root, revocation_tree_root, block_timestamp, block_number, tx_id, previous_state, status, modified_at, created_at FROM identity_states WHERE identifier = $1 and status = $2 and previous_state IS NOT NULL diff --git a/internal/repositories/link_repository.go b/internal/repositories/link_repository.go index 5cb93f77e..7de2cc98a 100644 --- a/internal/repositories/link_repository.go +++ b/internal/repositories/link_repository.go @@ -10,7 +10,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgtype" "github.com/jackc/pgx/v4" @@ -57,7 +57,7 @@ func (l link) Save(ctx context.Context, conn db.Querier, link *domain.Link) (*uu return &id, err } -func (l link) GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) (*domain.Link, error) { +func (l link) GetByID(ctx context.Context, issuerDID w3c.DID, id uuid.UUID) (*domain.Link, error) { const sql = ` SELECT links.id, links.issuer_id, @@ -127,7 +127,7 @@ GROUP BY links.id, schemas.id return &link, err } -func (l link) GetAll(ctx context.Context, issuerDID core.DID, status ports.LinkStatus, query *string) ([]domain.Link, error) { +func (l link) GetAll(ctx context.Context, issuerDID w3c.DID, status ports.LinkStatus, query *string) ([]domain.Link, error) { sql := ` SELECT links.id, links.issuer_id, @@ -228,7 +228,7 @@ WHERE links.issuer_id = $1 return links, nil } -func (l link) Delete(ctx context.Context, id uuid.UUID, issuerDID core.DID) error { +func (l link) Delete(ctx context.Context, id uuid.UUID, issuerDID w3c.DID) error { const sql = `DELETE FROM links WHERE id = $1 AND issuer_id =$2` cmd, err := l.conn.Pgx.Exec(ctx, sql, id.String(), issuerDID.String()) if err != nil { diff --git a/internal/repositories/mt.go b/internal/repositories/mt.go index d7c9dd7a8..920b7c06c 100644 --- a/internal/repositories/mt.go +++ b/internal/repositories/mt.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgtype" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -49,7 +49,7 @@ func (mt *identityMerkleTreeRepository) GetByID(ctx context.Context, conn db.Que return &res, nil } -func (mt *identityMerkleTreeRepository) GetByIdentifierAndTypes(ctx context.Context, conn db.Querier, identifier *core.DID, mtTypes []uint16) ([]domain.IdentityMerkleTree, error) { +func (mt *identityMerkleTreeRepository) GetByIdentifierAndTypes(ctx context.Context, conn db.Querier, identifier *w3c.DID, mtTypes []uint16) ([]domain.IdentityMerkleTree, error) { var typesSQL pgtype.Int2Array if err := typesSQL.Set(mtTypes); err != nil { return nil, err diff --git a/internal/repositories/revocation.go b/internal/repositories/revocation.go index 3ca2bc418..445a3b085 100644 --- a/internal/repositories/revocation.go +++ b/internal/repositories/revocation.go @@ -3,7 +3,7 @@ package repositories import ( "context" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" "github.com/polygonid/sh-id-platform/internal/core/ports" @@ -17,7 +17,7 @@ func NewRevocation() ports.RevocationRepository { return &revocation{} } -func (r *revocation) UpdateStatus(ctx context.Context, conn db.Querier, did *core.DID) ([]*domain.Revocation, error) { +func (r *revocation) UpdateStatus(ctx context.Context, conn db.Querier, did *w3c.DID) ([]*domain.Revocation, error) { rows, err := conn.Query(ctx, `UPDATE revocation SET status = $2 WHERE identifier = $1 AND status = $3 RETURNING identifier, nonce, version, status, description`, did.String(), domain.RevPublished, domain.RevPending) diff --git a/internal/repositories/schema-inmemory.go b/internal/repositories/schema-inmemory.go index d263338e9..f7d896e38 100644 --- a/internal/repositories/schema-inmemory.go +++ b/internal/repositories/schema-inmemory.go @@ -4,7 +4,7 @@ import ( "context" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/polygonid/sh-id-platform/internal/core/domain" ) @@ -23,7 +23,7 @@ func (s *schemaInMemory) Save(_ context.Context, schema *domain.Schema) error { return nil } -func (s *schemaInMemory) GetByID(_ context.Context, _ core.DID, id uuid.UUID) (*domain.Schema, error) { +func (s *schemaInMemory) GetByID(_ context.Context, _ w3c.DID, id uuid.UUID) (*domain.Schema, error) { if schema, found := s.schemas[id]; found { return &schema, nil } @@ -31,7 +31,7 @@ func (s *schemaInMemory) GetByID(_ context.Context, _ core.DID, id uuid.UUID) (* } // GetAll returns all. WARNING: query param will not work in the same way as DB repo -func (s *schemaInMemory) GetAll(_ context.Context, _ core.DID, _ *string) ([]domain.Schema, error) { +func (s *schemaInMemory) GetAll(_ context.Context, _ w3c.DID, _ *string) ([]domain.Schema, error) { schemas := make([]domain.Schema, len(s.schemas)) i := 0 for _, schema := range s.schemas { diff --git a/internal/repositories/schema.go b/internal/repositories/schema.go index 44d2f7ef0..0f78fe2e4 100644 --- a/internal/repositories/schema.go +++ b/internal/repositories/schema.go @@ -8,7 +8,8 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/jackc/pgx/v4" "github.com/polygonid/sh-id-platform/internal/core/domain" @@ -72,7 +73,7 @@ func (r *schema) toFullTextSearchDocument(sType string, attrs domain.SchemaWords // GetAll returns all the schemas that match any of the words that are included in the query string. // For each word, it will search for attributes that start with it or include it following postgres full text search tokenization -func (r *schema) GetAll(ctx context.Context, issuerDID core.DID, query *string) ([]domain.Schema, error) { +func (r *schema) GetAll(ctx context.Context, issuerDID w3c.DID, query *string) ([]domain.Schema, error) { var err error var rows pgx.Rows sqlArgs := make([]interface{}, 0) @@ -110,7 +111,7 @@ func (r *schema) GetAll(ctx context.Context, issuerDID core.DID, query *string) } // GetByID searches and returns an schema by id -func (r *schema) GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) (*domain.Schema, error) { +func (r *schema) GetByID(ctx context.Context, issuerDID w3c.DID, id uuid.UUID) (*domain.Schema, error) { const byID = `SELECT id, issuer_id, url, type, words, hash, created_at,version,title,description FROM schemas WHERE issuer_id = $1 AND id=$2` @@ -128,7 +129,7 @@ func (r *schema) GetByID(ctx context.Context, issuerDID core.DID, id uuid.UUID) } func toSchemaDomain(s *dbSchema) (*domain.Schema, error) { - issuerDID, err := core.ParseDID(s.IssuerID) + issuerDID, err := w3c.ParseDID(s.IssuerID) if err != nil { return nil, fmt.Errorf("parsing issuer DID from schema: %w", err) } diff --git a/internal/repositories/session.go b/internal/repositories/session.go index 93a7d6795..734b2e27f 100644 --- a/internal/repositories/session.go +++ b/internal/repositories/session.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/pkg/cache" diff --git a/internal/repositories/tests/claims_test.go b/internal/repositories/tests/claims_test.go index c872ea49e..eea4afeb9 100644 --- a/internal/repositories/tests/claims_test.go +++ b/internal/repositories/tests/claims_test.go @@ -7,8 +7,8 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/jackc/pgtype" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -78,7 +78,7 @@ func TestGetByRevocationNonce(t *testing.T) { claimsRepo := repositories.NewClaims() t.Run("should get revocation", func(t *testing.T) { - did, err := core.ParseDID(idStr) + did, err := w3c.ParseDID(idStr) assert.NoError(t, err) c, err := claimsRepo.GetByRevocationNonce(context.Background(), storage.Pgx, did, 0) assert.NoError(t, err) @@ -100,7 +100,7 @@ func TestGetByRevocationNonce(t *testing.T) { }) t.Run("should not get revocation wrong nonce", func(t *testing.T) { - did, err := core.ParseDID(idStr) + did, err := w3c.ParseDID(idStr) assert.NoError(t, err) r, err := claimsRepo.GetByRevocationNonce(context.Background(), storage.Pgx, did, 1) assert.Error(t, err) @@ -108,7 +108,7 @@ func TestGetByRevocationNonce(t *testing.T) { }) t.Run("should not get revocation wrong did", func(t *testing.T) { - did, err := core.ParseDID("did:polygonid:polygon:mumbai:2qFAer2CpbpNhMCkiMCrQbUf4vXnEKPhrQmqVfnaeY") + did, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qFAer2CpbpNhMCkiMCrQbUf4vXnEKPhrQmqVfnaeY") assert.NoError(t, err) r, err := claimsRepo.GetByRevocationNonce(context.Background(), storage.Pgx, did, 1) assert.Error(t, err) @@ -151,9 +151,9 @@ func TestRevokeNonce(t *testing.T) { func TestGetAllByConnectionAndIssuerID(t *testing.T) { fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) _ = fixture.CreateClaim(t, &domain.Claim{ @@ -221,9 +221,9 @@ func TestGetAllByIssuerID(t *testing.T) { ctx := context.Background() fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:iden3:tJUieNy7sk5PhitERHg1tgM8v1qhsDSEHVJSUF9rJ") + userDID, err := w3c.ParseDID("did:iden3:tJUieNy7sk5PhitERHg1tgM8v1qhsDSEHVJSUF9rJ") require.NoError(t, err) vc := &verifiable.W3CCredential{ @@ -312,13 +312,14 @@ func TestGetClaimsIssuedForUserID(t *testing.T) { linkStore := repositories.NewLink(*storage) schemaID := insertSchemaForLink(ctx, didStr, schemaStore, t) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) + + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) tomorrow := time.Now().Add(24 * time.Hour) nextWeek := time.Now().Add(7 * 24 * time.Hour) - link := domain.NewLink(did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + link := domain.NewLink(*did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) link.MaxIssuance = common.ToPointer(100) linkID, err := linkStore.Save(ctx, storage.Pgx, link) @@ -328,11 +329,11 @@ func TestGetClaimsIssuedForUserID(t *testing.T) { idClaim, _ := uuid.NewUUID() HIndex := uuid.New().String() - userDID := core.DID{} - require.NoError(t, userDID.SetString("did:polygonid:polygon:mumbai:2qP8KN3KRwBi37jB2ENXrWxhTo3pefaU5u5BFPbjYo")) + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qP8KN3KRwBi37jB2ENXrWxhTo3pefaU5u5BFPbjYo") + require.NoError(t, err) - userDIDWithCeroClaims := core.DID{} - require.NoError(t, userDID.SetString("did:polygonid:polygon:mumbai:2qHLU5GYftBHunAEh5PrBifeJiEVujh9Ybzukh7Nhy")) + userDIDWithCeroClaims, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qHLU5GYftBHunAEh5PrBifeJiEVujh9Ybzukh7Nhy") + require.NoError(t, err) idClaimInserted := fixture.CreateClaim(t, &domain.Claim{ ID: idClaim, @@ -355,7 +356,7 @@ func TestGetClaimsIssuedForUserID(t *testing.T) { type testConfig struct { name string - userDID core.DID + userDID w3c.DID expected int } @@ -364,17 +365,17 @@ func TestGetClaimsIssuedForUserID(t *testing.T) { for _, tc := range []testConfig{ { name: "should return 1", - userDID: userDID, + userDID: *userDID, expected: 1, }, { name: "should return 0", - userDID: userDIDWithCeroClaims, + userDID: *userDIDWithCeroClaims, expected: 0, }, } { t.Run(tc.name, func(t *testing.T) { - claims, err := claimsRepo.GetClaimsIssuedForUser(ctx, storage.Pgx, did, tc.userDID, link.ID) + claims, err := claimsRepo.GetClaimsIssuedForUser(ctx, storage.Pgx, *did, tc.userDID, link.ID) require.NoError(t, err) assert.Equal(t, tc.expected, len(claims)) }) diff --git a/internal/repositories/tests/connections_test.go b/internal/repositories/tests/connections_test.go index e4a4040f9..ab2e9e3ca 100644 --- a/internal/repositories/tests/connections_test.go +++ b/internal/repositories/tests/connections_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -19,9 +19,9 @@ import ( func TestSave(t *testing.T) { connectionsRepo := repositories.NewConnections() - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qCp9Tx4x5hzchym1dZXtBpwRQsH7HXe7GcbvskoRn") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qCp9Tx4x5hzchym1dZXtBpwRQsH7HXe7GcbvskoRn") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qHgCmGW1wDH5ShTH94SssR4eN8XW4xyHLfop2Qoqm") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qHgCmGW1wDH5ShTH94SssR4eN8XW4xyHLfop2Qoqm") require.NoError(t, err) conn := &domain.Connection{ @@ -48,9 +48,9 @@ func TestSave(t *testing.T) { func TestUpdatePushToken(t *testing.T) { connectionsRepo := repositories.NewConnections() - issuerDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qDLHs1n3c9oHxEPkgCMGfDjY4V37Xv8KztkZcpG1i") + issuerDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qDLHs1n3c9oHxEPkgCMGfDjY4V37Xv8KztkZcpG1i") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qHgCmGW1wDH5ShTH94SssR4eN8XW4xyHLfop2Qoqm") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qHgCmGW1wDH5ShTH94SssR4eN8XW4xyHLfop2Qoqm") require.NoError(t, err) conn := &domain.Connection{ @@ -85,9 +85,9 @@ func TestDelete(t *testing.T) { connectionsRepo := repositories.NewConnections() fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) conn := fixture.CreateConnection(t, &domain.Connection{ @@ -117,9 +117,9 @@ func TestConnectionsGetAllByIssuerID(t *testing.T) { connectionsRepo := repositories.NewConnections() fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) _ = fixture.CreateConnection(t, &domain.Connection{ @@ -190,14 +190,14 @@ func TestGetAllWithCredentialsByIssuerID(t *testing.T) { Identifier: idStr, } fixture.CreateIdentity(t, identity) - issuerDID, err := core.ParseDID(idStr) + issuerDID, err := w3c.ParseDID(idStr) require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qNtJm8v3c8b7XjQtAtSvAbudnUAfzsjHFqRnyYDq7") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qNtJm8v3c8b7XjQtAtSvAbudnUAfzsjHFqRnyYDq7") require.NoError(t, err) - userDID2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qFjTM4kX3J6AYzHBY1Q3ztnxv1UfNaaNUGw8TKo4N") + userDID2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qFjTM4kX3J6AYzHBY1Q3ztnxv1UfNaaNUGw8TKo4N") require.NoError(t, err) - userDID3, err := core.ParseDID("did:polygonid:polygon:mumbai:2qMTdi9CkqE8ihMn7qtp61QCdiKvfo2Ttx9a5TMDSt") + userDID3, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qMTdi9CkqE8ihMn7qtp61QCdiKvfo2Ttx9a5TMDSt") require.NoError(t, err) connNoCredentials := fixture.CreateConnection(t, &domain.Connection{ @@ -297,9 +297,9 @@ func TestDeleteConnectionCredentials(t *testing.T) { connectionsRepo := repositories.NewConnections() fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) conn := fixture.CreateConnection(t, &domain.Connection{ @@ -338,11 +338,11 @@ func TestGetByUserID(t *testing.T) { connectionsRepo := repositories.NewConnections() fixture := tests.NewFixture(storage) - issuerDID, err := core.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + issuerDID, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") require.NoError(t, err) - userDID, err := core.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") + userDID, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qH7XAwYQzCp9VfhpNgeLtK2iCehDDrfMWUCEg5ig5") require.NoError(t, err) - userDID2, err := core.ParseDID("did:polygonid:polygon:mumbai:2qL68in3FNbimFK6gka8hPZz475z31nqPJdqBeTsQr") + userDID2, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qL68in3FNbimFK6gka8hPZz475z31nqPJdqBeTsQr") require.NoError(t, err) _ = fixture.CreateConnection(t, &domain.Connection{ diff --git a/internal/repositories/tests/link_test.go b/internal/repositories/tests/link_test.go index 78385e78f..96d8dd1f6 100644 --- a/internal/repositories/tests/link_test.go +++ b/internal/repositories/tests/link_test.go @@ -7,7 +7,7 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -30,17 +30,17 @@ func TestSaveLink(t *testing.T) { linkStore := repositories.NewLink(*storage) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) validUntil := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) credentialExpiration := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) - linkToSave := domain.NewLink(did, common.ToPointer(10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{"birthday": 19790911, "documentType": 1}) + linkToSave := domain.NewLink(*did, common.ToPointer(10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{"birthday": 19790911, "documentType": 1}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) assert.NoError(t, err) assert.NotNil(t, linkID) - linkFetched, err := linkStore.GetByID(ctx, did, *linkID) + linkFetched, err := linkStore.GetByID(ctx, *did, *linkID) require.NoError(t, err) assert.Equal(t, linkToSave.Active, linkFetched.Active) assert.Equal(t, linkToSave.MaxIssuance, linkFetched.MaxIssuance) @@ -57,8 +57,8 @@ func TestSaveLink(t *testing.T) { didStr2 := "did:polygonid:polygon:mumbai:2qFrLQA6R1bfUTxjRnZEN9st77g6ZN2c7Vw1Dq6Vpp" _, err = storage.Pgx.Exec(ctx, "INSERT INTO identities (identifier) VALUES ($1)", didStr2) assert.NoError(t, err) - did2 := core.DID{} - require.NoError(t, did2.SetString(didStr2)) + did2, err := w3c.ParseDID(didStr2) + require.NoError(t, err) schemaID2 := insertSchemaForLink(ctx, didStr2, schemaStore, t) validUntil = time.Date(2055, 8, 15, 14, 30, 45, 100, time.Local) linkToSave.Active = false @@ -68,11 +68,11 @@ func TestSaveLink(t *testing.T) { linkToSave.CredentialSignatureProof = false linkToSave.ValidUntil = &validUntil linkToSave.SchemaID = schemaID2 - linkToSave.IssuerDID = domain.LinkCoreDID(did2) + linkToSave.IssuerDID = domain.LinkCoreDID(*did2) linkToSave.CredentialSubject = domain.CredentialSubject{"birthday": 19791011, "documentTpe": 2} linkID, err = linkStore.Save(ctx, storage.Pgx, linkToSave) assert.NoError(t, err) - linkFetched, err = linkStore.GetByID(ctx, did2, *linkID) + linkFetched, err = linkStore.GetByID(ctx, *did2, *linkID) require.NoError(t, err) assert.Equal(t, linkToSave.SchemaID, linkFetched.SchemaID) assert.Equal(t, linkToSave.IssuerDID, linkFetched.IssuerDID) @@ -92,9 +92,9 @@ func TestSaveLink(t *testing.T) { func insertSchemaForLink(ctx context.Context, didStr string, store ports.SchemaRepository, t *testing.T) uuid.UUID { t.Helper() SchemaStore := repositories.NewSchema(*storage) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) - insertSchemaGetAllData(t, ctx, did, SchemaStore) + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) + insertSchemaGetAllData(t, ctx, *did, SchemaStore) data := struct { typ string @@ -103,7 +103,7 @@ func insertSchemaForLink(ctx context.Context, didStr string, store ports.SchemaR s := &domain.Schema{ ID: uuid.New(), - IssuerDID: did, + IssuerDID: *did, URL: "url is not important in this test but need to be unique", Type: data.typ, Words: data.attributes, @@ -124,21 +124,21 @@ func TestGetLinkById(t *testing.T) { linkStore := repositories.NewLink(*storage) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) validUntil := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) credentialExpiration := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) assert.NoError(t, err) assert.NotNil(t, linkID) - linkFetched, err := linkStore.GetByID(ctx, did, *linkID) + linkFetched, err := linkStore.GetByID(ctx, *did, *linkID) assert.NoError(t, err) assert.NotNil(t, linkFetched) - _, err = linkStore.GetByID(ctx, did, uuid.New()) + _, err = linkStore.GetByID(ctx, *did, uuid.New()) assert.Error(t, err) assert.Equal(t, repositories.ErrLinkDoesNotExist, err) } @@ -153,36 +153,36 @@ func TestGetAll(t *testing.T) { linkStore := repositories.NewLink(*storage) schemaID := insertSchemaForLink(ctx, didStr, schemaStore, t) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) tomorrow := time.Now().Add(24 * time.Hour) nextWeek := time.Now().Add(7 * 24 * time.Hour) past := time.Now().Add(-100 * 24 * time.Hour) // 10 not expired links and no max issuance for i := 0; i < 10; i++ { - linkToSave := domain.NewLink(did, nil, &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, nil, &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) require.NoError(t, err) assert.NotNil(t, linkID) } // 10 not expired links for i := 0; i < 10; i++ { - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) require.NoError(t, err) assert.NotNil(t, linkID) } // 10 expired ones for i := 0; i < 10; i++ { - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &past, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &past, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) require.NoError(t, err) assert.NotNil(t, linkID) } // 10 valid but over used for i := 0; i < 10; i++ { - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) linkToSave.MaxIssuance = common.ToPointer(100) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) @@ -212,7 +212,7 @@ func TestGetAll(t *testing.T) { } // 10 inactive for i := 0; i < 10; i++ { - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &tomorrow, schemaID, &nextWeek, true, false, domain.CredentialSubject{}) linkToSave.Active = false linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) require.NoError(t, err) @@ -316,7 +316,7 @@ func TestGetAll(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - all, err := linkStore.GetAll(ctx, did, tc.filter, tc.query) + all, err := linkStore.GetAll(ctx, *did, tc.filter, tc.query) require.NoError(t, err) require.Len(t, all, tc.expected.count) for _, one := range all { @@ -344,27 +344,27 @@ func TestDeleteLink(t *testing.T) { linkStore := repositories.NewLink(*storage) - did := core.DID{} - require.NoError(t, did.SetString(didStr)) + did, err := w3c.ParseDID(didStr) + require.NoError(t, err) - did2 := core.DID{} - require.NoError(t, did2.SetString(didStr2)) + did2, err := w3c.ParseDID(didStr2) + require.NoError(t, err) validUntil := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) credentialExpiration := time.Date(2050, 8, 15, 14, 30, 45, 100, time.Local) - linkToSave := domain.NewLink(did, common.ToPointer[int](10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{}) + linkToSave := domain.NewLink(*did, common.ToPointer[int](10), &validUntil, schemaID, &credentialExpiration, true, false, domain.CredentialSubject{}) linkID, err := linkStore.Save(ctx, storage.Pgx, linkToSave) assert.NoError(t, err) assert.NotNil(t, linkID) - err = linkStore.Delete(ctx, *linkID, did2) + err = linkStore.Delete(ctx, *linkID, *did2) assert.Error(t, err) - err = linkStore.Delete(ctx, *linkID, did) + err = linkStore.Delete(ctx, *linkID, *did) assert.NoError(t, err) - err = linkStore.Delete(ctx, uuid.New(), did) + err = linkStore.Delete(ctx, uuid.New(), *did) assert.Error(t, err) assert.Equal(t, repositories.ErrLinkDoesNotExist, err) } diff --git a/internal/repositories/tests/mt_test.go b/internal/repositories/tests/mt_test.go index 790017ba9..f6afa9733 100644 --- a/internal/repositories/tests/mt_test.go +++ b/internal/repositories/tests/mt_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - core "github.com/iden3/go-iden3-core" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" "github.com/polygonid/sh-id-platform/internal/repositories" @@ -33,7 +33,7 @@ func TestMtGetByIdentifierAndTypes(t *testing.T) { mt, err := repo.Save(context.Background(), storage.Pgx, idStr, 0) assert.NoError(t, err) assert.NotNil(t, mt) - did, err := core.ParseDID(idStr) + did, err := w3c.ParseDID(idStr) assert.NoError(t, err) mts, err := repo.GetByIdentifierAndTypes(context.Background(), storage.Pgx, did, []uint16{0}) @@ -44,7 +44,7 @@ func TestMtGetByIdentifierAndTypes(t *testing.T) { // when and then t.Run("should not get the mt", func(t *testing.T) { - did, err := core.ParseDID("did:polygonid:polygon:mumbai:2qHtzzxS7uazdumnyZEdf74CNo3MptdW6ytxxwbPMW") + did, err := w3c.ParseDID("did:polygonid:polygon:mumbai:2qHtzzxS7uazdumnyZEdf74CNo3MptdW6ytxxwbPMW") assert.NoError(t, err) mts, err := repo.GetByIdentifierAndTypes(context.Background(), storage.Pgx, did, []uint16{0}) assert.NoError(t, err) diff --git a/internal/repositories/tests/schema_test.go b/internal/repositories/tests/schema_test.go index 46032bad0..b2bb5751c 100644 --- a/internal/repositories/tests/schema_test.go +++ b/internal/repositories/tests/schema_test.go @@ -9,7 +9,8 @@ import ( "time" "github.com/google/uuid" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -25,15 +26,16 @@ func TestGetSchema(t *testing.T) { rand.NewSource(time.Now().Unix()) ctx := context.Background() store := repositories.NewSchema(*storage) - did := core.DID{} // Create a schemaHash i := &big.Int{} i.SetInt64(rand.Int63()) - require.NoError(t, did.SetString("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ")) + did, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + require.NoError(t, err) + schema1 := &domain.Schema{ ID: uuid.New(), - IssuerDID: did, + IssuerDID: *did, URL: "https://an.url.org/index.html", Type: "schemaType", Hash: core.NewSchemaHashFromInt(i), @@ -45,7 +47,7 @@ func TestGetSchema(t *testing.T) { } require.NoError(t, store.Save(ctx, schema1)) - schema2, err := store.GetByID(ctx, did, schema1.ID) + schema2, err := store.GetByID(ctx, *did, schema1.ID) require.NoError(t, err) assert.Equal(t, schema1.ID, schema2.ID) assert.Equal(t, schema1.IssuerDID, schema2.IssuerDID) @@ -63,15 +65,17 @@ func TestCreateSchema(t *testing.T) { rand.NewSource(time.Now().Unix()) ctx := context.Background() store := repositories.NewSchema(*storage) - did := core.DID{} + // Create a schemaHash i := &big.Int{} i.SetInt64(rand.Int63()) - require.NoError(t, did.SetString("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ")) + did, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + require.NoError(t, err) + schema1 := &domain.Schema{ ID: uuid.New(), - IssuerDID: did, + IssuerDID: *did, URL: "https://an.url.org/index.html", Type: "schemaType", Hash: core.NewSchemaHashFromInt(i), @@ -95,15 +99,17 @@ func TestGetSchemaWithNullAttributes(t *testing.T) { rand.NewSource(time.Now().Unix()) ctx := context.Background() store := repositories.NewSchema(*storage) - did := core.DID{} + // Create a schemaHash i := &big.Int{} i.SetInt64(rand.Int63()) - require.NoError(t, did.SetString("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ")) + did, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + require.NoError(t, err) + schema1 := &domain.Schema{ // no description ID: uuid.New(), - IssuerDID: did, + IssuerDID: *did, URL: "https://an.url.org/index.html", Type: "schemaType", Hash: core.NewSchemaHashFromInt(i), @@ -115,7 +121,7 @@ func TestGetSchemaWithNullAttributes(t *testing.T) { require.NoError(t, store.Save(ctx, schema1)) - bdSchema, err := store.GetByID(ctx, did, schema1.ID) + bdSchema, err := store.GetByID(ctx, *did, schema1.ID) require.NoError(t, err) assert.Nil(t, bdSchema.Title) require.NotNil(t, bdSchema.Description) @@ -135,9 +141,9 @@ func TestGetAllFullTextSearch(t *testing.T) { defer teardown() store := repositories.NewSchema(*storage) - did := core.DID{} - require.NoError(t, did.SetString("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ")) - insertSchemaGetAllData(t, ctx, did, store) + did, err := w3c.ParseDID("did:iden3:polygon:mumbai:wyFiV4w71QgWPn6bYLsZoysFay66gKtVa9kfu6yMZ") + require.NoError(t, err) + insertSchemaGetAllData(t, ctx, *did, store) type expected struct { collection []domain.Schema @@ -277,7 +283,7 @@ func TestGetAllFullTextSearch(t *testing.T) { // TODO: Add partial like tests } { t.Run(tc.name, func(t *testing.T) { - collection, err := store.GetAll(ctx, did, tc.query) + collection, err := store.GetAll(ctx, *did, tc.query) require.NoError(t, err) require.Len(t, collection, len(tc.expected.collection)) for i := range collection { @@ -287,7 +293,7 @@ func TestGetAllFullTextSearch(t *testing.T) { } } -func insertSchemaGetAllData(t *testing.T, ctx context.Context, did core.DID, store ports.SchemaRepository) { +func insertSchemaGetAllData(t *testing.T, ctx context.Context, did w3c.DID, store ports.SchemaRepository) { t.Helper() data := []struct { typ string diff --git a/pkg/blockchain/eth/client.go b/pkg/blockchain/eth/client.go index 23c390138..40c24106a 100644 --- a/pkg/blockchain/eth/client.go +++ b/pkg/blockchain/eth/client.go @@ -13,7 +13,7 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/consensus/misc" + "github.com/ethereum/go-ethereum/consensus/misc/eip1559" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/params" @@ -337,7 +337,7 @@ func (c *Client) CreateRawTx(ctx context.Context, txParams TransactionParams) (* if txParams.BaseFee == nil { // since ETH and Polygon blockchain already supports London fork. // no need set special block. - baseFee := misc.CalcBaseFee(¶ms.ChainConfig{LondonBlock: big.NewInt(1)}, latestBlockHeader) + baseFee := eip1559.CalcBaseFee(¶ms.ChainConfig{LondonBlock: big.NewInt(1)}, latestBlockHeader) // add 25% to baseFee. baseFee always small value. // since we use dynamic fee transactions we will get not used gas back. diff --git a/pkg/credentials/signature/circuit/signer/signer.go b/pkg/credentials/signature/circuit/signer/signer.go index e1caeeada..1c3f1e81a 100644 --- a/pkg/credentials/signature/circuit/signer/signer.go +++ b/pkg/credentials/signature/circuit/signer/signer.go @@ -6,11 +6,12 @@ import ( "fmt" "math/big" - core "github.com/iden3/go-iden3-core" + core "github.com/iden3/go-iden3-core/v2" + "github.com/iden3/go-iden3-core/v2/w3c" "github.com/iden3/go-iden3-crypto/babyjub" "github.com/iden3/go-iden3-crypto/poseidon" "github.com/iden3/go-merkletree-sql/v2" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/pkg/errors" ) @@ -34,7 +35,7 @@ type CircuitSigner struct { type Context struct { SignatureType string `json:"signature_type"` SignatureHex string `json:"signature_hex"` - Creator *core.DID `json:"creator,omitempty"` + Creator *w3c.DID `json:"creator,omitempty"` Created int64 `json:"created,omitempty"` Domain string `json:"domain,omitempty"` Nonce []byte `json:"nonce,omitempty"` diff --git a/pkg/loaders/circuits.go b/pkg/loaders/circuits.go index 190cdc1bb..adb5c30d0 100644 --- a/pkg/loaders/circuits.go +++ b/pkg/loaders/circuits.go @@ -6,7 +6,7 @@ import ( "os" "path/filepath" - "github.com/iden3/go-circuits" + "github.com/iden3/go-circuits/v2" ) const ( diff --git a/pkg/notifications/messages.go b/pkg/notifications/messages.go index 8f2c5688f..7743a2d2e 100644 --- a/pkg/notifications/messages.go +++ b/pkg/notifications/messages.go @@ -6,8 +6,8 @@ import ( "strings" "github.com/google/uuid" - "github.com/iden3/iden3comm/packers" - "github.com/iden3/iden3comm/protocol" + "github.com/iden3/iden3comm/v2/packers" + "github.com/iden3/iden3comm/v2/protocol" "github.com/polygonid/sh-id-platform/internal/core/domain" ) diff --git a/pkg/notifications/push.go b/pkg/notifications/push.go index 64a657a62..6124dc224 100644 --- a/pkg/notifications/push.go +++ b/pkg/notifications/push.go @@ -4,7 +4,7 @@ import ( "encoding/json" "errors" - "github.com/iden3/go-schema-processor/verifiable" + "github.com/iden3/go-schema-processor/v2/verifiable" ) var ( diff --git a/pkg/protocol/packagemanager.go b/pkg/protocol/packagemanager.go index 85e38125e..b8ecf598e 100644 --- a/pkg/protocol/packagemanager.go +++ b/pkg/protocol/packagemanager.go @@ -6,11 +6,11 @@ import ( "math/big" "github.com/iden3/contracts-abi/state/go/abi" - "github.com/iden3/go-circuits" - core "github.com/iden3/go-iden3-core" - "github.com/iden3/go-jwz" - "github.com/iden3/iden3comm" - "github.com/iden3/iden3comm/packers" + "github.com/iden3/go-circuits/v2" + "github.com/iden3/go-iden3-core/v2/w3c" + "github.com/iden3/go-jwz/v2" + "github.com/iden3/iden3comm/v2" + "github.com/iden3/iden3comm/v2/packers" "github.com/polygonid/sh-id-platform/internal/core/ports" "github.com/polygonid/sh-id-platform/pkg/loaders" @@ -53,7 +53,7 @@ func InitPackageManager(ctx context.Context, stateContract *abi.State, zkProofSe } func prepareAuthInputs(ctx context.Context, proofService ports.ProofService) packers.DataPreparerHandlerFunc { - return func(hash []byte, id *core.DID, circuitID circuits.CircuitID) ([]byte, error) { + return func(hash []byte, id *w3c.DID, circuitID circuits.CircuitID) ([]byte, error) { q := ports.Query{} q.CircuitID = string(circuitID) q.Challenge = new(big.Int).SetBytes(hash) diff --git a/pkg/protocol/verify.go b/pkg/protocol/verify.go index 039e1ea35..8325687f6 100644 --- a/pkg/protocol/verify.go +++ b/pkg/protocol/verify.go @@ -7,8 +7,8 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/iden3/contracts-abi/state/go/abi" - "github.com/iden3/go-circuits" - "github.com/iden3/iden3comm/packers" + "github.com/iden3/go-circuits/v2" + "github.com/iden3/iden3comm/v2/packers" "github.com/pkg/errors" ) diff --git a/pkg/schema/schema.go b/pkg/schema/schema.go index b942c11a5..b439501d7 100644 --- a/pkg/schema/schema.go +++ b/pkg/schema/schema.go @@ -6,13 +6,15 @@ import ( "errors" "fmt" - core "github.com/iden3/go-iden3-core" - jsonSuite "github.com/iden3/go-schema-processor/json" - "github.com/iden3/go-schema-processor/processor" - "github.com/iden3/go-schema-processor/verifiable" + core "github.com/iden3/go-iden3-core/v2" + jsonSuiteV1 "github.com/iden3/go-schema-processor/json" + jsonSuite "github.com/iden3/go-schema-processor/v2/json" + "github.com/iden3/go-schema-processor/v2/processor" + "github.com/iden3/go-schema-processor/v2/verifiable" "github.com/jackc/pgtype" "github.com/polygonid/sh-id-platform/internal/core/domain" + "github.com/polygonid/sh-id-platform/internal/jsonschema" "github.com/polygonid/sh-id-platform/internal/loader" ) @@ -23,13 +25,15 @@ var ( ) // LoadSchema loads schema from url -func LoadSchema(ctx context.Context, loader loader.Loader) (jsonSuite.Schema, error) { - var schema jsonSuite.Schema - schemaBytes, _, err := loader.Load(ctx) +// TODO: Refactor to avoid v1 dependencies +func LoadSchema(ctx context.Context, loader loader.DocumentLoader, jsonSchemaURL string) (jsonSuiteV1.Schema, error) { + var schema jsonSuiteV1.Schema + + schemaBytes, err := jsonschema.Load(ctx, jsonSchemaURL, loader) if err != nil { return schema, err } - err = json.Unmarshal(schemaBytes, &schema) + err = json.Unmarshal(schemaBytes.BytesNoErr(), &schema) return schema, err } @@ -88,7 +92,7 @@ func FromClaimsModelToW3CCredential(credentials domain.Credentials) ([]*verifiab } // Process data and schema and create Index and Value slots -func Process(ctx context.Context, ld loader.Loader, credentialType string, credential verifiable.W3CCredential, options *processor.CoreClaimOptions) (*core.Claim, error) { +func Process(ctx context.Context, loader loader.DocumentLoader, schemaURL string, credential verifiable.W3CCredential, options *processor.CoreClaimOptions) (*core.Claim, error) { var parser processor.Parser var validator processor.Validator pr := &processor.Processor{} @@ -96,9 +100,13 @@ func Process(ctx context.Context, ld loader.Loader, credentialType string, crede validator = jsonSuite.Validator{} parser = jsonSuite.Parser{} - pr = processor.InitProcessorOptions(pr, processor.WithValidator(validator), processor.WithParser(parser), processor.WithSchemaLoader(ld)) + pr = processor.InitProcessorOptions( + pr, + processor.WithDocumentLoader(loader), + processor.WithValidator(validator), + processor.WithParser(parser)) - schema, _, err := pr.Load(ctx) + schema, err := pr.Load(ctx, schemaURL) if err != nil { return nil, ErrLoadSchema } @@ -113,7 +121,7 @@ func Process(ctx context.Context, ld loader.Loader, credentialType string, crede return nil, ErrValidateData } - claim, err := pr.ParseClaim(ctx, credential, credentialType, schema, options) + claim, err := pr.ParseClaim(ctx, credential, options) if err != nil { return nil, ErrParseClaim }