Skip to content

Commit cbfcfa4

Browse files
committed
Add constants with Let's Encrypt directories urls
1 parent 68b2d9d commit cbfcfa4

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/aioacme/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from aioacme._client import Client
2+
from aioacme._directories import LETS_ENCRYPT_DIRECTORY, LETS_ENCRYPT_STAGING_DIRECTORY
23
from aioacme._exceptions import AcmeError
34
from aioacme._models import (
45
Authorization,
@@ -16,6 +17,10 @@
1617
from aioacme._version import __version__, __version_tuple__
1718

1819
__all__ = [
20+
'Client',
21+
'LETS_ENCRYPT_DIRECTORY',
22+
'LETS_ENCRYPT_STAGING_DIRECTORY',
23+
'AcmeError',
1924
'Authorization',
2025
'AuthorizationStatus',
2126
'Challenge',
@@ -27,8 +32,6 @@
2732
'Order',
2833
'OrderStatus',
2934
'RevocationReason',
30-
'AcmeError',
31-
'Client',
3235
'__version__',
3336
'__version_tuple__',
3437
]

src/aioacme/_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from cryptography import x509
1414
from cryptography.hazmat.primitives import serialization
1515

16+
from aioacme._directories import LETS_ENCRYPT_STAGING_DIRECTORY
1617
from aioacme._exceptions import AcmeError
1718
from aioacme._jwk import JWK, jwk_thumbprint, make_jwk
1819
from aioacme._jws import jws_encode
@@ -40,7 +41,7 @@ def __init__(
4041
self,
4142
*,
4243
account_key: PrivateKeyTypes,
43-
directory_url: str = 'https://acme-staging-v02.api.letsencrypt.org/directory',
44+
directory_url: str = LETS_ENCRYPT_STAGING_DIRECTORY,
4445
account_uri: str | None = None,
4546
) -> None:
4647
"""

src/aioacme/_directories.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
LETS_ENCRYPT_DIRECTORY: str = 'https://acme-v02.api.letsencrypt.org/directory'
2+
LETS_ENCRYPT_STAGING_DIRECTORY: str = 'https://acme-staging-v02.api.letsencrypt.org/directory'

0 commit comments

Comments
 (0)