Skip to content

Commit c538e4e

Browse files
committed
Prepare release v1.0.2
1 parent 1d482bb commit c538e4e

File tree

7 files changed

+181
-117
lines changed

7 files changed

+181
-117
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# CertApi
1+
CertApi
2+
=============================
23

3-
CertApi is a Python package for requesting SSL certificates from ACME.
4-
This is to be used as a base library for building other tools, or to integrate Certificate creation feature in you app.
4+
Certapi talks with DNS provider and ACME to issue SSL certificates and save it to a keystore.
5+
6+
CertApi is a base library for building other tools, or to integrate Certificate creation feature in your app. CertAPI also provides HTTP api server and can be deployed using Docker
57

68
[![Build Status](https://github.com/mesudip/certapi/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/mesudip/certapi/actions/workflows/tests.yml)
79
[![codecov](https://codecov.io/github/mesudip/certapi/graph/badge.svg?token=NYTNCH29IT)](https://codecov.io/github/mesudip/certapi)
810
[![PyPI version](https://img.shields.io/pypi/v/certapi.svg)](https://pypi.org/project/certapi/)
911

1012

11-
For a detailed list of changes, please refer to the [CHANGELOG.md](CHANGELOG.md).
1213

1314
## Installation
1415

@@ -76,12 +77,11 @@ cert_manager = AcmeCertManager(
7677
key_store=key_store,
7778
cert_issuer=cert_issuer,
7879
challenge_solvers=[dns_solver], # other solvers can be used
79-
renew_threshold_days=7
80-
)
80+
)
8181
cert_manager.setup()
8282

8383
# 4. Issue or Reuse Certificate
84-
# Automatically checks keystore and renews only if necessary
84+
# Automatically checks sand saves to keystore. Renews only if necessary.
8585
response = cert_manager.issue_certificate(["example.com", "www.example.com"])
8686

8787
for cert_data in response.issued:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="certapi",
5-
version="1.0.0",
5+
version="1.0.2",
66
packages=find_packages(where="src"),
77
package_dir={"": "src"},
88
install_requires=[

src/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ def acme_challenge(cid):
7979
def handle_certapi_error(error: CertApiException):
8080
print(f"CertApiException [{error.__class__.__name__}]: {error}", file=sys.stderr)
8181
print_filtered_traceback(error)
82-
82+
8383
status = 400
8484
if isinstance(error, AcmeHttpError):
8585
status = error.response.status_code
8686
if status == 200:
8787
status = 400
88-
88+
8989
return error.json_obj(), status
9090

9191

src/certapi/acme/AcmeError.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def __init__(self, response: requests.Response, step: str):
3232
AcmeError.__init__(self, message, detail, step)
3333
self.response = response
3434

35-
3635
def extract_acme_response_error(self):
3736
message = None
3837
error = None
@@ -44,12 +43,12 @@ def extract_acme_response_error(self):
4443
if not invalid_challenges:
4544
# Fallback if no invalid challenge found but status is invalid
4645
return (None, res_json)
47-
46+
4847
failed_challenge: dict = invalid_challenges[0]
4948
error = failed_challenge.get("error")
5049
if not error:
5150
return (None, res_json)
52-
51+
5352
err_detail: str = error.get("detail", "")
5453
err_type: str = error.get("type", "")
5554
validation_record: dict = failed_challenge.get("validationRecord")
@@ -70,7 +69,9 @@ def extract_acme_response_error(self):
7069
error["dns"] = {"error": error}
7170
message = err_detail
7271
else:
73-
validation_record = validation_record[0] if isinstance(validation_record, list) and validation_record else {}
72+
validation_record = (
73+
validation_record[0] if isinstance(validation_record, list) and validation_record else {}
74+
)
7475
error["hostname"] = validation_record.get("hostname", "unknown")
7576
error["dns"] = {
7677
"resolved": validation_record.get("addressesResolved"),

src/certapi/client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .cert_manager_client import CertManagerClient
1+
from .cert_manager_client import CertManagerClient

src/certapi/server/api.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def create_api_resources(api_ns, cert_manager: AcmeCertManager, renew_queue_size
9191
obtain_parser.add_argument("organization", type=str, help="Organization name")
9292
obtain_parser.add_argument("user_id", type=str, help="User ID")
9393
obtain_parser.add_argument("renew_threshold_days", type=int, help="Threshold in days for certificate reuse")
94-
obtain_parser.add_argument("skip_failing", type=inputs.boolean, default=False, help="Allow issuance to proceed if some domains fail verification")
94+
obtain_parser.add_argument(
95+
"skip_failing",
96+
type=inputs.boolean,
97+
default=False,
98+
help="Allow issuance to proceed if some domains fail verification",
99+
)
95100

96101
@api_ns.route("/obtain")
97102
class ObtainCert(Resource):
@@ -114,7 +119,7 @@ def get(self):
114119
for solver in reversed(cert_manager.challenge_solvers):
115120
if solver.supports_domain_strict(h):
116121
verified_hostnames.append(h)
117-
122+
118123
hostnames = verified_hostnames
119124

120125
if not hostnames and not skip_failing:
@@ -134,7 +139,7 @@ def get(self):
134139
user_id=args["user_id"],
135140
renew_threshold_days=args.get("renew_threshold_days"),
136141
)
137-
142+
138143
print(data)
139144
if data:
140145
res_json = data.to_json()

0 commit comments

Comments
 (0)