コード例 #1
0
    def test_challenge_payload(self):
        from acme.challenges import HTTP01Response

        challenge_body = HTTP01Response()
        challenge_body.le_acme_version = 2

        jobj = challenge_body.json_dumps(indent=2).encode()
        # RFC8555 states that challenge responses must have an empty payload.
        self.assertEqual(jobj, b'{}')
コード例 #2
0
    def setUp(self):
        from acme.challenges import HTTP01Response
        self.msg = HTTP01Response(key_authorization=u'foo')
        self.jmsg = {
            'resource': 'challenge',
            'type': 'http-01',
            'keyAuthorization': u'foo',
        }

        from acme.challenges import HTTP01
        self.chall = HTTP01(token=(b'x' * 16))
        self.response = self.chall.response(KEY)
コード例 #3
0
 def test_from_json_hashable(self):
     from acme.challenges import HTTP01Response
     hash(HTTP01Response.from_json(self.jmsg))
コード例 #4
0
 def test_from_json(self):
     from acme.challenges import HTTP01Response
     self.assertEqual(
         self.msg, HTTP01Response.from_json(self.jmsg))
コード例 #5
0
 def test_from_json_hashable(self):
     from acme.challenges import HTTP01Response
     hash(HTTP01Response.from_json(self.jmsg))
コード例 #6
0
 def test_from_json(self):
     from acme.challenges import HTTP01Response
     self.assertEqual(
         self.msg, HTTP01Response.from_json(self.jmsg))