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.
Files changed (39) hide show
  1. {devnomads-0.2.2 → devnomads-0.2.3}/PKG-INFO +1 -1
  2. {devnomads-0.2.2 → devnomads-0.2.3}/pyproject.toml +1 -1
  3. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/keys.py +8 -1
  4. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_keys.py +10 -0
  5. {devnomads-0.2.2 → devnomads-0.2.3}/uv.lock +1 -1
  6. {devnomads-0.2.2 → devnomads-0.2.3}/.flake8 +0 -0
  7. {devnomads-0.2.2 → devnomads-0.2.3}/.gitignore +0 -0
  8. {devnomads-0.2.2 → devnomads-0.2.3}/.gitlab-ci.yml +0 -0
  9. {devnomads-0.2.2 → devnomads-0.2.3}/Makefile +0 -0
  10. {devnomads-0.2.2 → devnomads-0.2.3}/README.md +0 -0
  11. {devnomads-0.2.2 → devnomads-0.2.3}/openapi.json +0 -0
  12. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/__init__.py +0 -0
  13. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/__init__.py +0 -0
  14. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/challenge_server.py +0 -0
  15. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/client.py +0 -0
  16. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/dns01.py +0 -0
  17. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/errors.py +0 -0
  18. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/http01.py +0 -0
  19. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/acme/verify.py +0 -0
  20. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/__init__.py +0 -0
  21. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/_services.py +0 -0
  22. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/client.py +0 -0
  23. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/credentials.py +0 -0
  24. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/api/errors.py +0 -0
  25. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/__init__.py +0 -0
  26. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/errors.py +0 -0
  27. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/names.py +0 -0
  28. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/dns/zones.py +0 -0
  29. {devnomads-0.2.2 → devnomads-0.2.3}/src/devnomads/py.typed +0 -0
  30. {devnomads-0.2.2 → devnomads-0.2.3}/tests/conftest.py +0 -0
  31. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_challenges.py +0 -0
  32. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_acme_client.py +0 -0
  33. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_client.py +0 -0
  34. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_credentials.py +0 -0
  35. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_dns.py +0 -0
  36. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_names.py +0 -0
  37. {devnomads-0.2.2 → devnomads-0.2.3}/tests/test_services.py +0 -0
  38. {devnomads-0.2.2 → devnomads-0.2.3}/tools/bump_version.py +0 -0
  39. {devnomads-0.2.2 → devnomads-0.2.3}/tools/generate.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devnomads
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python client library for the DevNomads API (transport, DNS, ACME)
5
5
  Project-URL: Homepage, https://devnomads.nl
6
6
  Author-email: Loek Geleijn <support@devnomads.nl>
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "devnomads"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Python client library for the DevNomads API (transport, DNS, ACME)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -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`` (rsa2048/rsa4096/ec256/ec384)."""
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())
@@ -468,7 +468,7 @@ wheels = [
468
468
 
469
469
  [[package]]
470
470
  name = "devnomads"
471
- version = "0.2.2"
471
+ version = "0.2.3"
472
472
  source = { editable = "." }
473
473
  dependencies = [
474
474
  { name = "httpx" },
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