From f72d69ae3bf09f217f29aa3eddb5d4fb04bd1b25 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. --- .changelog/1271.txt | 1 + certificate_packs.go | 1 + certificate_packs_test.go | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 .changelog/1271.txt diff --git a/.changelog/1271.txt b/.changelog/1271.txt new file mode 100644 index 00000000000..1d2f5841cbd --- /dev/null +++ b/.changelog/1271.txt @@ -0,0 +1 @@ +certificate_packs: add Status field to indicate the status of certificate pack diff --git a/certificate_packs.go b/certificate_packs.go index cf499de936a..802ed5dfe30 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 07aece7c01d..6dc97582470 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",