-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3428e99
commit cc03edf
Showing
64 changed files
with
1,056 additions
and
1,093 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,9 @@ | |
|
||
from django_ca.acme.responses import AcmeResponseUnauthorized | ||
from django_ca.models import AcmeAccount, CertificateAuthority, acme_slug | ||
from django_ca.tests.base import certs, override_tmpcadir | ||
from django_ca.tests.base.constants import CERT_DATA | ||
from django_ca.tests.base.mixins import TestCaseMixin | ||
from django_ca.tests.base.utils import override_tmpcadir | ||
|
||
MessageTypeVar = typing.TypeVar("MessageTypeVar", bound=jose.json_util.JSONObjectWithFields) | ||
|
||
|
@@ -51,7 +52,7 @@ class AcmeTestCaseMixin(TestCaseMixin): | |
|
||
# NOTE: PEM here is the same as AcmeAccount.pem when this cert is used for account registration | ||
PEM = ( | ||
certs["root-cert"]["key"]["parsed"] | ||
CERT_DATA["root-cert"]["key"]["parsed"] | ||
.public_key() | ||
.public_bytes(Encoding.PEM, PublicFormat.SubjectPublicKeyInfo) | ||
.decode("utf-8") | ||
|
@@ -60,7 +61,7 @@ class AcmeTestCaseMixin(TestCaseMixin): | |
thumbprint = "kqtZjXqX07HbrRg220VoINzqF9QXsfIkQava3PdWM8o" | ||
ACCOUNT_ONE_CONTACT = "mailto:[email protected]" | ||
CHILD_PEM = ( | ||
certs["child-cert"]["key"]["parsed"] | ||
CERT_DATA["child-cert"]["key"]["parsed"] | ||
.public_key() | ||
.public_bytes(Encoding.PEM, PublicFormat.SubjectPublicKeyInfo) | ||
.decode("utf-8") | ||
|
@@ -238,7 +239,9 @@ def acme( | |
if nonce is None: | ||
nonce = self.get_nonce() | ||
if cert is None: | ||
cert = typing.cast(CertificateIssuerPrivateKeyTypes, certs[self.load_certs[0]]["key"]["parsed"]) | ||
cert = typing.cast( | ||
CertificateIssuerPrivateKeyTypes, CERT_DATA[self.load_certs[0]]["key"]["parsed"] | ||
) | ||
if post_kwargs is None: | ||
post_kwargs = {} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,15 +26,16 @@ | |
|
||
from django_ca.models import AcmeAccount | ||
from django_ca.tests.acme.views.base import AcmeBaseViewTestCaseMixin | ||
from django_ca.tests.base import certs, override_tmpcadir, timestamps | ||
from django_ca.tests.base.constants import CERT_DATA, TIMESTAMPS | ||
from django_ca.tests.base.utils import override_tmpcadir | ||
|
||
|
||
@freeze_time(timestamps["everything_valid"]) | ||
@freeze_time(TIMESTAMPS["everything_valid"]) | ||
class AcmeNewAccountViewTestCase(AcmeBaseViewTestCaseMixin[acme.messages.Registration], TestCase): | ||
"""Test creating a new account.""" | ||
|
||
contact = "mailto:[email protected]" | ||
url = reverse_lazy("django_ca:acme-new-account", kwargs={"serial": certs["root"]["serial"]}) | ||
url = reverse_lazy("django_ca:acme-new-account", kwargs={"serial": CERT_DATA["root"]["serial"]}) | ||
message = acme.messages.Registration(contact=(contact,), terms_of_service_agreed=True) | ||
message_cls = acme.messages.Registration | ||
requires_kid = False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.