Example #1
0
    def setUp(self):
        from acme.messages import ChallengeBody
        from acme.messages import STATUS_VALID

        self.challbs = (
            ChallengeBody(
                uri='http://challb1', status=STATUS_VALID,
                chall=challenges.SimpleHTTP(token=b'IlirfxKKXAsHtmzK29Pj8A')),
            ChallengeBody(uri='http://challb2', status=STATUS_VALID,
                          chall=challenges.DNS(
                              token=b'DGyRejmCefe7v4NfDGDKfA')),
            ChallengeBody(uri='http://challb3', status=STATUS_VALID,
                          chall=challenges.RecoveryContact()),
        )
        combinations = ((0, 2), (1, 2))

        from acme.messages import Authorization
        from acme.messages import Identifier
        from acme.messages import IDENTIFIER_FQDN
        identifier = Identifier(typ=IDENTIFIER_FQDN, value='example.com')
        self.authz = Authorization(
            identifier=identifier, combinations=combinations,
            challenges=self.challbs)

        self.jobj_from = {
            'identifier': identifier.to_json(),
            'challenges': [challb.to_json() for challb in self.challbs],
            'combinations': combinations,
        }
Example #2
0
 def setUp(self):
     from acme.messages import Error, ERROR_PREFIX, Identifier, IDENTIFIER_FQDN
     self.error = Error.with_code('malformed', detail='foo', title='title')
     self.jobj = {
         'detail': 'foo',
         'title': 'some title',
         'type': ERROR_PREFIX + 'malformed',
     }
     self.error_custom = Error(typ='custom', detail='bar')
     self.identifier = Identifier(typ=IDENTIFIER_FQDN, value='example.com')
     self.subproblem = Error.with_code('caa', detail='bar', title='title', identifier=self.identifier)
     self.error_with_subproblems = Error.with_code('malformed', detail='foo', title='title', subproblems=[self.subproblem])
     self.empty_error = Error()