From dc97744c638bc78f9c4f12af86962cd91df21bb4 Mon Sep 17 00:00:00 2001 From: Jamie Curnow Date: Fri, 20 Aug 2021 09:38:30 +1000 Subject: [PATCH] Finish adding is_ecc field --- .../api_docs/components/CertificateObject.json | 6 ++++++ .../paths/certificates/certificateID/get.json | 1 + .../paths/certificates/certificateID/put.json | 1 + .../embed/api_docs/paths/certificates/get.json | 1 + .../api_docs/paths/certificates/post.json | 1 + backend/internal/api/schema/certificates.go | 18 ++++++++++++++++++ 6 files changed, 28 insertions(+) diff --git a/backend/embed/api_docs/components/CertificateObject.json b/backend/embed/api_docs/components/CertificateObject.json index 24b914f1..687778ee 100644 --- a/backend/embed/api_docs/components/CertificateObject.json +++ b/backend/embed/api_docs/components/CertificateObject.json @@ -12,6 +12,7 @@ "certificate_authority_id", "dns_provider_id", "name", + "is_ecc", "status", "domain_names" ], @@ -78,6 +79,11 @@ "provided" ] }, + "is_ecc": { + "type": "integer", + "minimum": 0, + "maximum": 1 + }, "error_message": { "type": "string" } diff --git a/backend/embed/api_docs/paths/certificates/certificateID/get.json b/backend/embed/api_docs/paths/certificates/certificateID/get.json index 99613b67..e26988ff 100644 --- a/backend/embed/api_docs/paths/certificates/certificateID/get.json +++ b/backend/embed/api_docs/paths/certificates/certificateID/get.json @@ -48,6 +48,7 @@ "domain_names": [ "test1.jc21.com.au" ], + "is_ecc": 0, "status": "ready" } } diff --git a/backend/embed/api_docs/paths/certificates/certificateID/put.json b/backend/embed/api_docs/paths/certificates/certificateID/put.json index 514790eb..3574d87b 100644 --- a/backend/embed/api_docs/paths/certificates/certificateID/put.json +++ b/backend/embed/api_docs/paths/certificates/certificateID/put.json @@ -57,6 +57,7 @@ "domain_names": [ "test1.jc21.com.au" ], + "is_ecc": 0, "status": "ready" } } diff --git a/backend/embed/api_docs/paths/certificates/get.json b/backend/embed/api_docs/paths/certificates/get.json index 1a31135c..d4cfcc79 100644 --- a/backend/embed/api_docs/paths/certificates/get.json +++ b/backend/embed/api_docs/paths/certificates/get.json @@ -75,6 +75,7 @@ "domain_names": [ "test1.jc21.com.au" ], + "is_ecc": 0, "status": "ready" } ] diff --git a/backend/embed/api_docs/paths/certificates/post.json b/backend/embed/api_docs/paths/certificates/post.json index b4566e6c..5a332270 100644 --- a/backend/embed/api_docs/paths/certificates/post.json +++ b/backend/embed/api_docs/paths/certificates/post.json @@ -44,6 +44,7 @@ "domain_names": [ "test1.jc21.com.au" ], + "is_ecc": 0, "status": "ready" } } diff --git a/backend/internal/api/schema/certificates.go b/backend/internal/api/schema/certificates.go index 5014b636..1326f6f1 100644 --- a/backend/internal/api/schema/certificates.go +++ b/backend/internal/api/schema/certificates.go @@ -12,6 +12,7 @@ func createCertificateCustom() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "required": [ "type", "name", @@ -34,6 +35,7 @@ func createCertificateHTTP() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "required": [ "type", "certificate_authority_id", @@ -47,6 +49,11 @@ func createCertificateHTTP() string { "domain_names": %s, "meta": { "type": "object" + }, + "is_ecc": { + "type": "integer", + "minimum": 0, + "maximum": 1 } } }`, strictString("http"), intMinOne, stringMinMax(1, 100), domainNames()) @@ -58,6 +65,7 @@ func createCertificateDNS() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "required": [ "type", "certificate_authority_id", @@ -73,6 +81,11 @@ func createCertificateDNS() string { "domain_names": %s, "meta": { "type": "object" + }, + "is_ecc": { + "type": "integer", + "minimum": 0, + "maximum": 1 } } }`, strictString("dns"), intMinOne, intMinOne, stringMinMax(1, 100), domainNames()) @@ -84,6 +97,7 @@ func createCertificateMkcert() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "required": [ "type", "name", @@ -104,6 +118,7 @@ func updateCertificateHTTP() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "minProperties": 1, "properties": { "certificate_authority_id": %s, @@ -120,6 +135,7 @@ func updateCertificateDNS() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "minProperties": 1, "properties": { "certificate_authority_id": %s, @@ -137,6 +153,7 @@ func updateCertificateCustom() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "minProperties": 1, "properties": { "name": %s, @@ -152,6 +169,7 @@ func updateCertificateMkcert() string { return fmt.Sprintf(` { "type": "object", + "additionalProperties": false, "minProperties": 1, "properties": { "name": %s,