From dc4965f27daa6715fb3045cad79dc5efffb45a42 Mon Sep 17 00:00:00 2001 From: Alexander Scheel Date: Tue, 16 Aug 2022 15:57:05 -0400 Subject: [PATCH] Fix naming of permitted_dns_domains in webui (#16739) * Fix naming of permitted_dns_domains in webui PKI has consistently used permitted_dns_domains since it was originally introduced as a parameter. However, it appears the Web UI was updated to add this field, but used an incorrect internal identifier (permittedDnsNames rather than permittedDnsDomains). This triggers a warning from the backend about an unknown parameter, and the domain restriction isn't added: > Endpoint ignored these unrecognized parameters: [permitted_dns_names] Signed-off-by: Alexander Scheel * Add changelog Signed-off-by: Alexander Scheel Signed-off-by: Alexander Scheel --- changelog/16739.txt | 3 +++ ui/app/models/pki-ca-certificate-sign.js | 4 ++-- ui/app/models/pki-ca-certificate.js | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changelog/16739.txt diff --git a/changelog/16739.txt b/changelog/16739.txt new file mode 100644 index 000000000..00d190f98 --- /dev/null +++ b/changelog/16739.txt @@ -0,0 +1,3 @@ +```release-note:bug +ui: Fix naming of permitted_dns_domains form parameter on CA creation (root generation and sign intermediate). +``` diff --git a/ui/app/models/pki-ca-certificate-sign.js b/ui/app/models/pki-ca-certificate-sign.js index 2f9ac1722..84f5b7335 100644 --- a/ui/app/models/pki-ca-certificate-sign.js +++ b/ui/app/models/pki-ca-certificate-sign.js @@ -14,7 +14,7 @@ export default Certificate.extend({ maxPathLength: attr('number', { defaultValue: -1, }), - permittedDnsNames: attr('string', { + permittedDnsDomains: attr('string', { label: 'Permitted DNS domains', }), ou: attr({ @@ -51,7 +51,7 @@ export default Certificate.extend({ 'ttl', 'excludeCnFromSans', 'maxPathLength', - 'permittedDnsNames', + 'permittedDnsDomains', 'ou', 'organization', 'otherSans', diff --git a/ui/app/models/pki-ca-certificate.js b/ui/app/models/pki-ca-certificate.js index 28b07084d..ec444c138 100644 --- a/ui/app/models/pki-ca-certificate.js +++ b/ui/app/models/pki-ca-certificate.js @@ -63,7 +63,7 @@ export default Certificate.extend({ label: 'PEM bundle', editType: 'file', }), - permittedDnsNames: attr('string', { + permittedDnsDomains: attr('string', { label: 'Permitted DNS domains', }), privateKeyFormat: attr('string', { @@ -117,7 +117,7 @@ export default Certificate.extend({ 'keyType', 'keyBits', 'maxPathLength', - 'permittedDnsNames', + 'permittedDnsDomains', 'excludeCnFromSans', 'ou', 'organization',