Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/ssi_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package ssiTypes

import (
"encoding/json"
"github.com/nuts-foundation/nuts-node/json"
"github.com/stretchr/testify/require"
"testing"
"time"
Expand Down
2 changes: 1 addition & 1 deletion audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/auth/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions auth/api/iam/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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"}})

Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/codegen_sillyness.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package iam

import "encoding/json"
import "github.com/nuts-foundation/nuts-node/json"

var _ json.Marshaler = IntrospectAccessToken200JSONResponse{}

Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/codegen_sillyness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package iam

import (
"encoding/json"
"github.com/nuts-foundation/nuts-node/json"
"github.com/stretchr/testify/assert"
"testing"
)
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/openid4vci.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package iam

import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/nuts-foundation/nuts-node/json"
"net/http"
"net/url"
"time"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/openid4vp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/openid4vp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/s2s_vptoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/api/iam/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/client/iam/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions auth/client/iam/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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, }")
})

}
Expand Down
2 changes: 1 addition & 1 deletion auth/client/iam/openid4vp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions auth/client/iam/openid4vp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ package oauth

import (
"bytes"
"encoding/json"
"errors"
"github.com/nuts-foundation/nuts-node/json"
"html/template"
"net/http"
"net/url"
Expand Down
2 changes: 1 addition & 1 deletion auth/oauth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion auth/oauth/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/dummy/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/irma/irmacontract.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package irma

import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"github.com/nuts-foundation/nuts-node/json"
"strings"
"time"

Expand Down
2 changes: 1 addition & 1 deletion auth/services/irma/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package services

import (
"encoding/json"
"github.com/nuts-foundation/nuts-node/json"
"github.com/stretchr/testify/require"
"testing"

Expand Down
2 changes: 1 addition & 1 deletion auth/services/notary/notary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/oauth/authz_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/oauth/authz_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ package selfsigned

import (
"context"
"encoding/json"
"errors"
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/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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/test/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion auth/services/selfsigned/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading