mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-08 07:38:57 +00:00
5d98e373e3
Implements core revocation infrastructure: POST /api/v1/certificates/{id}/revoke
with all 8 RFC 5280 reason codes, JSON-formatted CRL at GET /api/v1/crl, webhook
and email revocation notifications, best-effort issuer notification, and immutable
revocation audit trail. Includes 48 new tests across service, handler, integration,
and domain layers (600+ total). Fixes 3 pre-existing test bugs (team_test error
matching, agent_group delete status code, team handler per_page validation).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
42 lines
1.6 KiB
Go
42 lines
1.6 KiB
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// NotificationEvent records a notification sent to users about certificate events.
|
|
type NotificationEvent struct {
|
|
ID string `json:"id"`
|
|
Type NotificationType `json:"type"`
|
|
CertificateID *string `json:"certificate_id,omitempty"`
|
|
Channel NotificationChannel `json:"channel"`
|
|
Recipient string `json:"recipient"`
|
|
Message string `json:"message"`
|
|
SentAt *time.Time `json:"sent_at,omitempty"`
|
|
Status string `json:"status"`
|
|
Error *string `json:"error,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
// NotificationType represents the event that triggered a notification.
|
|
type NotificationType string
|
|
|
|
const (
|
|
NotificationTypeExpirationWarning NotificationType = "ExpirationWarning"
|
|
NotificationTypeRenewalSuccess NotificationType = "RenewalSuccess"
|
|
NotificationTypeRenewalFailure NotificationType = "RenewalFailure"
|
|
NotificationTypeDeploymentSuccess NotificationType = "DeploymentSuccess"
|
|
NotificationTypeDeploymentFailure NotificationType = "DeploymentFailure"
|
|
NotificationTypePolicyViolation NotificationType = "PolicyViolation"
|
|
NotificationTypeRevocation NotificationType = "Revocation"
|
|
)
|
|
|
|
// NotificationChannel represents the communication medium for a notification.
|
|
type NotificationChannel string
|
|
|
|
const (
|
|
NotificationChannelEmail NotificationChannel = "Email"
|
|
NotificationChannelWebhook NotificationChannel = "Webhook"
|
|
NotificationChannelSlack NotificationChannel = "Slack"
|
|
)
|