Put in dummy challenge

This commit is contained in:
James Kasten 2015-09-28 15:53:42 -07:00
parent fa992faf52
commit 67ec4d09ee
3 changed files with 8 additions and 4 deletions

View file

@ -34,6 +34,11 @@ class DVChallenge(Challenge): # pylint: disable=abstract-method
"""Domain validation challenges."""
class UnrecognizedChallenge(DVChallenge):
"""Unrecognized challenge."""
typ = "unknown"
class ChallengeResponse(jose.TypedJSONObjectWithFields):
# _fields_to_partial_json | pylint: disable=abstract-method
"""ACME challenge response."""

View file

@ -2,7 +2,6 @@
import collections
from acme import challenges
from acme import errors
from acme import fields
from acme import jose
from acme import util
@ -383,7 +382,9 @@ class Authorization(ResourceBody):
try:
challs.append(ChallengeBody.from_json(chall))
except jose.UnrecognizedTypeError:
continue
challs.append(ChallengeBody(
uri="UNKNOWN", chall=challenges.UnrecognizedChallenge,
status=STATUS_UNKNOWN))
return tuple(challs)
@property

View file

@ -275,8 +275,6 @@ class AuthorizationTest(unittest.TestCase):
from acme.messages import ChallengeBody
from acme.messages import STATUS_VALID
unknown_chall = mock.MagicMock()
unknown_chall.to_json.side_effect = side_effect=jose.UnrecognizedTypeError
self.challbs = (
ChallengeBody(
uri='http://challb1', status=STATUS_VALID,