From 8d7b8e3510da5b071fb3eb98497f68c180189d3f Mon Sep 17 00:00:00 2001 From: Martin Saporiti Date: Wed, 22 May 2024 09:53:46 -0300 Subject: [PATCH] chore: update libraries to support amoy network --- go.mod | 16 ++++++------ go.sum | 39 ++++++++++++---------------- internal/api/server.go | 1 + internal/core/services/proof.go | 14 ++-------- internal/core/services/revocation.go | 21 +++------------ 5 files changed, 30 insertions(+), 61 deletions(-) diff --git a/go.mod b/go.mod index 18a60a092..ff3dcffeb 100644 --- a/go.mod +++ b/go.mod @@ -12,17 +12,17 @@ require ( github.com/go-redis/cache/v8 v8.4.4 github.com/go-redis/redis/v8 v8.11.5 github.com/golangci/golangci-lint v1.55.2 - github.com/google/uuid v1.4.0 + github.com/google/uuid v1.6.0 github.com/hashicorp/go-retryablehttp v0.7.5 github.com/hashicorp/vault/api v1.10.0 github.com/hashicorp/vault/api/auth/userpass v0.5.0 github.com/iden3/contracts-abi/onchain-credential-status-resolver/go/abi v0.0.0-20230911113809-c58b7e7a69b0 github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20231006071010-f511d08ca36f - 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/v2 v2.0.0 + github.com/iden3/go-circuits/v2 v2.2.0 + github.com/iden3/go-iden3-auth/v2 v2.2.2 + github.com/iden3/go-iden3-core/v2 v2.1.0 + github.com/iden3/go-iden3-crypto v0.0.16 + github.com/iden3/go-jwz/v2 v2.0.2 github.com/iden3/go-merkletree-sql/db/pgx/v2 v2.0.5 github.com/iden3/go-merkletree-sql/v2 v2.0.6 github.com/iden3/go-rapidsnark/prover v0.0.10 @@ -30,8 +30,8 @@ require ( github.com/iden3/go-rapidsnark/witness/v2 v2.0.0 github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e github.com/iden3/go-schema-processor v1.3.1 - github.com/iden3/go-schema-processor/v2 v2.1.0 - github.com/iden3/iden3comm/v2 v2.0.0 + github.com/iden3/go-schema-processor/v2 v2.3.3 + github.com/iden3/iden3comm/v2 v2.3.2 github.com/iden3/merkletree-proof v0.0.4 github.com/ipfs/go-ipfs-api v0.7.0 github.com/jackc/pgconn v1.14.1 diff --git a/go.sum b/go.sum index 344640227..b7a7ac86a 100644 --- a/go.sum +++ b/go.sum @@ -310,7 +310,6 @@ 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/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -405,8 +404,8 @@ github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f h1:pDhu5sgp8yJlEF/g6o 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.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/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= @@ -480,18 +479,18 @@ github.com/iden3/contracts-abi/rhs-storage/go/abi v0.0.0-20231006141557-7d13ef7e github.com/iden3/contracts-abi/rhs-storage/go/abi v0.0.0-20231006141557-7d13ef7e3c48/go.mod h1:kJmVPMk4HfWyl2kcta34aad/K4TAfCwB29xX9PsR7LQ= github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20231006071010-f511d08ca36f h1:aTYEBIh802oWF6B3jhXf5F7UVGxfPJG70shYkRXzb+s= github.com/iden3/contracts-abi/state/go/abi v1.0.2-0.20231006071010-f511d08ca36f/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-circuits/v2 v2.2.0 h1:qJeySVPG9vxZwJyL/CsvXdUhccWOctXQUYGnyX5p2Kc= +github.com/iden3/go-circuits/v2 v2.2.0/go.mod h1:1LET+T8i9Rkfx+RNj2BBHKAPGDODEWWwSEFjR6g3h6c= +github.com/iden3/go-iden3-auth/v2 v2.2.2 h1:4uA+m5H2OvhfOsMJaeXaCjciV2sHypvHgGHewZfXB58= +github.com/iden3/go-iden3-auth/v2 v2.2.2/go.mod h1:1ytFvnSnuNK2m9BoVrgYJoLNH919Bg2pt68pFelcJcM= 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/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-iden3-core/v2 v2.1.0 h1:R1s7Tj3tIx5lDy8S7OJrSNuxXIFeRzWRmTBaQoQHJps= +github.com/iden3/go-iden3-core/v2 v2.1.0/go.mod h1:L9PxhWPvoS9qTb3inEkZBm1RpjHBt+VTwvxssdzbAdw= +github.com/iden3/go-iden3-crypto v0.0.16 h1:zN867xiz6HgErXVIV/6WyteGcOukE9gybYTorBMEdsk= +github.com/iden3/go-iden3-crypto v0.0.16/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E= +github.com/iden3/go-jwz/v2 v2.0.2 h1:yx56x1TZcObeuj6cvX715Jd7QTxnCpHwbETKWCPJmhw= +github.com/iden3/go-jwz/v2 v2.0.2/go.mod h1:B1r6wJpPhIiuZTmgicNoogr7XD/VS3jZu9U519GwWz4= 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.6 h1:vsVDImnvnHf7Ggr45ptFOXJyWNA/8IwVQO1jzRLUlY8= @@ -508,10 +507,10 @@ github.com/iden3/go-rapidsnark/witness/wazero v0.0.0-20230524142950-0986cf057d4e 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/go-schema-processor/v2 v2.1.0 h1:8/fA7IVkyVmpbJij9Ar0X2zWPQJMlCaaPP4hfTZqbqU= -github.com/iden3/go-schema-processor/v2 v2.1.0/go.mod h1:EogHwnFnxQKOGRVme6upCcisoAQeEIl+HuRAGa7w3+w= -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/go-schema-processor/v2 v2.3.3 h1:GfChxMZHG4miA3p/5rLIrM7TGmKu/oAAXgLloYTBHSI= +github.com/iden3/go-schema-processor/v2 v2.3.3/go.mod h1:8y/R0iQpYhyhRQ3sL4F5Aja3+1T68M6uwGQdC4pQ4X0= +github.com/iden3/iden3comm/v2 v2.3.2 h1:ulD0oI/+qsEmnHVELWrxdLNvQOOWr/JLVMFXzEVbr5E= +github.com/iden3/iden3comm/v2 v2.3.2/go.mod h1:HVdSjre4og+kdJ5Cqe2b3Dt2ccOogOdfyWwKaUSAelw= github.com/iden3/merkletree-proof v0.0.4 h1:o1XXws6zb7+BBDQYXlo0GPUH+jUY3+GxkT88U1C4Sb8= github.com/iden3/merkletree-proof v0.0.4/go.mod h1:D49CVDG/tshMiZuDCxWjGJoNplRg9y9XIlg9/eMSYOc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -740,8 +739,6 @@ 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.11.0 h1:XqGyJ8ufbCE0HmTDwx2kPdsrQ36AGPZNZX6s6xfJH10= -github.com/multiformats/go-multiaddr v0.11.0/go.mod h1:gWUm0QLR4thQ6+ZF6SXUw8YjtwQSPapICM+NmCkxHSM= github.com/multiformats/go-multiaddr v0.12.1 h1:vm+BA/WZA8QZDp1pF1FWhi5CT3g1tbi5GJmqpb6wnlk= github.com/multiformats/go-multiaddr v0.12.1/go.mod h1:7mPkiBMmLeFipt+nNSq9pHZUeJSt8lHBgH6yhj0YQzE= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= @@ -1069,8 +1066,6 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 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.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1280,8 +1275,6 @@ golang.org/x/sys v0.6.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/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= diff --git a/internal/api/server.go b/internal/api/server.go index 6db1aedd7..03509d5ab 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -392,6 +392,7 @@ func (s *Server) Agent(ctx context.Context, request AgentRequestObject) (AgentRe log.Debug(ctx, "agent empty request") return Agent400JSONResponse{N400JSONResponse{"cannot proceed with an empty request"}}, nil } + fmt.Println(request.Body) basicMessage, err := s.packageManager.UnpackWithType(packers.MediaTypeZKPMessage, []byte(*request.Body)) if err != nil { log.Debug(ctx, "agent bad request", "err", err, "body", *request.Body) diff --git a/internal/core/services/proof.go b/internal/core/services/proof.go index 4e90d1220..acb8eb366 100644 --- a/internal/core/services/proof.go +++ b/internal/core/services/proof.go @@ -334,12 +334,7 @@ func (p *Proof) checkRevocationStatus(ctx context.Context, claim *domain.Claim) } return &verifiable.RevocationStatus{ - Issuer: struct { - State *string `json:"state,omitempty"` - RootOfRoots *string `json:"rootOfRoots,omitempty"` - ClaimsTreeRoot *string `json:"claimsTreeRoot,omitempty"` - RevocationTreeRoot *string `json:"revocationTreeRoot,omitempty"` - }{ + Issuer: verifiable.TreeState{ State: bjp.IssuerData.State.Value, RootOfRoots: bjp.IssuerData.State.RootOfRoots, ClaimsTreeRoot: bjp.IssuerData.State.ClaimsTreeRoot, @@ -514,12 +509,7 @@ func (p *Proof) callNonRevProof(ctx context.Context, issuerData verifiable.Issue NodeAux: nil, }, TreeState: domain.RevocationStatusToTreeState(verifiable.RevocationStatus{ - Issuer: struct { - State *string `json:"state,omitempty"` - RootOfRoots *string `json:"rootOfRoots,omitempty"` - ClaimsTreeRoot *string `json:"claimsTreeRoot,omitempty"` - RevocationTreeRoot *string `json:"revocationTreeRoot,omitempty"` - }{ + Issuer: verifiable.TreeState{ State: issuerData.State.Value, RootOfRoots: issuerData.State.RootOfRoots, ClaimsTreeRoot: issuerData.State.ClaimsTreeRoot, diff --git a/internal/core/services/revocation.go b/internal/core/services/revocation.go index e861b67d9..3740537fb 100644 --- a/internal/core/services/revocation.go +++ b/internal/core/services/revocation.go @@ -227,12 +227,7 @@ func getNonRevocationProofFromRHS(ctx context.Context, rhsURL string, data, issu } return &verifiable.RevocationStatus{ - Issuer: struct { - State *string `json:"state,omitempty"` - RootOfRoots *string `json:"rootOfRoots,omitempty"` - ClaimsTreeRoot *string `json:"claimsTreeRoot,omitempty"` - RevocationTreeRoot *string `json:"revocationTreeRoot,omitempty"` - }{ + Issuer: verifiable.TreeState{ State: &s, ClaimsTreeRoot: &CTR, RevocationTreeRoot: &RTR, @@ -316,12 +311,7 @@ func getRevocationStatusFromIssuerData(did *w3c.DID, issuerData *verifiable.Issu } return &verifiable.RevocationStatus{ - Issuer: struct { - State *string `json:"state,omitempty"` - RootOfRoots *string `json:"rootOfRoots,omitempty"` - ClaimsTreeRoot *string `json:"claimsTreeRoot,omitempty"` - RevocationTreeRoot *string `json:"revocationTreeRoot,omitempty"` - }{ + Issuer: verifiable.TreeState{ State: issuerData.State.Value, RootOfRoots: issuerData.State.RootOfRoots, ClaimsTreeRoot: issuerData.State.ClaimsTreeRoot, @@ -427,12 +417,7 @@ func (r *Revocation) getRevocationStatusFromOnchainCredStatusResolver(ctx contex rorHex := ror.Hex() return &verifiable.RevocationStatus{ - Issuer: struct { - State *string `json:"state,omitempty"` - RootOfRoots *string `json:"rootOfRoots,omitempty"` - ClaimsTreeRoot *string `json:"claimsTreeRoot,omitempty"` - RevocationTreeRoot *string `json:"revocationTreeRoot,omitempty"` - }{ + Issuer: verifiable.TreeState{ State: &stateHex, ClaimsTreeRoot: &ctrHex, RevocationTreeRoot: &rtrHex,