diff --git a/api/ssi_types_test.go b/api/ssi_types_test.go index a70c82c983..034ca92fba 100644 --- a/api/ssi_types_test.go +++ b/api/ssi_types_test.go @@ -19,7 +19,7 @@ package ssiTypes import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" "time" diff --git a/audit/audit.go b/audit/audit.go index 1733792635..7b9d1947b1 100644 --- a/audit/audit.go +++ b/audit/audit.go @@ -21,8 +21,8 @@ package audit import ( "bytes" "context" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/sirupsen/logrus" "strings" "sync" diff --git a/auth/api/auth/v1/api.go b/auth/api/auth/v1/api.go index 0d79c9d4a5..e9cf87991b 100644 --- a/auth/api/auth/v1/api.go +++ b/auth/api/auth/v1/api.go @@ -20,10 +20,10 @@ package v1 import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/auth/oauth" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/url" "regexp" diff --git a/auth/api/iam/api.go b/auth/api/iam/api.go index c3affbcf97..df6033c616 100644 --- a/auth/api/iam/api.go +++ b/auth/api/iam/api.go @@ -26,10 +26,10 @@ import ( "embed" "encoding/base64" "encoding/hex" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/core/to" + "github.com/nuts-foundation/nuts-node/json" "html/template" "net/http" "net/url" diff --git a/auth/api/iam/api_test.go b/auth/api/iam/api_test.go index 448807dea7..43f10675ec 100644 --- a/auth/api/iam/api_test.go +++ b/auth/api/iam/api_test.go @@ -21,9 +21,9 @@ package iam import ( "bytes" "context" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "net/http/httptest" @@ -639,7 +639,7 @@ func TestWrapper_IntrospectAccessToken(t *testing.T) { // token is invalid JSON require.NoError(t, ctx.client.accessTokenServerStore().Put("err", "{")) res, err := ctx.client.IntrospectAccessToken(reqCtx, IntrospectAccessTokenRequestObject{Body: &TokenIntrospectionRequest{Token: "err"}}) - assert.ErrorContains(t, err, "json: cannot unmarshal") + assert.ErrorContains(t, err, "sonnet: cannot unmarshal") assert.Nil(t, res) }) t.Run("error - does not exist", func(t *testing.T) { @@ -1469,7 +1469,7 @@ func TestWrapper_subjectOwns(t *testing.T) { } func TestWrapper_accessTokenRequestCacheKey(t *testing.T) { - expected := "080c4170aa372da86b76c6b5db2c3c08a532c7c8454b5d2f3fb0e1d239e59758" + expected := "0ab3c494cd634278b5a9b8ba0d84486b0cb0b4686bed86fdfb3b77d662f66175" key := accessTokenRequestCacheKey(RequestServiceAccessTokenRequestObject{SubjectID: holderSubjectID, Body: &RequestServiceAccessTokenJSONRequestBody{Scope: "test"}}) other := accessTokenRequestCacheKey(RequestServiceAccessTokenRequestObject{SubjectID: holderSubjectID, Body: &RequestServiceAccessTokenJSONRequestBody{Scope: "test2"}}) diff --git a/auth/api/iam/codegen_sillyness.go b/auth/api/iam/codegen_sillyness.go index aa0e58370b..f860dd7b17 100644 --- a/auth/api/iam/codegen_sillyness.go +++ b/auth/api/iam/codegen_sillyness.go @@ -18,7 +18,7 @@ package iam -import "encoding/json" +import "github.com/nuts-foundation/nuts-node/json" var _ json.Marshaler = IntrospectAccessToken200JSONResponse{} diff --git a/auth/api/iam/codegen_sillyness_test.go b/auth/api/iam/codegen_sillyness_test.go index a3fcea1caa..6b6c7b2ce8 100644 --- a/auth/api/iam/codegen_sillyness_test.go +++ b/auth/api/iam/codegen_sillyness_test.go @@ -19,7 +19,7 @@ package iam import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "testing" ) diff --git a/auth/api/iam/openid4vci.go b/auth/api/iam/openid4vci.go index 6a971d3e51..8ca782242a 100644 --- a/auth/api/iam/openid4vci.go +++ b/auth/api/iam/openid4vci.go @@ -20,9 +20,9 @@ package iam import ( "context" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/url" "time" diff --git a/auth/api/iam/openid4vp.go b/auth/api/iam/openid4vp.go index 405a52e7b3..9817dfe11b 100644 --- a/auth/api/iam/openid4vp.go +++ b/auth/api/iam/openid4vp.go @@ -20,10 +20,10 @@ package iam import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/http/user" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/url" "slices" diff --git a/auth/api/iam/openid4vp_test.go b/auth/api/iam/openid4vp_test.go index f57ff74a73..d89fcc1aea 100644 --- a/auth/api/iam/openid4vp_test.go +++ b/auth/api/iam/openid4vp_test.go @@ -20,8 +20,8 @@ package iam import ( "context" - "encoding/json" "github.com/nuts-foundation/nuts-node/http/user" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/url" "strings" diff --git a/auth/api/iam/s2s_vptoken_test.go b/auth/api/iam/s2s_vptoken_test.go index cb420e2aab..d919827127 100644 --- a/auth/api/iam/s2s_vptoken_test.go +++ b/auth/api/iam/s2s_vptoken_test.go @@ -23,9 +23,9 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "errors" "github.com/nuts-foundation/nuts-node/auth/oauth" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/policy" "go.uber.org/mock/gomock" "net/http" diff --git a/auth/api/iam/session_test.go b/auth/api/iam/session_test.go index 0490ccebf3..a34ee08eee 100644 --- a/auth/api/iam/session_test.go +++ b/auth/api/iam/session_test.go @@ -19,7 +19,7 @@ package iam import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/pe" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/auth/client/iam/client.go b/auth/client/iam/client.go index 0020fea550..2a3c10c0de 100644 --- a/auth/client/iam/client.go +++ b/auth/client/iam/client.go @@ -21,12 +21,12 @@ package iam import ( "bytes" "context" - "encoding/json" "errors" "fmt" "github.com/lestrrat-go/jwx/v2/jws" "github.com/lestrrat-go/jwx/v2/jwt" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "io" "net/http" diff --git a/auth/client/iam/client_test.go b/auth/client/iam/client_test.go index a63a616741..de91b7f247 100644 --- a/auth/client/iam/client_test.go +++ b/auth/client/iam/client_test.go @@ -22,13 +22,13 @@ import ( "context" "crypto" "crypto/ecdsa" - "encoding/json" "github.com/google/uuid" "github.com/lestrrat-go/jwx/v2/jws" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/audit" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" test2 "github.com/nuts-foundation/nuts-node/crypto/test" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "net/http" "net/http/httptest" @@ -193,7 +193,7 @@ func TestHTTPClient_AccessToken(t *testing.T) { _, err := client.AccessToken(ctx, tlsServer.URL, data, dpopHeader) require.Error(t, err) - assert.EqualError(t, err, "unable to unmarshal response: invalid character '}' looking for beginning of value, }") + assert.EqualError(t, err, "unable to unmarshal response: sonnet: invalid character '}' looking for beginning of value, }") }) } diff --git a/auth/client/iam/openid4vp.go b/auth/client/iam/openid4vp.go index 0f9e370601..498c7d1d52 100644 --- a/auth/client/iam/openid4vp.go +++ b/auth/client/iam/openid4vp.go @@ -21,10 +21,10 @@ package iam import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vdr/didsubject" "github.com/piprate/json-gold/ld" diff --git a/auth/client/iam/openid4vp_test.go b/auth/client/iam/openid4vp_test.go index d1a13b3e51..0746402f19 100644 --- a/auth/client/iam/openid4vp_test.go +++ b/auth/client/iam/openid4vp_test.go @@ -21,10 +21,10 @@ package iam import ( "context" "crypto/tls" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" test2 "github.com/nuts-foundation/nuts-node/test" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vdr/didsubject" @@ -393,7 +393,7 @@ func TestRelyingParty_RequestRFC021AccessToken(t *testing.T) { require.Error(t, err) assert.ErrorIs(t, err, ErrBadGateway) - assert.ErrorContains(t, err, "unable to unmarshal response: unexpected end of JSON input") + assert.ErrorContains(t, err, "unable to unmarshal response: sonnet: unexpected EOF reading a byte") }) t.Run("error - failed to build vp", func(t *testing.T) { ctx := createClientServerTestContext(t) diff --git a/auth/oauth/error.go b/auth/oauth/error.go index 6269d86546..38678906b9 100644 --- a/auth/oauth/error.go +++ b/auth/oauth/error.go @@ -20,8 +20,8 @@ package oauth import ( "bytes" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "html/template" "net/http" "net/url" diff --git a/auth/oauth/types.go b/auth/oauth/types.go index c0a6d769d2..c0be1a59d0 100644 --- a/auth/oauth/types.go +++ b/auth/oauth/types.go @@ -20,9 +20,9 @@ package oauth import ( - "encoding/json" "github.com/lestrrat-go/jwx/v2/jwk" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "net/url" ) diff --git a/auth/oauth/types_test.go b/auth/oauth/types_test.go index e0932a7991..cbb00beb8c 100644 --- a/auth/oauth/types_test.go +++ b/auth/oauth/types_test.go @@ -19,8 +19,8 @@ package oauth import ( - "encoding/json" "github.com/nuts-foundation/nuts-node/core/to" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" diff --git a/auth/services/dummy/dummy.go b/auth/services/dummy/dummy.go index ecfd0585eb..ec61e8e48e 100644 --- a/auth/services/dummy/dummy.go +++ b/auth/services/dummy/dummy.go @@ -22,9 +22,9 @@ import ( "context" "crypto/rand" "encoding/hex" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "time" ssi "github.com/nuts-foundation/go-did" diff --git a/auth/services/irma/irmacontract.go b/auth/services/irma/irmacontract.go index 0f2326a061..a2e31b3a48 100644 --- a/auth/services/irma/irmacontract.go +++ b/auth/services/irma/irmacontract.go @@ -20,9 +20,9 @@ package irma import ( "encoding/base64" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "strings" "time" diff --git a/auth/services/irma/signer.go b/auth/services/irma/signer.go index 936b73c75e..3c88457daa 100644 --- a/auth/services/irma/signer.go +++ b/auth/services/irma/signer.go @@ -21,11 +21,11 @@ package irma import ( "context" "encoding/base64" - "encoding/json" "fmt" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/sirupsen/logrus" "net/http" "os" diff --git a/auth/services/messages.go b/auth/services/messages.go index e6d9858219..b6f5d54051 100644 --- a/auth/services/messages.go +++ b/auth/services/messages.go @@ -19,7 +19,7 @@ package services import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/go-did/vc" irma "github.com/privacybydesign/irmago" diff --git a/auth/services/messages_test.go b/auth/services/messages_test.go index 2f4aeeebda..0dfe25028c 100644 --- a/auth/services/messages_test.go +++ b/auth/services/messages_test.go @@ -19,7 +19,7 @@ package services import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" diff --git a/auth/services/notary/notary_test.go b/auth/services/notary/notary_test.go index 7488221234..00d899b8e5 100644 --- a/auth/services/notary/notary_test.go +++ b/auth/services/notary/notary_test.go @@ -20,8 +20,8 @@ package notary import ( "context" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "testing" "time" diff --git a/auth/services/oauth/authz_server.go b/auth/services/oauth/authz_server.go index 4aa6426d44..22583f82e6 100644 --- a/auth/services/oauth/authz_server.go +++ b/auth/services/oauth/authz_server.go @@ -21,9 +21,9 @@ package oauth import ( "context" "crypto" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "time" "github.com/lestrrat-go/jwx/v2/jwt" diff --git a/auth/services/oauth/authz_server_test.go b/auth/services/oauth/authz_server_test.go index bb0cbc0771..e2ea60a924 100644 --- a/auth/services/oauth/authz_server_test.go +++ b/auth/services/oauth/authz_server_test.go @@ -24,10 +24,10 @@ import ( "crypto/elliptic" "crypto/rand" "crypto/rsa" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "testing" "time" diff --git a/auth/services/selfsigned/signer.go b/auth/services/selfsigned/signer.go index 07fcdb0ffa..f4552b0cd2 100644 --- a/auth/services/selfsigned/signer.go +++ b/auth/services/selfsigned/signer.go @@ -22,7 +22,6 @@ import ( "context" "crypto/rand" "encoding/hex" - "encoding/json" "fmt" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/types" "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/web" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/holder" diff --git a/auth/services/selfsigned/signer_test.go b/auth/services/selfsigned/signer_test.go index a51fed7fac..b3186fd0bb 100644 --- a/auth/services/selfsigned/signer_test.go +++ b/auth/services/selfsigned/signer_test.go @@ -20,7 +20,6 @@ package selfsigned import ( "context" - "encoding/json" "errors" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" @@ -28,6 +27,7 @@ import ( "github.com/nuts-foundation/nuts-node/auth/contract" "github.com/nuts-foundation/nuts-node/auth/services" "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/types" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/holder" "github.com/nuts-foundation/nuts-node/vcr/issuer" diff --git a/auth/services/selfsigned/test/generate_test.go b/auth/services/selfsigned/test/generate_test.go index e0bc5e9fe9..f8615cc39c 100644 --- a/auth/services/selfsigned/test/generate_test.go +++ b/auth/services/selfsigned/test/generate_test.go @@ -20,10 +20,10 @@ package test import ( "context" - "encoding/json" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/crypto/util" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vcr/signature" diff --git a/auth/services/selfsigned/types.go b/auth/services/selfsigned/types.go index 74647a1ab9..1bd0777aab 100644 --- a/auth/services/selfsigned/types.go +++ b/auth/services/selfsigned/types.go @@ -19,9 +19,9 @@ package selfsigned import ( - "encoding/json" "errors" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" ) // ContractFormat is the contract format type diff --git a/auth/services/selfsigned/types/types.go b/auth/services/selfsigned/types/types.go index 6c6e32b265..3c57a359b4 100644 --- a/auth/services/selfsigned/types/types.go +++ b/auth/services/selfsigned/types/types.go @@ -20,7 +20,7 @@ package types import ( "context" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential" "strings" "time" diff --git a/auth/services/selfsigned/validator.go b/auth/services/selfsigned/validator.go index 0ec3166863..d1fa8f672f 100644 --- a/auth/services/selfsigned/validator.go +++ b/auth/services/selfsigned/validator.go @@ -20,7 +20,6 @@ package selfsigned import ( "context" - "encoding/json" "errors" "fmt" ssi "github.com/nuts-foundation/go-did" @@ -28,6 +27,7 @@ import ( "github.com/nuts-foundation/nuts-node/auth/contract" "github.com/nuts-foundation/nuts-node/auth/services" "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/types" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/verifier" diff --git a/auth/services/selfsigned/validator_test.go b/auth/services/selfsigned/validator_test.go index a5182e8e05..1ab638e0d3 100644 --- a/auth/services/selfsigned/validator_test.go +++ b/auth/services/selfsigned/validator_test.go @@ -20,13 +20,13 @@ package selfsigned import ( "context" - "encoding/json" "errors" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/auth/services" "github.com/nuts-foundation/nuts-node/auth/services/selfsigned/types" "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/crypto/util" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/issuer" diff --git a/auth/services/types.go b/auth/services/types.go index e0d30dac97..3a49583559 100644 --- a/auth/services/types.go +++ b/auth/services/types.go @@ -19,9 +19,9 @@ package services import ( - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" ) const ( diff --git a/core/time_test.go b/core/time_test.go index 0b71358313..875b4ae823 100644 --- a/core/time_test.go +++ b/core/time_test.go @@ -17,7 +17,7 @@ package core import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" "time" diff --git a/crypto/api/v1/api_test.go b/crypto/api/v1/api_test.go index a2b421009e..494e2f5031 100644 --- a/crypto/api/v1/api_test.go +++ b/crypto/api/v1/api_test.go @@ -19,10 +19,10 @@ package v1 import ( - "encoding/json" "errors" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "net/http" "testing" diff --git a/crypto/hash/sha256.go b/crypto/hash/sha256.go index 6749a8a4f6..0f3bb24d4b 100644 --- a/crypto/hash/sha256.go +++ b/crypto/hash/sha256.go @@ -20,8 +20,8 @@ import ( "bytes" "crypto/sha256" "encoding/hex" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" ) // SHA256HashSize holds the size of a sha256 hash in bytes. diff --git a/crypto/hash/sha256_test.go b/crypto/hash/sha256_test.go index 17396cb953..2c3b4fa1aa 100644 --- a/crypto/hash/sha256_test.go +++ b/crypto/hash/sha256_test.go @@ -20,8 +20,8 @@ package hash import ( "encoding" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" diff --git a/crypto/jwx.go b/crypto/jwx.go index e9bd81fcd1..7226ff3cab 100644 --- a/crypto/jwx.go +++ b/crypto/jwx.go @@ -24,9 +24,9 @@ import ( "crypto/ecdsa" "crypto/ed25519" "crypto/rsa" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "maps" "github.com/lestrrat-go/jwx/v2/jwa" diff --git a/crypto/jwx_test.go b/crypto/jwx_test.go index b42e45a5dc..73ffc3fe88 100644 --- a/crypto/jwx_test.go +++ b/crypto/jwx_test.go @@ -26,11 +26,11 @@ import ( "crypto/elliptic" "crypto/rand" "crypto/rsa" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/crypto/jwx" "github.com/nuts-foundation/nuts-node/crypto/storage/spi" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "go.uber.org/mock/gomock" "io" diff --git a/crypto/storage/azure/keyvault.go b/crypto/storage/azure/keyvault.go index 7b0e233c49..d62d4b5962 100644 --- a/crypto/storage/azure/keyvault.go +++ b/crypto/storage/azure/keyvault.go @@ -21,9 +21,9 @@ package azure import ( "context" "crypto" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "os" diff --git a/crypto/storage/azure/keyvault_test.go b/crypto/storage/azure/keyvault_test.go index 37faf224b7..51b5af9ac1 100644 --- a/crypto/storage/azure/keyvault_test.go +++ b/crypto/storage/azure/keyvault_test.go @@ -25,9 +25,9 @@ import ( "crypto/rsa" "crypto/sha256" "encoding/base64" - "encoding/json" "errors" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/nuts-foundation/nuts-node/json" "net/http" "os" "testing" diff --git a/crypto/storage/external/client_test.go b/crypto/storage/external/client_test.go index 0e0a255151..86d1f33f95 100644 --- a/crypto/storage/external/client_test.go +++ b/crypto/storage/external/client_test.go @@ -23,8 +23,8 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "net/http/httptest" diff --git a/crypto/storage/spi/interface.go b/crypto/storage/spi/interface.go index 0652c96eee..6b18ac715d 100644 --- a/crypto/storage/spi/interface.go +++ b/crypto/storage/spi/interface.go @@ -24,9 +24,9 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "regexp" "github.com/lestrrat-go/jwx/v2/jwk" diff --git a/crypto/storage/spi/interface_test.go b/crypto/storage/spi/interface_test.go index 7747afd91c..498d348314 100644 --- a/crypto/storage/spi/interface_test.go +++ b/crypto/storage/spi/interface_test.go @@ -33,7 +33,7 @@ import ( func TestPublicKeyEntry_UnmarshalJSON(t *testing.T) { t.Run("error - incorrect json", func(t *testing.T) { err := (&PublicKeyEntry{}).UnmarshalJSON([]byte("}")) - assert.EqualError(t, err, "invalid character '}' looking for beginning of value") + assert.EqualError(t, err, "sonnet: invalid character '}' looking for beginning of value") }) t.Run("error - invalid publicKeyJwk format", func(t *testing.T) { diff --git a/didman/cmd/cmd.go b/didman/cmd/cmd.go index b5ec61fae1..6a68b56f6f 100644 --- a/didman/cmd/cmd.go +++ b/didman/cmd/cmd.go @@ -19,10 +19,10 @@ package cmd import ( - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/didman/api/v1" + "github.com/nuts-foundation/nuts-node/json" "github.com/spf13/cobra" ) diff --git a/didman/cmd/cmd_test.go b/didman/cmd/cmd_test.go index af57b5d00a..e6978de3b4 100644 --- a/didman/cmd/cmd_test.go +++ b/didman/cmd/cmd_test.go @@ -19,10 +19,10 @@ package cmd import ( - "encoding/json" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core" v1 "github.com/nuts-foundation/nuts-node/didman/api/v1" + "github.com/nuts-foundation/nuts-node/json" http2 "github.com/nuts-foundation/nuts-node/test/http" "github.com/stretchr/testify/assert" "net/http" diff --git a/didman/didman.go b/didman/didman.go index 825f98610f..cf082def67 100644 --- a/didman/didman.go +++ b/didman/didman.go @@ -22,10 +22,10 @@ package didman import ( "context" "crypto/sha256" - "encoding/json" "errors" "fmt" "github.com/mr-tron/base58" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr" "github.com/nuts-foundation/nuts-node/vdr/resolver" "net/url" diff --git a/didman/didman_test.go b/didman/didman_test.go index 892cc95e7d..5b159f869f 100644 --- a/didman/didman_test.go +++ b/didman/didman_test.go @@ -21,10 +21,10 @@ package didman import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/didnuts" "github.com/nuts-foundation/nuts-node/vdr/didsubject" "github.com/nuts-foundation/nuts-node/vdr/resolver" diff --git a/discovery/api/server/client/http.go b/discovery/api/server/client/http.go index b819be4c92..c2e7a19faa 100644 --- a/discovery/api/server/client/http.go +++ b/discovery/api/server/client/http.go @@ -21,12 +21,12 @@ package client import ( "bytes" "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/discovery/log" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "net/url" diff --git a/discovery/definition.go b/discovery/definition.go index e032ae696e..457c65b82f 100644 --- a/discovery/definition.go +++ b/discovery/definition.go @@ -21,7 +21,7 @@ package discovery import ( "bytes" "embed" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/pe" v2 "github.com/nuts-foundation/nuts-node/vcr/pe/schema/v2" "github.com/santhosh-tekuri/jsonschema" diff --git a/discovery/module_test.go b/discovery/module_test.go index 56a0a031cb..c4ffce45f1 100644 --- a/discovery/module_test.go +++ b/discovery/module_test.go @@ -20,13 +20,13 @@ package discovery import ( "context" - "encoding/json" "errors" "github.com/lestrrat-go/jwx/v2/jwt" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/discovery/api/server/client" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/test" "github.com/nuts-foundation/nuts-node/vcr" diff --git a/discovery/store.go b/discovery/store.go index 5dfba82986..d46e6e29a9 100644 --- a/discovery/store.go +++ b/discovery/store.go @@ -20,10 +20,10 @@ package discovery import ( "database/sql/driver" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential/store" "slices" "strconv" diff --git a/discovery/test.go b/discovery/test.go index 9000bb497a..6ea261742d 100644 --- a/discovery/test.go +++ b/discovery/test.go @@ -23,7 +23,6 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "fmt" "github.com/google/uuid" "github.com/lestrrat-go/jwx/v2/jwa" @@ -34,6 +33,7 @@ import ( "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core/to" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/test" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/pe" diff --git a/e2e-tests/migration/main_test.go b/e2e-tests/migration/main_test.go index 2875d63ddb..89dcab60c5 100644 --- a/e2e-tests/migration/main_test.go +++ b/e2e-tests/migration/main_test.go @@ -21,8 +21,8 @@ package migration import ( - "encoding/json" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vdr/didsubject" diff --git a/echo/echo_integration_test.go b/echo/echo_integration_test.go index 265e01a822..96d267da23 100644 --- a/echo/echo_integration_test.go +++ b/echo/echo_integration_test.go @@ -21,8 +21,8 @@ package echo import ( "bytes" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net/http" "strings" "testing" diff --git a/events/types.go b/events/types.go index 1f4554097f..2ff2526701 100644 --- a/events/types.go +++ b/events/types.go @@ -21,7 +21,7 @@ package events import ( "encoding/base64" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network/dag" ) diff --git a/events/types_test.go b/events/types_test.go index 6bcc01adc2..0f0959b58b 100644 --- a/events/types_test.go +++ b/events/types_test.go @@ -20,7 +20,7 @@ package events import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" diff --git a/go.mod b/go.mod index 0ae27c9188..7bd86e7d06 100644 --- a/go.mod +++ b/go.mod @@ -216,6 +216,7 @@ require ( github.com/google/go-tpm v0.9.3 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/rs/zerolog v1.26.1 // indirect + github.com/sugawarayuuta/sonnet v0.0.0-20231004000330-239c7b6e4ce8 // indirect golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect modernc.org/libc v1.61.13 // indirect ) diff --git a/go.sum b/go.sum index 6d451456f8..251357eb22 100644 --- a/go.sum +++ b/go.sum @@ -472,6 +472,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203 h1:QVqDTf3h2WHt08YuiTGPZLls0Wq99X9bWd0Q5ZSBesM= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= +github.com/sugawarayuuta/sonnet v0.0.0-20231004000330-239c7b6e4ce8 h1:u+kxnRXxx+0O5SiefP3oTt4jeeIx+rYf1jkdW2qd2Ss= +github.com/sugawarayuuta/sonnet v0.0.0-20231004000330-239c7b6e4ce8/go.mod h1:6M53rd6DvbzoLbFnL3bjCsDSkCYh4i2yqW04hxr1/5o= github.com/templexxx/cpu v0.0.1/go.mod h1:w7Tb+7qgcAlIyX4NhLuDKt78AHA5SzPmq0Wj6HiEnnk= github.com/templexxx/cpu v0.0.9 h1:cGGLK8twbc1J1S/fHnZW7BylXYaFP+0fR2s+nzsFDiU= github.com/templexxx/cpu v0.0.9/go.mod h1:w7Tb+7qgcAlIyX4NhLuDKt78AHA5SzPmq0Wj6HiEnnk= diff --git a/http/tokenV2/middleware_test.go b/http/tokenV2/middleware_test.go index a2316272e3..b044c75750 100644 --- a/http/tokenV2/middleware_test.go +++ b/http/tokenV2/middleware_test.go @@ -25,10 +25,10 @@ import ( "crypto/rand" "crypto/rsa" b64 "encoding/base64" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/http/httptest" "testing" diff --git a/http/user/session.go b/http/user/session.go index 41dce47aac..c4699cda81 100644 --- a/http/user/session.go +++ b/http/user/session.go @@ -21,7 +21,6 @@ package user import ( "context" "encoding/base64" - "encoding/json" "errors" "fmt" "github.com/labstack/echo/v4" @@ -31,6 +30,7 @@ import ( "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/log" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "net/http" "time" diff --git a/http/user/session_test.go b/http/user/session_test.go index 871448cb40..5fc0fff4cd 100644 --- a/http/user/session_test.go +++ b/http/user/session_test.go @@ -22,11 +22,11 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "github.com/labstack/echo/v4" "github.com/lestrrat-go/jwx/v2/jwk" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/json/json.go b/json/json.go new file mode 100644 index 0000000000..8c7fae0d58 --- /dev/null +++ b/json/json.go @@ -0,0 +1,21 @@ +package json + +import "github.com/sugawarayuuta/sonnet" + +type Unmarshaler = sonnet.Unmarshaler + +type Marshaler = sonnet.Marshaler + +var NewEncoder = sonnet.NewEncoder +var NewDecoder = sonnet.NewDecoder +var MarshalIndent = sonnet.MarshalIndent + +type RawMessage = sonnet.RawMessage + +func Unmarshal(data []byte, v interface{}) error { + return sonnet.Unmarshal(data, v) +} + +func Marshal(v interface{}) ([]byte, error) { + return sonnet.Marshal(v) +} diff --git a/jsonld/document_test.go b/jsonld/document_test.go index 74faca5456..7cc4692ac6 100644 --- a/jsonld/document_test.go +++ b/jsonld/document_test.go @@ -20,7 +20,7 @@ package jsonld import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "testing" "github.com/piprate/json-gold/ld" diff --git a/jsonld/jsonld_test.go b/jsonld/jsonld_test.go index 1b7b1d0215..f06af42b47 100644 --- a/jsonld/jsonld_test.go +++ b/jsonld/jsonld_test.go @@ -19,7 +19,7 @@ package jsonld import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "testing" "github.com/nuts-foundation/nuts-node/core" diff --git a/jsonld/ldutils.go b/jsonld/ldutils.go index 34100e3f1e..cace064d3d 100644 --- a/jsonld/ldutils.go +++ b/jsonld/ldutils.go @@ -20,10 +20,10 @@ package jsonld import ( "embed" - "encoding/json" "errors" "fmt" ssi "github.com/nuts-foundation/go-did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld/log" "github.com/nuts-foundation/nuts-node/vcr/assets" "github.com/piprate/json-gold/ld" diff --git a/jsonld/reader.go b/jsonld/reader.go index e1e7c088cc..fd61d37a5b 100644 --- a/jsonld/reader.go +++ b/jsonld/reader.go @@ -20,7 +20,7 @@ package jsonld import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/piprate/json-gold/ld" ) diff --git a/jsonld/reader_test.go b/jsonld/reader_test.go index a2b02b70df..f9e66fca56 100644 --- a/jsonld/reader_test.go +++ b/jsonld/reader_test.go @@ -20,7 +20,7 @@ package jsonld import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" diff --git a/jsonld/test.go b/jsonld/test.go index db13040365..08f4d98b7f 100644 --- a/jsonld/test.go +++ b/jsonld/test.go @@ -20,7 +20,7 @@ package jsonld import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "testing" "github.com/nuts-foundation/nuts-node/vcr/assets" diff --git a/jsonld/testsuite/compat_test.go b/jsonld/testsuite/compat_test.go index e8735f76c2..f005e9eae5 100644 --- a/jsonld/testsuite/compat_test.go +++ b/jsonld/testsuite/compat_test.go @@ -20,10 +20,10 @@ package testsuite import ( "crypto/x509" - "encoding/json" "encoding/pem" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vcr/signature" diff --git a/network/api/v1/client.go b/network/api/v1/client.go index a1d06a172a..bab5cac277 100644 --- a/network/api/v1/client.go +++ b/network/api/v1/client.go @@ -20,7 +20,7 @@ package v1 import ( "context" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network/transport" "io" "net/http" diff --git a/network/api/v1/client_test.go b/network/api/v1/client_test.go index f9a36e9184..31d43f6838 100644 --- a/network/api/v1/client_test.go +++ b/network/api/v1/client_test.go @@ -19,8 +19,8 @@ package v1 import ( - "encoding/json" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "net/http" "net/http/httptest" diff --git a/network/api/v1/types.go b/network/api/v1/types.go index 4fdad1c3be..a3dfcfb5a5 100644 --- a/network/api/v1/types.go +++ b/network/api/v1/types.go @@ -19,7 +19,7 @@ package v1 import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network/transport" "time" ) diff --git a/network/api/v1/types_test.go b/network/api/v1/types_test.go index c380fe91a2..7f0f80d76f 100644 --- a/network/api/v1/types_test.go +++ b/network/api/v1/types_test.go @@ -19,7 +19,7 @@ package v1 import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "testing" "time" diff --git a/network/dag/notifier.go b/network/dag/notifier.go index 15ea29f6da..dcdf401c8f 100644 --- a/network/dag/notifier.go +++ b/network/dag/notifier.go @@ -20,9 +20,9 @@ package dag import ( "context" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "strings" "time" diff --git a/network/dag/notifier_test.go b/network/dag/notifier_test.go index fe20363dca..ad44b642ba 100644 --- a/network/dag/notifier_test.go +++ b/network/dag/notifier_test.go @@ -21,10 +21,10 @@ package dag import ( "context" - "encoding/json" "errors" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/test" diff --git a/network/dag/transaction.go b/network/dag/transaction.go index 39cdeaf0d1..c73e9bae3c 100644 --- a/network/dag/transaction.go +++ b/network/dag/transaction.go @@ -20,8 +20,8 @@ package dag import ( - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "strings" "time" diff --git a/network/dag/transaction_test.go b/network/dag/transaction_test.go index 94913a7025..9b58066640 100644 --- a/network/dag/transaction_test.go +++ b/network/dag/transaction_test.go @@ -23,7 +23,7 @@ import ( "crypto/elliptic" "crypto/rand" "crypto/rsa" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "testing" "time" diff --git a/network/network.go b/network/network.go index 12718c4e11..55124012b3 100644 --- a/network/network.go +++ b/network/network.go @@ -22,9 +22,9 @@ import ( "context" "crypto/tls" "crypto/x509" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net" "slices" "strings" diff --git a/network/network_integration_test.go b/network/network_integration_test.go index e1d18e557c..9f49345493 100644 --- a/network/network_integration_test.go +++ b/network/network_integration_test.go @@ -21,9 +21,9 @@ package network import ( "context" "crypto" - "encoding/json" "fmt" "github.com/google/uuid" + "github.com/nuts-foundation/nuts-node/json" testPKI "github.com/nuts-foundation/nuts-node/test/pki" "github.com/nuts-foundation/nuts-node/vdr/didnuts/didstore" "github.com/nuts-foundation/nuts-node/vdr/resolver" diff --git a/network/transport/types.go b/network/transport/types.go index 6ea2c7c48c..493b51d87a 100644 --- a/network/transport/types.go +++ b/network/transport/types.go @@ -21,10 +21,10 @@ package transport import ( "bytes" "crypto/x509" - "encoding/json" "encoding/pem" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net/url" "time" diff --git a/pki/denylist.go b/pki/denylist.go index e1a3039fb1..a913df9050 100644 --- a/pki/denylist.go +++ b/pki/denylist.go @@ -21,8 +21,8 @@ package pki import ( "crypto/x509" - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "strings" diff --git a/pki/denylist_test.go b/pki/denylist_test.go index 2b6e9bea27..d84a11a7f9 100644 --- a/pki/denylist_test.go +++ b/pki/denylist_test.go @@ -21,9 +21,9 @@ package pki import ( "crypto/x509" - "encoding/json" "encoding/pem" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/http/httptest" "testing" diff --git a/policy/local.go b/policy/local.go index 81719eb7d8..98067cadb6 100644 --- a/policy/local.go +++ b/policy/local.go @@ -20,9 +20,9 @@ package policy import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/pe" v2 "github.com/nuts-foundation/nuts-node/vcr/pe/schema/v2" "io" diff --git a/storage/leia_test.go b/storage/leia_test.go index c79b308758..7250549abf 100644 --- a/storage/leia_test.go +++ b/storage/leia_test.go @@ -21,12 +21,12 @@ package storage import ( "context" "crypto/sha1" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/bbolt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/test/io" "github.com/stretchr/testify/assert" diff --git a/storage/orm/did_document.go b/storage/orm/did_document.go index d0def02736..631fb47642 100644 --- a/storage/orm/did_document.go +++ b/storage/orm/did_document.go @@ -19,7 +19,7 @@ package orm import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "time" "github.com/google/uuid" diff --git a/storage/orm/did_document_test.go b/storage/orm/did_document_test.go index 93a9a06f55..90d1a84beb 100644 --- a/storage/orm/did_document_test.go +++ b/storage/orm/did_document_test.go @@ -19,8 +19,8 @@ package orm import ( - "encoding/json" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" diff --git a/storage/session.go b/storage/session.go index bfbfffbae9..e3ccc1853c 100644 --- a/storage/session.go +++ b/storage/session.go @@ -20,8 +20,8 @@ package storage import ( "context" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "time" "github.com/bradfitz/gomemcache/memcache" diff --git a/storage/session_redis_test.go b/storage/session_redis_test.go index a78b0bbc80..25aaa11997 100644 --- a/storage/session_redis_test.go +++ b/storage/session_redis_test.go @@ -19,8 +19,8 @@ package storage import ( - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "testing" "time" diff --git a/test/http/api.go b/test/http/api.go index 38082540a4..814b51a90a 100644 --- a/test/http/api.go +++ b/test/http/api.go @@ -19,7 +19,7 @@ package http import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/http/httptest" "testing" diff --git a/test/http/handler.go b/test/http/handler.go index 0958d028de..a922da7ec0 100644 --- a/test/http/handler.go +++ b/test/http/handler.go @@ -17,7 +17,7 @@ package http import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "net/url" diff --git a/vcr/ambassador.go b/vcr/ambassador.go index 63dd274816..be71f523f3 100644 --- a/vcr/ambassador.go +++ b/vcr/ambassador.go @@ -21,13 +21,13 @@ package vcr import ( "context" - "encoding/json" "errors" "fmt" "github.com/nats-io/nats.go" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/events" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/network/dag" diff --git a/vcr/ambassador_test.go b/vcr/ambassador_test.go index a70038ba45..14d07b97d1 100644 --- a/vcr/ambassador_test.go +++ b/vcr/ambassador_test.go @@ -22,8 +22,8 @@ package vcr import ( "context" "crypto" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "net/http" "os" "testing" @@ -331,7 +331,7 @@ func Test_ambassador_handleNetworkRevocations(t *testing.T) { Payload: []byte("b00m"), }) assert.False(t, value) - assert.EqualError(t, err, "revocation processing failed: invalid character 'b' looking for beginning of value") + assert.EqualError(t, err, "revocation processing failed: sonnet: invalid character 'b' looking for beginning of value") assert.True(t, errors.As(err, new(dag.EventFatal))) }) diff --git a/vcr/api/openid4vci/v0/holder.go b/vcr/api/openid4vci/v0/holder.go index 4dfeeb85d2..64fd7d63fe 100644 --- a/vcr/api/openid4vci/v0/holder.go +++ b/vcr/api/openid4vci/v0/holder.go @@ -20,8 +20,8 @@ package v0 import ( "context" - "encoding/json" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/holder" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" ) diff --git a/vcr/api/openid4vci/v0/holder_test.go b/vcr/api/openid4vci/v0/holder_test.go index 1601839982..6b179e4dcc 100644 --- a/vcr/api/openid4vci/v0/holder_test.go +++ b/vcr/api/openid4vci/v0/holder_test.go @@ -20,10 +20,10 @@ package v0 import ( "context" - "encoding/json" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/holder" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" diff --git a/vcr/api/openid4vci/v0/issuer.go b/vcr/api/openid4vci/v0/issuer.go index 19d5325a0c..5cb28fa4f3 100644 --- a/vcr/api/openid4vci/v0/issuer.go +++ b/vcr/api/openid4vci/v0/issuer.go @@ -20,11 +20,11 @@ package v0 import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/oauth" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/issuer" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" "net/http" diff --git a/vcr/api/vcr/v2/api.go b/vcr/api/vcr/v2/api.go index e9f2763da4..20e2f45cd0 100644 --- a/vcr/api/vcr/v2/api.go +++ b/vcr/api/vcr/v2/api.go @@ -20,9 +20,9 @@ package v2 import ( "context" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "net/http" "strings" "time" diff --git a/vcr/api/vcr/v2/api_test.go b/vcr/api/vcr/v2/api_test.go index 6c6ae24d55..7f7eaaa2f9 100644 --- a/vcr/api/vcr/v2/api_test.go +++ b/vcr/api/vcr/v2/api_test.go @@ -20,9 +20,9 @@ package v2 import ( "context" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/types" "net/http" "testing" diff --git a/vcr/api/vcr/v2/client.go b/vcr/api/vcr/v2/client.go index cbf3b208e3..4870c32e02 100644 --- a/vcr/api/vcr/v2/client.go +++ b/vcr/api/vcr/v2/client.go @@ -21,10 +21,10 @@ package v2 import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" ) diff --git a/vcr/api/vcr/v2/registry.go b/vcr/api/vcr/v2/registry.go index 65d09fd5fa..d11b1cfb88 100644 --- a/vcr/api/vcr/v2/registry.go +++ b/vcr/api/vcr/v2/registry.go @@ -20,7 +20,7 @@ package v2 import ( "context" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/log" "github.com/sirupsen/logrus" "sort" diff --git a/vcr/api/vcr/v2/registry_test.go b/vcr/api/vcr/v2/registry_test.go index f8ff5e834a..c9d37bc814 100644 --- a/vcr/api/vcr/v2/registry_test.go +++ b/vcr/api/vcr/v2/registry_test.go @@ -19,10 +19,10 @@ package v2 import ( - "encoding/json" "errors" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/test" diff --git a/vcr/api/vcr/v2/types.go b/vcr/api/vcr/v2/types.go index 6b13a861ce..2127a88292 100644 --- a/vcr/api/vcr/v2/types.go +++ b/vcr/api/vcr/v2/types.go @@ -20,8 +20,8 @@ package v2 import ( - "encoding/json" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential" ) diff --git a/vcr/api/vcr/v2/types_test.go b/vcr/api/vcr/v2/types_test.go index 3d68c3f15f..801c9483d4 100644 --- a/vcr/api/vcr/v2/types_test.go +++ b/vcr/api/vcr/v2/types_test.go @@ -19,7 +19,7 @@ package v2 import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" diff --git a/vcr/cmd/cmd.go b/vcr/cmd/cmd.go index 01db27af37..da7278e0fe 100644 --- a/vcr/cmd/cmd.go +++ b/vcr/cmd/cmd.go @@ -19,8 +19,8 @@ package cmd import ( - "encoding/json" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/spf13/pflag" diff --git a/vcr/cmd/cmd_test.go b/vcr/cmd/cmd_test.go index 347d22ad88..e4cd1ed808 100644 --- a/vcr/cmd/cmd_test.go +++ b/vcr/cmd/cmd_test.go @@ -21,9 +21,9 @@ package cmd import ( "bytes" - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" v2 "github.com/nuts-foundation/nuts-node/vcr/api/vcr/v2" "github.com/stretchr/testify/require" "net/http" diff --git a/vcr/credential/revocation_test.go b/vcr/credential/revocation_test.go index 0ce0ec435f..2a0e15ed6f 100644 --- a/vcr/credential/revocation_test.go +++ b/vcr/credential/revocation_test.go @@ -20,7 +20,7 @@ package credential import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "os" "testing" "time" diff --git a/vcr/credential/store/sql.go b/vcr/credential/store/sql.go index a23181c3e9..b30eecfd26 100644 --- a/vcr/credential/store/sql.go +++ b/vcr/credential/store/sql.go @@ -19,9 +19,9 @@ package store import ( - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "gorm.io/gorm" "strconv" "strings" diff --git a/vcr/credential/store/sql_test.go b/vcr/credential/store/sql_test.go index 852cf1f2f4..2bc49e0265 100644 --- a/vcr/credential/store/sql_test.go +++ b/vcr/credential/store/sql_test.go @@ -19,9 +19,9 @@ package store import ( - "encoding/json" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/sirupsen/logrus" diff --git a/vcr/credential/types_test.go b/vcr/credential/types_test.go index 2c7144caa4..bebb41a73d 100644 --- a/vcr/credential/types_test.go +++ b/vcr/credential/types_test.go @@ -19,7 +19,7 @@ package credential import ( - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "testing" "github.com/stretchr/testify/assert" diff --git a/vcr/credential/validator.go b/vcr/credential/validator.go index eb468b1b93..bdb7d67eb6 100644 --- a/vcr/credential/validator.go +++ b/vcr/credential/validator.go @@ -22,13 +22,13 @@ package credential import ( "crypto/x509" "encoding/base64" - "encoding/json" "errors" "fmt" "github.com/lestrrat-go/jwx/v2/jwk" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vcr/revocation" "github.com/nuts-foundation/nuts-node/vdr/didx509" diff --git a/vcr/holder/presenter.go b/vcr/holder/presenter.go index 182f434d41..a0b78cb18e 100644 --- a/vcr/holder/presenter.go +++ b/vcr/holder/presenter.go @@ -20,7 +20,6 @@ package holder import ( "context" - "encoding/json" "errors" "fmt" "github.com/google/uuid" @@ -31,6 +30,7 @@ import ( "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/oauth" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/pe" "github.com/nuts-foundation/nuts-node/vcr/signature" diff --git a/vcr/holder/sql_wallet_test.go b/vcr/holder/sql_wallet_test.go index 18921129e0..fac68ad6c6 100644 --- a/vcr/holder/sql_wallet_test.go +++ b/vcr/holder/sql_wallet_test.go @@ -20,10 +20,10 @@ package holder import ( "context" - "encoding/json" "github.com/google/uuid" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/types" diff --git a/vcr/issuer/issuer.go b/vcr/issuer/issuer.go index 73967320e2..7519553917 100644 --- a/vcr/issuer/issuer.go +++ b/vcr/issuer/issuer.go @@ -20,10 +20,10 @@ package issuer import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-stoabs" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" "github.com/nuts-foundation/nuts-node/vcr/revocation" "github.com/nuts-foundation/nuts-node/vdr/didnuts" diff --git a/vcr/issuer/issuer_test.go b/vcr/issuer/issuer_test.go index a2306a4813..86151cc835 100644 --- a/vcr/issuer/issuer_test.go +++ b/vcr/issuer/issuer_test.go @@ -21,9 +21,9 @@ package issuer import ( "context" "crypto" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "gorm.io/gorm" "path" "testing" diff --git a/vcr/issuer/leia_store.go b/vcr/issuer/leia_store.go index d663ac1b0e..d0b6432936 100644 --- a/vcr/issuer/leia_store.go +++ b/vcr/issuer/leia_store.go @@ -20,11 +20,11 @@ package issuer import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/log" "github.com/nuts-foundation/nuts-node/vcr/types" diff --git a/vcr/issuer/leia_store_test.go b/vcr/issuer/leia_store_test.go index d12a8b6ace..e7040a5c70 100644 --- a/vcr/issuer/leia_store_test.go +++ b/vcr/issuer/leia_store_test.go @@ -20,12 +20,12 @@ package issuer import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/bbolt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/types" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" diff --git a/vcr/issuer/network_publisher.go b/vcr/issuer/network_publisher.go index 4844c6c49a..06042bfbda 100644 --- a/vcr/issuer/network_publisher.go +++ b/vcr/issuer/network_publisher.go @@ -20,12 +20,12 @@ package issuer import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/network/transport" "github.com/nuts-foundation/nuts-node/vcr/credential" diff --git a/vcr/issuer/network_publisher_test.go b/vcr/issuer/network_publisher_test.go index c94f9696bd..94a2700142 100644 --- a/vcr/issuer/network_publisher_test.go +++ b/vcr/issuer/network_publisher_test.go @@ -19,7 +19,6 @@ package issuer import ( - "encoding/json" "errors" "fmt" ssi "github.com/nuts-foundation/go-did" @@ -27,6 +26,7 @@ import ( "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/types" diff --git a/vcr/issuer/openid.go b/vcr/issuer/openid.go index 423cb0cf03..0fc69a2ceb 100644 --- a/vcr/issuer/openid.go +++ b/vcr/issuer/openid.go @@ -21,7 +21,6 @@ package issuer import ( "context" crypt "crypto" - "encoding/json" "errors" "fmt" "github.com/google/uuid" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/audit" "github.com/nuts-foundation/nuts-node/core" "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/issuer/assets" "github.com/nuts-foundation/nuts-node/vcr/log" diff --git a/vcr/issuer/openid_test.go b/vcr/issuer/openid_test.go index da9d629118..f00e6470e2 100644 --- a/vcr/issuer/openid_test.go +++ b/vcr/issuer/openid_test.go @@ -74,7 +74,7 @@ func TestNew(t *testing.T) { _, err := NewOpenIDHandler(issuerDID, issuerIdentifier, "./test/invalid", nil, nil, storage.NewTestInMemorySessionDatabase(t)) require.Error(t, err) - assert.EqualError(t, err, "failed to parse credential definition from test/invalid/invalid.json: unexpected end of JSON input") + assert.EqualError(t, err, "failed to parse credential definition from test/invalid/invalid.json: sonnet: unexpected EOF reading a byte") }) t.Run("error - invalid directory", func(t *testing.T) { diff --git a/vcr/openid4vci/issuer_client.go b/vcr/openid4vci/issuer_client.go index c355aa96d5..6c6a4c08bb 100644 --- a/vcr/openid4vci/issuer_client.go +++ b/vcr/openid4vci/issuer_client.go @@ -21,12 +21,12 @@ package openid4vci import ( "bytes" "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/oauth" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/log" "io" "net/http" diff --git a/vcr/openid4vci/test.go b/vcr/openid4vci/test.go index f105ff4674..503ee19925 100644 --- a/vcr/openid4vci/test.go +++ b/vcr/openid4vci/test.go @@ -20,10 +20,10 @@ package openid4vci import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/auth/oauth" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/test" "net/http" "testing" diff --git a/vcr/openid4vci/wallet_client.go b/vcr/openid4vci/wallet_client.go index e1b4fc1fa5..a4118112a5 100644 --- a/vcr/openid4vci/wallet_client.go +++ b/vcr/openid4vci/wallet_client.go @@ -20,10 +20,10 @@ package openid4vci import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "net/url" ) diff --git a/vcr/openid4vci/wallet_client_test.go b/vcr/openid4vci/wallet_client_test.go index 5310eb4ec0..54c07a8965 100644 --- a/vcr/openid4vci/wallet_client_test.go +++ b/vcr/openid4vci/wallet_client_test.go @@ -20,7 +20,7 @@ package openid4vci import ( "context" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "net/http" "net/url" diff --git a/vcr/pe/presentation_definition.go b/vcr/pe/presentation_definition.go index df41b6907f..8ae72b867a 100644 --- a/vcr/pe/presentation_definition.go +++ b/vcr/pe/presentation_definition.go @@ -19,11 +19,11 @@ package pe import ( - "encoding/json" "errors" "fmt" "github.com/lestrrat-go/jwx/v2/jwa" "github.com/lestrrat-go/jwx/v2/jws" + "github.com/nuts-foundation/nuts-node/json" v2 "github.com/nuts-foundation/nuts-node/vcr/pe/schema/v2" "strings" diff --git a/vcr/pe/presentation_definition_test.go b/vcr/pe/presentation_definition_test.go index 9c220c3bee..75f3f0a4cf 100644 --- a/vcr/pe/presentation_definition_test.go +++ b/vcr/pe/presentation_definition_test.go @@ -23,9 +23,9 @@ import ( "crypto/elliptic" "crypto/rand" "embed" - "encoding/json" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core/to" + "github.com/nuts-foundation/nuts-node/json" vcrTest "github.com/nuts-foundation/nuts-node/vcr/test" "strings" "testing" diff --git a/vcr/pe/presentation_submission.go b/vcr/pe/presentation_submission.go index 1d78ed137f..c3cd9a6f6e 100644 --- a/vcr/pe/presentation_submission.go +++ b/vcr/pe/presentation_submission.go @@ -19,13 +19,13 @@ package pe import ( - "encoding/json" "errors" "fmt" "github.com/PaesslerAG/jsonpath" "github.com/google/uuid" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/credential" v2 "github.com/nuts-foundation/nuts-node/vcr/pe/schema/v2" "strings" diff --git a/vcr/pe/presentation_submission_test.go b/vcr/pe/presentation_submission_test.go index b34ae84910..a3679efb14 100644 --- a/vcr/pe/presentation_submission_test.go +++ b/vcr/pe/presentation_submission_test.go @@ -19,10 +19,10 @@ package pe import ( - "encoding/json" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/pe/test" "github.com/nuts-foundation/nuts-node/vcr/signature/proof" "github.com/stretchr/testify/assert" diff --git a/vcr/pe/util.go b/vcr/pe/util.go index 75ced72c07..f94e9fe402 100644 --- a/vcr/pe/util.go +++ b/vcr/pe/util.go @@ -19,10 +19,10 @@ package pe import ( - "encoding/json" "fmt" "github.com/lestrrat-go/jwx/v2/jwt" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" ) // Envelope is a parsed Presentation Exchange envelope, containing zero or more Verifiable Presentations that are referenced by the Presentation Submission. diff --git a/vcr/pe/util_test.go b/vcr/pe/util_test.go index 999df47fac..c9f551517e 100644 --- a/vcr/pe/util_test.go +++ b/vcr/pe/util_test.go @@ -19,8 +19,8 @@ package pe import ( - "encoding/json" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/test" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/vcr/revocation/statuslist2021_issuer_test.go b/vcr/revocation/statuslist2021_issuer_test.go index 3e2a106d7c..26a044e32d 100644 --- a/vcr/revocation/statuslist2021_issuer_test.go +++ b/vcr/revocation/statuslist2021_issuer_test.go @@ -21,9 +21,9 @@ package revocation import ( "context" "crypto" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "strconv" "testing" "time" diff --git a/vcr/revocation/statuslist2021_verifier.go b/vcr/revocation/statuslist2021_verifier.go index 4071ac54cd..ab87d6d363 100644 --- a/vcr/revocation/statuslist2021_verifier.go +++ b/vcr/revocation/statuslist2021_verifier.go @@ -19,9 +19,9 @@ package revocation import ( - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" "strconv" diff --git a/vcr/revocation/statuslist2021_verifier_test.go b/vcr/revocation/statuslist2021_verifier_test.go index 2ed018dcd6..a6aeba6d19 100644 --- a/vcr/revocation/statuslist2021_verifier_test.go +++ b/vcr/revocation/statuslist2021_verifier_test.go @@ -19,8 +19,8 @@ package revocation import ( - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "net/http" "net/http/httptest" "testing" @@ -216,7 +216,7 @@ func TestStatusList2021_statusList(t *testing.T) { actualCR, err := cs.statusList(entry.StatusListCredential) - assert.EqualError(t, err, "unexpected end of JSON input") + assert.EqualError(t, err, "sonnet: unexpected EOF reading a byte") assert.Nil(t, actualCR) }) @@ -344,7 +344,7 @@ func TestStatusList2021_download(t *testing.T) { cs := &StatusList2021{client: ts.Client()} received, err := cs.download(ts.URL) - assert.EqualError(t, err, "unexpected end of JSON input") + assert.EqualError(t, err, "sonnet: unexpected EOF reading a byte") assert.Nil(t, received) }) } diff --git a/vcr/revocation/types_test.go b/vcr/revocation/types_test.go index 91b08c6716..3eb54c0ee2 100644 --- a/vcr/revocation/types_test.go +++ b/vcr/revocation/types_test.go @@ -21,7 +21,7 @@ package revocation import ( "context" "crypto" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "testing" "time" diff --git a/vcr/search.go b/vcr/search.go index 2e6ffc2eb1..5a4c2a42e7 100644 --- a/vcr/search.go +++ b/vcr/search.go @@ -21,9 +21,9 @@ package vcr import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/log" "github.com/sirupsen/logrus" "reflect" diff --git a/vcr/signature/proof/jsonld.go b/vcr/signature/proof/jsonld.go index 93f78a1fae..3500d6fa78 100644 --- a/vcr/signature/proof/jsonld.go +++ b/vcr/signature/proof/jsonld.go @@ -22,9 +22,9 @@ import ( "context" "crypto" "encoding/base64" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "strings" "time" diff --git a/vcr/signature/proof/jsonld_test.go b/vcr/signature/proof/jsonld_test.go index 04ed3a940f..9137b39751 100644 --- a/vcr/signature/proof/jsonld_test.go +++ b/vcr/signature/proof/jsonld_test.go @@ -19,9 +19,9 @@ package proof import ( - "encoding/json" "errors" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/stretchr/testify/require" "testing" diff --git a/vcr/signature/proof/proof.go b/vcr/signature/proof/proof.go index fd38aec95e..640b62f143 100644 --- a/vcr/signature/proof/proof.go +++ b/vcr/signature/proof/proof.go @@ -21,7 +21,7 @@ package proof import ( "context" "crypto" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/signature" ) diff --git a/vcr/signature/proof/proof_test.go b/vcr/signature/proof/proof_test.go index de9d6cf111..4a5ace9652 100644 --- a/vcr/signature/proof/proof_test.go +++ b/vcr/signature/proof/proof_test.go @@ -19,9 +19,9 @@ package proof import ( - "encoding/json" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/vc" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "testing" ) diff --git a/vcr/store.go b/vcr/store.go index 2c1a12e8ea..54ad27c179 100644 --- a/vcr/store.go +++ b/vcr/store.go @@ -20,11 +20,11 @@ package vcr import ( - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "reflect" "time" diff --git a/vcr/store_test.go b/vcr/store_test.go index 44cc3e8aaa..b9d70ee1ee 100644 --- a/vcr/store_test.go +++ b/vcr/store_test.go @@ -23,9 +23,9 @@ import ( "context" "crypto/ecdsa" "crypto/sha1" - "encoding/json" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/crypto/storage/spi" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vcr/test" "github.com/nuts-foundation/nuts-node/vdr/resolver" "github.com/stretchr/testify/require" diff --git a/vcr/test/credentials.go b/vcr/test/credentials.go index 2cf255822f..e4009787bf 100644 --- a/vcr/test/credentials.go +++ b/vcr/test/credentials.go @@ -25,13 +25,13 @@ import ( "crypto/rand" "crypto/sha256" "encoding/base64" - "encoding/json" "fmt" "github.com/lestrrat-go/jwx/v2/cert" "github.com/lestrrat-go/jwx/v2/jwa" "github.com/lestrrat-go/jwx/v2/jws" "github.com/lestrrat-go/jwx/v2/jwt" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/test/pki" "github.com/nuts-foundation/nuts-node/vcr/assets" "github.com/stretchr/testify/require" diff --git a/vcr/test/formats_integration_test.go b/vcr/test/formats_integration_test.go index 0760ec4071..1376d5c2a2 100644 --- a/vcr/test/formats_integration_test.go +++ b/vcr/test/formats_integration_test.go @@ -20,9 +20,9 @@ package test import ( "context" - "encoding/json" "github.com/nuts-foundation/go-did/vc" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/test/node" "github.com/nuts-foundation/nuts-node/vcr" v2 "github.com/nuts-foundation/nuts-node/vcr/api/vcr/v2" diff --git a/vcr/test/openid4vci_integration_test.go b/vcr/test/openid4vci_integration_test.go index 3e90ed0761..359e74f409 100644 --- a/vcr/test/openid4vci_integration_test.go +++ b/vcr/test/openid4vci_integration_test.go @@ -20,8 +20,8 @@ package test import ( "bytes" - "encoding/json" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/jsonld" "github.com/nuts-foundation/nuts-node/vcr/issuer" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" diff --git a/vcr/vcr.go b/vcr/vcr.go index 6cf9876b89..0af2c6fc0f 100644 --- a/vcr/vcr.go +++ b/vcr/vcr.go @@ -21,11 +21,11 @@ package vcr import ( "context" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vcr/credential" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" diff --git a/vcr/vcr_test.go b/vcr/vcr_test.go index d4833943a9..3cc1677f60 100644 --- a/vcr/vcr_test.go +++ b/vcr/vcr_test.go @@ -22,12 +22,12 @@ package vcr import ( "context" "crypto/sha1" - "encoding/json" "errors" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/go-stoabs" bbolt2 "github.com/nuts-foundation/go-stoabs/bbolt" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/openid4vci" diff --git a/vcr/verifier/leia_store.go b/vcr/verifier/leia_store.go index 29a1dc3809..8dd5fd3c3a 100644 --- a/vcr/verifier/leia_store.go +++ b/vcr/verifier/leia_store.go @@ -20,11 +20,11 @@ package verifier import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-leia/v4" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vcr/log" diff --git a/vcr/verifier/leia_store_test.go b/vcr/verifier/leia_store_test.go index 070d74b30c..911bc08e37 100644 --- a/vcr/verifier/leia_store_test.go +++ b/vcr/verifier/leia_store_test.go @@ -21,9 +21,9 @@ package verifier import ( "context" "crypto/sha1" - "encoding/json" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/bbolt" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" "path" diff --git a/vcr/verifier/signature_verifier_test.go b/vcr/verifier/signature_verifier_test.go index cf8712bb87..a887268fdc 100644 --- a/vcr/verifier/signature_verifier_test.go +++ b/vcr/verifier/signature_verifier_test.go @@ -29,11 +29,11 @@ import ( "crypto/sha256" "crypto/x509" "encoding/base64" - "encoding/json" "errors" "github.com/google/uuid" "github.com/lestrrat-go/jwx/v2/cert" "github.com/lestrrat-go/jwx/v2/jwa" + "github.com/nuts-foundation/nuts-node/json" testpki "github.com/nuts-foundation/nuts-node/test/pki" "github.com/nuts-foundation/nuts-node/vdr/didx509" "os" diff --git a/vcr/verifier/verifier.go b/vcr/verifier/verifier.go index 8cf4ba7328..691d7ac668 100644 --- a/vcr/verifier/verifier.go +++ b/vcr/verifier/verifier.go @@ -19,9 +19,9 @@ package verifier import ( - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vcr/revocation" "strings" diff --git a/vcr/verifier/verifier_test.go b/vcr/verifier/verifier_test.go index 19a224b342..727919b1ed 100644 --- a/vcr/verifier/verifier_test.go +++ b/vcr/verifier/verifier_test.go @@ -21,8 +21,8 @@ package verifier import ( "context" "crypto" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/test/pki" "net/http" diff --git a/vdr/api/v1/client.go b/vdr/api/v1/client.go index 66f76eeefe..d573938304 100644 --- a/vdr/api/v1/client.go +++ b/vdr/api/v1/client.go @@ -21,10 +21,10 @@ package v1 import ( "context" - "encoding/json" "fmt" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "io" "net/http" ) diff --git a/vdr/api/v1/client_test.go b/vdr/api/v1/client_test.go index fb0313d8bd..a4ad3aa199 100644 --- a/vdr/api/v1/client_test.go +++ b/vdr/api/v1/client_test.go @@ -19,9 +19,9 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "errors" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "github.com/stretchr/testify/require" "net/http" diff --git a/vdr/api/v2/api_test.go b/vdr/api/v2/api_test.go index 8bac17f6e1..7b5d0026e8 100644 --- a/vdr/api/v2/api_test.go +++ b/vdr/api/v2/api_test.go @@ -21,11 +21,11 @@ package v2 import ( "context" - "encoding/json" "errors" "github.com/labstack/echo/v4" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vdr/didsubject" "net/http" diff --git a/vdr/cmd/cmd.go b/vdr/cmd/cmd.go index 5fad559902..dd772b3dfa 100644 --- a/vdr/cmd/cmd.go +++ b/vdr/cmd/cmd.go @@ -20,9 +20,9 @@ package cmd import ( "bufio" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "io" "os" diff --git a/vdr/cmd/cmd_test.go b/vdr/cmd/cmd_test.go index ab8f7ef82a..a0acd2147b 100644 --- a/vdr/cmd/cmd_test.go +++ b/vdr/cmd/cmd_test.go @@ -23,7 +23,7 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" + "github.com/nuts-foundation/nuts-node/json" v2 "github.com/nuts-foundation/nuts-node/vdr/api/v2" "github.com/stretchr/testify/require" "net/http" diff --git a/vdr/didkey/resolver_test.go b/vdr/didkey/resolver_test.go index f782f2744f..3054ffb3c4 100644 --- a/vdr/didkey/resolver_test.go +++ b/vdr/didkey/resolver_test.go @@ -26,10 +26,10 @@ import ( "crypto/rsa" "crypto/x509" "encoding/binary" - "encoding/json" "github.com/mr-tron/base58" "github.com/multiformats/go-multicodec" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "testing" diff --git a/vdr/didnuts/ambassador.go b/vdr/didnuts/ambassador.go index 837962b048..36e73c2ee2 100644 --- a/vdr/didnuts/ambassador.go +++ b/vdr/didnuts/ambassador.go @@ -23,7 +23,6 @@ import ( "bytes" "context" "crypto" - "encoding/json" "errors" "fmt" "github.com/lestrrat-go/jwx/v2/jwk" @@ -33,6 +32,7 @@ import ( "github.com/nuts-foundation/nuts-node/core" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/events" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/network/dag" "github.com/nuts-foundation/nuts-node/vdr/didnuts/didstore" diff --git a/vdr/didnuts/ambassador_test.go b/vdr/didnuts/ambassador_test.go index e762aa7987..f12edee5a0 100644 --- a/vdr/didnuts/ambassador_test.go +++ b/vdr/didnuts/ambassador_test.go @@ -24,8 +24,8 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "testing" "time" @@ -273,7 +273,7 @@ func TestAmbassador_callback(t *testing.T) { err := ctx.ambassador.callback(tx, []byte("}")) - assert.EqualError(t, err, "unable to unmarshal DID document from network payload: invalid character '}' looking for beginning of value") + assert.EqualError(t, err, "unable to unmarshal DID document from network payload: sonnet: invalid character '}' looking for beginning of value") }) t.Run("nok - incorrect payloadType", func(t *testing.T) { diff --git a/vdr/didnuts/didstore/integration_test.go b/vdr/didnuts/didstore/integration_test.go index 488c5e4e45..aac9b8f816 100644 --- a/vdr/didnuts/didstore/integration_test.go +++ b/vdr/didnuts/didstore/integration_test.go @@ -19,8 +19,8 @@ package didstore import ( - "encoding/json" ssi "github.com/nuts-foundation/go-did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "testing" "time" diff --git a/vdr/didnuts/didstore/reader.go b/vdr/didnuts/didstore/reader.go index 7d7c7d470f..6420880fba 100644 --- a/vdr/didnuts/didstore/reader.go +++ b/vdr/didnuts/didstore/reader.go @@ -19,12 +19,12 @@ package didstore import ( - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" ) diff --git a/vdr/didnuts/didstore/reader_test.go b/vdr/didnuts/didstore/reader_test.go index b0f12d7302..b6f3d41366 100644 --- a/vdr/didnuts/didstore/reader_test.go +++ b/vdr/didnuts/didstore/reader_test.go @@ -20,10 +20,10 @@ package didstore import ( "context" - "encoding/json" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/vdr/resolver" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/vdr/didnuts/didstore/store_test.go b/vdr/didnuts/didstore/store_test.go index bcf0f726fd..b2d0e02b9d 100644 --- a/vdr/didnuts/didstore/store_test.go +++ b/vdr/didnuts/didstore/store_test.go @@ -21,7 +21,6 @@ package didstore import ( "context" "encoding/binary" - "encoding/json" "fmt" "github.com/alicebob/miniredis/v2" ssi "github.com/nuts-foundation/go-did" @@ -29,6 +28,7 @@ import ( "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/go-stoabs/redis7" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/vdr/resolver" "github.com/redis/go-redis/v9" diff --git a/vdr/didnuts/didstore/test.go b/vdr/didnuts/didstore/test.go index f340ba2b47..1af1b6daa3 100644 --- a/vdr/didnuts/didstore/test.go +++ b/vdr/didnuts/didstore/test.go @@ -19,8 +19,8 @@ package didstore import ( - "encoding/json" "github.com/nuts-foundation/nuts-node/core" + "github.com/nuts-foundation/nuts-node/json" "testing" "time" diff --git a/vdr/didnuts/didstore/writer.go b/vdr/didnuts/didstore/writer.go index 9c40ba233c..505366ed57 100644 --- a/vdr/didnuts/didstore/writer.go +++ b/vdr/didnuts/didstore/writer.go @@ -20,12 +20,12 @@ package didstore import ( "encoding/binary" - "encoding/json" "errors" "fmt" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" ) func writeEventList(tx stoabs.WriteTx, newEventList eventList, id did.DID) error { diff --git a/vdr/didnuts/didstore/writer_test.go b/vdr/didnuts/didstore/writer_test.go index 7602f22c2c..c6598c166f 100644 --- a/vdr/didnuts/didstore/writer_test.go +++ b/vdr/didnuts/didstore/writer_test.go @@ -20,12 +20,12 @@ package didstore import ( "context" - "encoding/json" "fmt" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/go-stoabs" "github.com/nuts-foundation/nuts-node/crypto/hash" + "github.com/nuts-foundation/nuts-node/json" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" diff --git a/vdr/didnuts/manager.go b/vdr/didnuts/manager.go index a2341a4d91..5375e2b8dd 100644 --- a/vdr/didnuts/manager.go +++ b/vdr/didnuts/manager.go @@ -21,9 +21,9 @@ package didnuts import ( "context" "crypto" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "time" diff --git a/vdr/didnuts/manager_test.go b/vdr/didnuts/manager_test.go index bd17138ed0..e3f4d3b3ce 100644 --- a/vdr/didnuts/manager_test.go +++ b/vdr/didnuts/manager_test.go @@ -24,9 +24,9 @@ import ( "crypto/ecdsa" "crypto/elliptic" "crypto/rand" - "encoding/json" "errors" "fmt" + "github.com/nuts-foundation/nuts-node/json" "strings" "testing" diff --git a/vdr/didnuts/validators.go b/vdr/didnuts/validators.go index ed10fddd2b..676f1d8b28 100644 --- a/vdr/didnuts/validators.go +++ b/vdr/didnuts/validators.go @@ -19,12 +19,12 @@ package didnuts import ( - "encoding/json" "errors" "fmt" "github.com/lestrrat-go/jwx/v2/jwk" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network/transport" "github.com/nuts-foundation/nuts-node/vdr/resolver" ) diff --git a/vdr/didsubject/did_document.go b/vdr/didsubject/did_document.go index 3a15797568..7ae3d5cc24 100644 --- a/vdr/didsubject/did_document.go +++ b/vdr/didsubject/did_document.go @@ -19,8 +19,8 @@ package didsubject import ( - "encoding/json" "errors" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "time" diff --git a/vdr/didsubject/manager.go b/vdr/didsubject/manager.go index 41608c9b28..467e314728 100644 --- a/vdr/didsubject/manager.go +++ b/vdr/didsubject/manager.go @@ -21,7 +21,6 @@ package didsubject import ( "context" "crypto/sha256" - "encoding/json" "errors" "fmt" "github.com/google/uuid" @@ -30,6 +29,7 @@ import ( "github.com/nuts-foundation/go-did/did" "github.com/nuts-foundation/nuts-node/core" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage" "github.com/nuts-foundation/nuts-node/storage/orm" "github.com/nuts-foundation/nuts-node/vdr/log" diff --git a/vdr/didsubject/manager_test.go b/vdr/didsubject/manager_test.go index 7c9abb3c87..0f1832dd4f 100644 --- a/vdr/didsubject/manager_test.go +++ b/vdr/didsubject/manager_test.go @@ -20,11 +20,11 @@ package didsubject import ( "context" - "encoding/json" "errors" "fmt" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/nuts-node/crypto/storage/spi" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "net/url" "strings" diff --git a/vdr/didweb/manager.go b/vdr/didweb/manager.go index f0734de40d..0dcacc438a 100644 --- a/vdr/didweb/manager.go +++ b/vdr/didweb/manager.go @@ -21,10 +21,10 @@ package didweb import ( "context" "crypto" - "encoding/json" "errors" "fmt" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/storage/orm" "time" diff --git a/vdr/legacy_integration_test.go b/vdr/legacy_integration_test.go index 3c7302aebf..fcb3cbcac7 100644 --- a/vdr/legacy_integration_test.go +++ b/vdr/legacy_integration_test.go @@ -21,9 +21,9 @@ package vdr import ( "context" crypto2 "crypto" - "encoding/json" "fmt" "github.com/nuts-foundation/nuts-node/audit" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/vdr/didnuts" "github.com/nuts-foundation/nuts-node/vdr/didnuts/didstore" diff --git a/vdr/vdr_test.go b/vdr/vdr_test.go index ce6c593695..b58d7fcb7c 100644 --- a/vdr/vdr_test.go +++ b/vdr/vdr_test.go @@ -24,7 +24,6 @@ import ( "crypto/elliptic" "crypto/rand" "encoding/base64" - "encoding/json" "github.com/lestrrat-go/jwx/v2/jwk" ssi "github.com/nuts-foundation/go-did" "github.com/nuts-foundation/go-did/did" @@ -32,6 +31,7 @@ import ( "github.com/nuts-foundation/nuts-node/core" nutsCrypto "github.com/nuts-foundation/nuts-node/crypto" "github.com/nuts-foundation/nuts-node/http/client" + "github.com/nuts-foundation/nuts-node/json" "github.com/nuts-foundation/nuts-node/network" "github.com/nuts-foundation/nuts-node/pki" "github.com/nuts-foundation/nuts-node/storage"