mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-07 15:51:30 +00:00
feat(V2.2): bulk revocation — filter-based fleet-wide certificate revocation
Add POST /api/v1/certificates/bulk-revoke with filter criteria (profile_id, owner_id, agent_id, issuer_id, team_id, certificate_ids), partial-failure tolerance, and audit trail. Includes MCP tool, CLI command (certs bulk-revoke), server-side bulk modal in GUI replacing client-side sequential loop, OpenAPI spec, compliance mapping updates, and 21 new tests (12 service, 7 handler, 1 CLI, 1 frontend). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -381,6 +381,34 @@ paths:
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalError"
|
||||
|
||||
# ─── Bulk Revocation ─────────────────────────────────────────────────
|
||||
/api/v1/certificates/bulk-revoke:
|
||||
post:
|
||||
tags: [Certificates]
|
||||
summary: Bulk revoke certificates
|
||||
description: |
|
||||
Revokes all certificates matching the given filter criteria. At least one criterion
|
||||
is required (safety guard against accidental mass revocation). Reuses the single-cert
|
||||
revocation flow per certificate with partial-failure tolerance.
|
||||
operationId: bulkRevokeCertificates
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/BulkRevokeRequest"
|
||||
responses:
|
||||
"200":
|
||||
description: Bulk revocation result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/BulkRevokeResult"
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"500":
|
||||
$ref: "#/components/responses/InternalError"
|
||||
|
||||
# ─── Certificate Export ──────────────────────────────────────────────
|
||||
/api/v1/certificates/{id}/export/pem:
|
||||
get:
|
||||
@@ -2892,6 +2920,59 @@ components:
|
||||
- certificateHold
|
||||
- privilegeWithdrawn
|
||||
|
||||
BulkRevokeRequest:
|
||||
type: object
|
||||
required: [reason]
|
||||
properties:
|
||||
reason:
|
||||
$ref: "#/components/schemas/RevocationReason"
|
||||
profile_id:
|
||||
type: string
|
||||
description: Revoke all certificates matching this profile
|
||||
owner_id:
|
||||
type: string
|
||||
description: Revoke all certificates owned by this owner
|
||||
agent_id:
|
||||
type: string
|
||||
description: Revoke all certificates deployed via this agent
|
||||
issuer_id:
|
||||
type: string
|
||||
description: Revoke all certificates issued by this issuer
|
||||
team_id:
|
||||
type: string
|
||||
description: Revoke all certificates owned by members of this team
|
||||
certificate_ids:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
description: Explicit list of certificate IDs to revoke
|
||||
|
||||
BulkRevokeResult:
|
||||
type: object
|
||||
properties:
|
||||
total_matched:
|
||||
type: integer
|
||||
description: Number of certificates matching the criteria
|
||||
total_revoked:
|
||||
type: integer
|
||||
description: Number of certificates successfully revoked
|
||||
total_skipped:
|
||||
type: integer
|
||||
description: Number of certificates skipped (already revoked or archived)
|
||||
total_failed:
|
||||
type: integer
|
||||
description: Number of certificates that failed to revoke
|
||||
errors:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
certificate_id:
|
||||
type: string
|
||||
error:
|
||||
type: string
|
||||
description: Per-certificate error details for failed revocations
|
||||
|
||||
# ─── Issuers ─────────────────────────────────────────────────────
|
||||
IssuerType:
|
||||
type: string
|
||||
|
||||
Reference in New Issue
Block a user