devnomads 0.2.2__tar.gz → 0.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {devnomads-0.2.2 → devnomads-0.2.3}/PKG-INFO +1 -1
- {devnomads-0.2.2 → devnomads-0.2.3}/pyproject.toml +1 -1
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/keys.py +8 -1
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_keys.py +10 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/uv.lock +1 -1
- {devnomads-0.2.2 → devnomads-0.2.3}/.flake8 +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/.gitignore +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/.gitlab-ci.yml +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/Makefile +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/README.md +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/openapi.json +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/__init__.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/__init__.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/challenge_server.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/client.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/dns01.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/errors.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/http01.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/verify.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/__init__.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/_services.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/client.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/credentials.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/errors.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/__init__.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/errors.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/names.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/zones.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/py.typed +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/conftest.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_challenges.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_client.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_client.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_credentials.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_dns.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_names.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_services.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tools/bump_version.py +0 -0
- {devnomads-0.2.2 → devnomads-0.2.3}/tools/generate.py +0 -0
|
@@ -22,7 +22,10 @@ PrivateKey = rsa.RSAPrivateKey | ec.EllipticCurvePrivateKey
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def generate_key(algorithm: str) -> PrivateKey:
|
|
25
|
-
"""Generate a private key for ``algorithm
|
|
25
|
+
"""Generate a private key for ``algorithm``.
|
|
26
|
+
|
|
27
|
+
Supported: rsa2048/rsa4096 and ec256/ec384/ec521 (``ecdsa*`` aliases too).
|
|
28
|
+
"""
|
|
26
29
|
|
|
27
30
|
algo = algorithm.lower()
|
|
28
31
|
if algo.startswith("rsa"):
|
|
@@ -34,6 +37,8 @@ def generate_key(algorithm: str) -> PrivateKey:
|
|
|
34
37
|
return ec.generate_private_key(ec.SECP256R1(), backend=default_backend())
|
|
35
38
|
if algo in ("ec384", "ecdsa384"):
|
|
36
39
|
return ec.generate_private_key(ec.SECP384R1(), backend=default_backend())
|
|
40
|
+
if algo in ("ec521", "ecdsa521"):
|
|
41
|
+
return ec.generate_private_key(ec.SECP521R1(), backend=default_backend())
|
|
37
42
|
raise AcmeError(f"unsupported key algorithm: {algorithm}")
|
|
38
43
|
|
|
39
44
|
|
|
@@ -105,6 +110,8 @@ def jws_alg(account_key):
|
|
|
105
110
|
return josepy.ES256
|
|
106
111
|
if curve == "secp384r1":
|
|
107
112
|
return josepy.ES384
|
|
113
|
+
if curve == "secp521r1":
|
|
114
|
+
return josepy.ES512
|
|
108
115
|
raise AcmeError(f"unsupported account key curve: {curve}")
|
|
109
116
|
raise AcmeError("unsupported account key type")
|
|
110
117
|
|
|
@@ -32,6 +32,12 @@ def test_generate_ec():
|
|
|
32
32
|
assert isinstance(generate_key("ec256"), ec.EllipticCurvePrivateKey)
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
def test_generate_ec521():
|
|
36
|
+
key = generate_key("ec521")
|
|
37
|
+
assert isinstance(key, ec.EllipticCurvePrivateKey)
|
|
38
|
+
assert key.curve.name == "secp521r1"
|
|
39
|
+
|
|
40
|
+
|
|
35
41
|
def test_generate_unsupported():
|
|
36
42
|
with pytest.raises(AcmeError):
|
|
37
43
|
generate_key("dsa1024")
|
|
@@ -85,6 +91,10 @@ def test_jws_alg_ec384():
|
|
|
85
91
|
assert jws_alg(jwk.JWKEC(key=generate_key("ec384"))) is josepy.ES384
|
|
86
92
|
|
|
87
93
|
|
|
94
|
+
def test_jws_alg_ec521():
|
|
95
|
+
assert jws_alg(jwk.JWKEC(key=generate_key("ec521"))) is josepy.ES512
|
|
96
|
+
|
|
97
|
+
|
|
88
98
|
def test_jws_alg_unsupported_type():
|
|
89
99
|
with pytest.raises(AcmeError):
|
|
90
100
|
jws_alg(object())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|