chore[breaking-change]: remove account keytype

This commit is contained in:
Fernandez Ludovic 2026-06-12 14:49:44 +02:00
parent fe7d070e87
commit 42c8d24ff7
4 changed files with 8 additions and 24 deletions

View file

@ -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
}

View file

@ -76,8 +76,7 @@ func TestLocalStore_SaveAccount(t *testing.T) {
"Account": {
"Email": "some@email.com",
"Registration": null,
"PrivateKey": null,
"KeyType": ""
"PrivateKey": null
},
"Certificates": null
}

View file

@ -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
}

View file

@ -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")
})
}
}