(experimental) upgraded to encoding/json/v2

This commit is contained in:
Gani Georgiev committed 2026-08-18 18:16:22 +03:00
1 parent 4d4275c9aa
commit 97dd775455
125 files changed
+433 -364

No files matched your search

+2 -2
View File
@@ -7,7 +7,7 @@ import (
"crypto/ed25519"
"crypto/rsa"
"encoding/base64"
"encoding/json"
"encoding/json/v2"
"errors"
"fmt"
"io"
@@ -105,7 +105,7 @@ func Fetch(ctx context.Context, jwksURL string, kid string) (*JWK, error) {
}
jwks := struct {
Keys []*JWK
Keys []*JWK `json:"keys"`
}{}
err = json.Unmarshal(rawBody, &jwks)
+2 -2
View File
@@ -7,7 +7,7 @@ import (
"crypto/rand"
"crypto/rsa"
"encoding/base64"
"encoding/json"
"encoding/json/v2"
"fmt"
"math/big"
"net/http"
@@ -252,7 +252,7 @@ func TestValidateTokenSignature(t *testing.T) {
}
server := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
_ = json.NewEncoder(res).Encode(map[string]any{"keys": []*jwk.JWK{
_ = json.MarshalWrite(res, map[string]any{"keys": []*jwk.JWK{
{
Kid: "key1",
Kty: "OKP",