def setUp(self): from acme.messages import Directory self.key = jose.jwk.JWKRSA(key=KEY.public_key()) self.kid = "kid-for-testing" self.hmac_key = "hmac-key-for-testing" self.dir = Directory({ 'newAccount': 'http://url/acme/new-account', })
def setUp(self): from acme.messages import Directory self.dir = Directory({ 'new-reg': 'reg', mock.MagicMock(resource_type='new-cert'): 'cert', 'meta': Directory.Meta( terms_of_service='https://example.com/acme/terms', website='https://www.example.com/', caa_identities=['example.com'], ), })
def test_new_registration_from_data_with_eab(self): from acme.messages import NewRegistration, ExternalAccountBinding, Directory key = jose.jwk.JWKRSA(key=KEY.public_key()) kid = "kid-for-testing" hmac_key = "hmac-key-for-testing" directory = Directory({ 'newAccount': 'http://url/acme/new-account', }) eab = ExternalAccountBinding.from_data(key, kid, hmac_key, directory) reg = NewRegistration.from_data(email='*****@*****.**', external_account_binding=eab) self.assertEqual(reg.contact, ('mailto:[email protected]', )) self.assertEqual(sorted(reg.external_account_binding.keys()), sorted(['protected', 'payload', 'signature']))
def setUp(self): from acme.messages import Directory self.dir = Directory({ 'new-reg': 'reg', mock.MagicMock(resource_type='new-cert'): 'cert', })
def test_init_wrong_key_value_success(self): # pylint: disable=no-self-use from acme.messages import Directory Directory({'foo': 'bar'})
def _get_directory(cls, directory_url): """fetches the directory information :return: the Directory` object """ directory = requests.get(directory_url) return Directory(directory.json())