From f35395635383c96ed7452e1efdc530befd1a9d7c Mon Sep 17 00:00:00 2001 From: Neil Schelly Date: Wed, 18 Jan 2017 17:31:17 -0500 Subject: [PATCH] Many fixes to authority/certificate extensions pages (#659) * Aligning certificate creation between authority and certificate workflows * Correctly missing and mis-named fields in schemas * Re-ordering KeyUsage and ExtendedKeyUsage for consistency and clarity * Adding client authentication to the authority options. * Missing blank lines for pyflakes linting * Updating tests for new fields/names/typos --- lemur/schemas.py | 6 ++- .../authorities/authority/extensions.tpl.html | 50 +++++++++++-------- .../certificates/certificate/options.tpl.html | 26 ++++++---- lemur/tests/test_certificates.py | 12 +++-- 4 files changed, 58 insertions(+), 36 deletions(-) diff --git a/lemur/schemas.py b/lemur/schemas.py index 447429d4..d6ece2e2 100644 --- a/lemur/schemas.py +++ b/lemur/schemas.py @@ -191,6 +191,8 @@ class KeyUsageSchema(BaseExtensionSchema): use_key_encipherment = fields.Boolean() use_digital_signature = fields.Boolean() use_non_repudiation = fields.Boolean() + use_key_agreement = fields.Boolean() + use_key_cert_sign = fields.Boolean() class ExtendedKeyUsageSchema(BaseExtensionSchema): @@ -199,8 +201,10 @@ class ExtendedKeyUsageSchema(BaseExtensionSchema): use_eap_over_lan = fields.Boolean() use_eap_over_ppp = fields.Boolean() use_ocsp_signing = fields.Boolean() - use_smart_card_authentication = fields.Boolean() + use_smart_card_logon = fields.Boolean() use_timestamping = fields.Boolean() + use_code_signing = fields.Boolean() + use_email_protection = fields.Boolean() class SubjectKeyIdentifierSchema(BaseExtensionSchema): diff --git a/lemur/static/app/angular/authorities/authority/extensions.tpl.html b/lemur/static/app/angular/authorities/authority/extensions.tpl.html index 28496440..140eb33e 100644 --- a/lemur/static/app/angular/authorities/authority/extensions.tpl.html +++ b/lemur/static/app/angular/authorities/authority/extensions.tpl.html @@ -55,16 +55,11 @@
-
- -
+
+
+ -
-
- +
+
+ -
+ +
@@ -94,21 +94,31 @@
+
+
+
-
- -
+
+
+
+
+ +
@@ -150,7 +160,7 @@
diff --git a/lemur/static/app/angular/certificates/certificate/options.tpl.html b/lemur/static/app/angular/certificates/certificate/options.tpl.html index 4abe13c5..da20ec83 100644 --- a/lemur/static/app/angular/certificates/certificate/options.tpl.html +++ b/lemur/static/app/angular/certificates/certificate/options.tpl.html @@ -97,19 +97,19 @@
@@ -143,21 +143,26 @@
-
- -
+
+ +
+
+ +
diff --git a/lemur/tests/test_certificates.py b/lemur/tests/test_certificates.py index 25fc9b31..c1c23608 100644 --- a/lemur/tests/test_certificates.py +++ b/lemur/tests/test_certificates.py @@ -307,8 +307,10 @@ def test_extended_key_usage_schema(): 'useEapOverLAN': True, 'useEapOverPPP': True, 'useOCSPSigning': True, - 'useSmartCardAuthentication': True, - 'useTimestamping': True + 'useSmartCardLogon': True, + 'useTimestamping': True, + 'useCodeSigning': True, + 'useEmailProtection': True } data, errors = ExtendedKeyUsageSchema().load(input_data) @@ -320,8 +322,10 @@ def test_extended_key_usage_schema(): 'use_eap_over_lan': True, 'use_eap_over_ppp': True, 'use_ocsp_signing': True, - 'use_smart_card_authentication': True, - 'use_timestamping': True + 'use_smart_card_logon': True, + 'use_timestamping': True, + 'use_code_signing': True, + 'use_email_protection': True }