Skip to content

Implement acme.sh-based certificate revocation lifecycle - #9

Merged
streaky merged 10 commits into
mainfrom
cert-revoke
Jul 24, 2026
Merged

Implement acme.sh-based certificate revocation lifecycle#9
streaky merged 10 commits into
mainfrom
cert-revoke

Conversation

@streaky

@streaky streaky commented Jul 24, 2026

Copy link
Copy Markdown
Owner

This pull request adds durable, idempotent support for revoking issued certificates at their ACME certificate authority, including API, backend, database, and documentation changes. It introduces a new /v1/certificates/{id}/revoke endpoint, persists revocation requests and their statuses, and ensures that revocation is handled safely and consistently, including error handling and idempotency via an Idempotency-Key.

API and Documentation:

  • Added a new POST /v1/certificates/{id}/revoke endpoint for revoking a certificate at its CA, with support for RFC 5280 reason codes and idempotency. (README.md, acme_api/routers/certificates.py, [1] [2] [3]
  • Updated documentation to clarify the difference between local deletion (DELETE) and CA revocation (POST /revoke). (README.md, README.mdR199-R220)

Database and Models:

  • Introduced a new certificate_revocations table and corresponding SQLAlchemy model to persist revocation requests, their status, and metadata. (acme_api/models/certificate_revocation.py, alembic/versions/a7c3e9d2b4f1_add_certificate_revocations.py, [1] [2]
  • Linked revocations to certificates via a new relationship. (acme_api/models/certificate.py, acme_api/models/certificate.pyR178-R183)

Backend and Business Logic:

  • Implemented backend support for invoking acme.sh to perform the revocation, including error handling and idempotency guarantees. (acme_api/backend/acmesh_backend.py, acme_api/services/certificate_revocations.py, [1] [2]
  • Extended the backend protocol and mock backend to support the new revocation operation. (acme_api/backend/protocol.py, acme_api/backend/mock_backend.py, [1] [2]

Schemas and Validation:

  • Added Pydantic schemas for revocation requests and responses, including validation to reject unused RFC 5280 reason codes. (acme_api/schemas/certificate.py, acme_api/schemas/certificate.pyR73-R103)

Testing Support:

  • Enhanced test helpers to track and control revocation operations for backend testing. (tests/helpers/api.py, [1] [2] [3]

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as outdated.

@streaky
streaky merged commit a98af91 into main Jul 24, 2026
5 checks passed
@streaky
streaky deleted the cert-revoke branch July 24, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant