From 98da658da8b31412162357bd63c9ac7a28976a14 Mon Sep 17 00:00:00 2001 From: Wout Slakhorst Date: Tue, 7 May 2024 14:17:48 +0200 Subject: [PATCH] remove es256k from oauth package --- auth/oauth/jwx_es256k.go | 27 ----------------------- auth/oauth/jwx_es256k_test.go | 33 ----------------------------- crypto/{ => jwx}/jwx_es256k.go | 2 +- crypto/{ => jwx}/jwx_es256k_test.go | 2 +- 4 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 auth/oauth/jwx_es256k.go delete mode 100644 auth/oauth/jwx_es256k_test.go rename crypto/{ => jwx}/jwx_es256k.go (98%) rename crypto/{ => jwx}/jwx_es256k_test.go (98%) diff --git a/auth/oauth/jwx_es256k.go b/auth/oauth/jwx_es256k.go deleted file mode 100644 index d418b21008..0000000000 --- a/auth/oauth/jwx_es256k.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build jwx_es256k - -/* - * Copyright (C) 2024 Nuts community - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package oauth - -import "github.com/lestrrat-go/jwx/v2/jwa" - -func init() { - AlgValuesSupported = append(AlgValuesSupported, jwa.ES256K.String()) -} diff --git a/auth/oauth/jwx_es256k_test.go b/auth/oauth/jwx_es256k_test.go deleted file mode 100644 index 03230788df..0000000000 --- a/auth/oauth/jwx_es256k_test.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build jwx_es256k - -/* - * Copyright (C) 2024 Nuts community - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - */ - -package oauth - -import ( - "github.com/stretchr/testify/assert" - "testing" -) - -func TestES256k(t *testing.T) { - t.Run("supported formats specifies ES256K", func(t *testing.T) { - assert.Contains(t, DefaultOpenIDSupportedFormats()["jwt_vp_json"]["alg_values_supported"], "ES256K") - assert.Contains(t, DefaultOpenIDSupportedFormats()["jwt_vc_json"]["alg_values_supported"], "ES256K") - }) -} diff --git a/crypto/jwx_es256k.go b/crypto/jwx/jwx_es256k.go similarity index 98% rename from crypto/jwx_es256k.go rename to crypto/jwx/jwx_es256k.go index 6340545405..d8a495a790 100644 --- a/crypto/jwx_es256k.go +++ b/crypto/jwx/jwx_es256k.go @@ -18,7 +18,7 @@ * */ -package crypto +package jwx import "github.com/lestrrat-go/jwx/v2/jwa" diff --git a/crypto/jwx_es256k_test.go b/crypto/jwx/jwx_es256k_test.go similarity index 98% rename from crypto/jwx_es256k_test.go rename to crypto/jwx/jwx_es256k_test.go index 4f4f2572a3..b2bb75b6eb 100644 --- a/crypto/jwx_es256k_test.go +++ b/crypto/jwx/jwx_es256k_test.go @@ -18,7 +18,7 @@ * */ -package crypto +package jwx import ( "crypto"