From 44b5ac58ac2498c56fc6cbc3fba15cbcb4b76679 Mon Sep 17 00:00:00 2001 From: Yecheng Fu Date: Fri, 21 Apr 2023 20:12:27 +0800 Subject: [PATCH] certificate_packs: add `Status` field This field is essential for automating tasks related to certificate packs. For instance, upon creating a certificate pack, the validation process must be repeatedly initiated until the status transitions to active. --- certificate_packs.go | 1 + certificate_packs_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/certificate_packs.go b/certificate_packs.go index cf499de936ad..802ed5dfe305 100644 --- a/certificate_packs.go +++ b/certificate_packs.go @@ -38,6 +38,7 @@ type CertificatePack struct { Hosts []string `json:"hosts"` Certificates []CertificatePackCertificate `json:"certificates"` PrimaryCertificate string `json:"primary_certificate"` + Status string `json:"status"` ValidationRecords []SSLValidationRecord `json:"validation_records,omitempty"` ValidationErrors []SSLValidationError `json:"validation_errors,omitempty"` ValidationMethod string `json:"validation_method"` diff --git a/certificate_packs_test.go b/certificate_packs_test.go index 07aece7c01d9..6dc975824701 100644 --- a/certificate_packs_test.go +++ b/certificate_packs_test.go @@ -42,6 +42,7 @@ var ( ID: "3822ff90-ea29-44df-9e55-21300bb9419b", Type: "advanced", Hosts: []string{"example.com", "*.example.com", "www.example.com"}, + Status: "initializing", ValidationMethod: "txt", ValidityDays: 90, CertificateAuthority: "lets_encrypt", @@ -244,6 +245,7 @@ func TestRestartAdvancedCertificateValidation(t *testing.T) { ID: "3822ff90-ea29-44df-9e55-21300bb9419b", Type: "advanced", Hosts: []string{"example.com", "*.example.com", "www.example.com"}, + Status: "initializing", ValidityDays: 365, ValidationMethod: "txt", CertificateAuthority: "lets_encrypt",