From 42c8d24ff72b9b4a35ba3f71f5e59f2c6ca2ae29 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Fri, 12 Jun 2026 14:49:44 +0200 Subject: [PATCH] chore[breaking-change]: remove account keytype --- pkg/provider/acme/account.go | 2 -- pkg/provider/acme/local_store_test.go | 3 +-- pkg/provider/acme/provider.go | 5 ----- pkg/provider/acme/provider_test.go | 22 +++++++--------------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/pkg/provider/acme/account.go b/pkg/provider/acme/account.go index 888875564f..fb1b3757d6 100644 --- a/pkg/provider/acme/account.go +++ b/pkg/provider/acme/account.go @@ -18,7 +18,6 @@ type Account struct { Email string Registration *Resource PrivateKey []byte - KeyType string } type Resource struct { @@ -37,7 +36,6 @@ func NewAccount(email string) (*Account, error) { return &Account{ Email: email, PrivateKey: x509.MarshalPKCS1PrivateKey(privateKey), - KeyType: "4096", }, nil } diff --git a/pkg/provider/acme/local_store_test.go b/pkg/provider/acme/local_store_test.go index 15d592b9ac..5fc6781072 100644 --- a/pkg/provider/acme/local_store_test.go +++ b/pkg/provider/acme/local_store_test.go @@ -76,8 +76,7 @@ func TestLocalStore_SaveAccount(t *testing.T) { "Account": { "Email": "some@email.com", "Registration": null, - "PrivateKey": null, - "KeyType": "" + "PrivateKey": null }, "Certificates": null } diff --git a/pkg/provider/acme/provider.go b/pkg/provider/acme/provider.go index 983512cb66..9e43136a70 100644 --- a/pkg/provider/acme/provider.go +++ b/pkg/provider/acme/provider.go @@ -458,11 +458,6 @@ func (p *Provider) initAccount() (*Account, error) { } } - // Set the KeyType if not already defined in the account - if len(p.account.KeyType) == 0 { - p.account.KeyType = "4096" - } - return p.account, nil } diff --git a/pkg/provider/acme/provider_test.go b/pkg/provider/acme/provider_test.go index 0059f6227d..057d0a6232 100644 --- a/pkg/provider/acme/provider_test.go +++ b/pkg/provider/acme/provider_test.go @@ -516,8 +516,7 @@ func TestInitAccount(t *testing.T) { Email: "foo@foo.net", }, expectedAccount: &Account{ - Email: "foo@foo.net", - KeyType: "4096", + Email: "foo@foo.net", }, }, { @@ -525,20 +524,16 @@ func TestInitAccount(t *testing.T) { email: "foo@foo.net", keyType: "EC256", expectedAccount: &Account{ - Email: "foo@foo.net", - KeyType: "4096", + Email: "foo@foo.net", }, }, { - desc: "Existing account with no email", - account: &Account{ - KeyType: "4096", - }, + desc: "Existing account with no email", + account: &Account{}, email: "foo@foo.net", keyType: "4096", expectedAccount: &Account{ - Email: "foo@foo.net", - KeyType: "4096", + Email: "foo@foo.net", }, }, { @@ -549,8 +544,7 @@ func TestInitAccount(t *testing.T) { email: "bar@foo.net", keyType: "EC256", expectedAccount: &Account{ - Email: "foo@foo.net", - KeyType: "4096", + Email: "foo@foo.net", }, }, { @@ -560,8 +554,7 @@ func TestInitAccount(t *testing.T) { }, email: "bar@foo.net", expectedAccount: &Account{ - Email: "foo@foo.net", - KeyType: "4096", + Email: "foo@foo.net", }, }, } @@ -574,7 +567,6 @@ func TestInitAccount(t *testing.T) { actualAccount, err := acmeProvider.initAccount() assert.NoError(t, err, "Init account in error") assert.Equal(t, test.expectedAccount.Email, actualAccount.Email, "unexpected email account") - assert.Equal(t, test.expectedAccount.KeyType, actualAccount.KeyType, "unexpected keyType account") }) } }