Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
reinkrul committed May 21, 2024
1 parent 1873960 commit ce0a297
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions auth/api/iam/dpop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
"testing"

"github.com/lestrrat-go/jwx/v2/jwa"
"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/auth/oauth"
Expand Down Expand Up @@ -242,11 +241,9 @@ func newSignedTestDPoP() (*dpop.DPoP, *dpop.DPoP, string) {
dpopToken := newTestDPoP()
withProof := newTestDPoP()
keyPair, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
jwkKey, _ := jwk.FromRaw(keyPair)
jwkKey.Set(jwk.AlgorithmKey, jwa.ES256)
_ = withProof.GenerateProof("token")
_, _ = withProof.Sign(jwkKey)
_, _ = dpopToken.Sign(jwkKey)
_, _ = withProof.Sign(keyPair, jwa.ES256)
_, _ = dpopToken.Sign(keyPair, jwa.ES256)
thumbprintBytes, _ := dpopToken.Headers.JWK().Thumbprint(crypto2.SHA256)
thumbprint := base64.RawURLEncoding.EncodeToString(thumbprintBytes)
return dpopToken, withProof, thumbprint
Expand Down

0 comments on commit ce0a297

Please sign in to comment.