mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Remove explicit Registration.key.encoder
This commit is contained in:
parent
aca82c1771
commit
33ba8b9dac
2 changed files with 8 additions and 7 deletions
|
|
@ -136,8 +136,7 @@ class Registration(ResourceBody):
|
|||
|
||||
# on new-reg key server ignores 'key' and populates it based on
|
||||
# JWS.signature.combined.jwk
|
||||
key = jose.Field('key', omitempty=True,
|
||||
decoder=jose.JWK.from_json, encoder=jose.JWK.to_json)
|
||||
key = jose.Field('key', omitempty=True, decoder=jose.JWK.from_json)
|
||||
contact = jose.Field('contact', omitempty=True, default=())
|
||||
recovery_token = jose.Field('recoveryToken', omitempty=True)
|
||||
agreement = jose.Field('agreement', omitempty=True)
|
||||
|
|
|
|||
|
|
@ -93,23 +93,25 @@ class RegistrationTest(unittest.TestCase):
|
|||
key=key, contact=contact, recovery_token=recovery_token,
|
||||
agreement=agreement)
|
||||
|
||||
self.jobj = {
|
||||
self.jobj_to = {
|
||||
'contact': contact,
|
||||
'recoveryToken': recovery_token,
|
||||
'agreement': agreement,
|
||||
'key': key.fully_serialize(),
|
||||
'key': key,
|
||||
}
|
||||
self.jobj_from = self.jobj_to.copy()
|
||||
self.jobj_from['key'] = key.fully_serialize()
|
||||
|
||||
def test_to_json(self):
|
||||
self.assertEqual(self.jobj, self.reg.to_json())
|
||||
self.assertEqual(self.jobj_to, self.reg.to_json())
|
||||
|
||||
def test_from_json(self):
|
||||
from letsencrypt.acme.messages2 import Registration
|
||||
self.assertEqual(self.reg, Registration.from_json(self.jobj))
|
||||
self.assertEqual(self.reg, Registration.from_json(self.jobj_from))
|
||||
|
||||
def test_from_json_hashable(self):
|
||||
from letsencrypt.acme.messages2 import Registration
|
||||
hash(Registration.from_json(self.jobj))
|
||||
hash(Registration.from_json(self.jobj_from))
|
||||
|
||||
|
||||
class ChallengeResourceTest(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue