From 6b96aefa2185f49e2a211a60463f17a29c4cd8a8 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 6 Oct 2020 18:35:28 -0700 Subject: [PATCH 1/3] Authority create: Email added to subject DN for cloudCA --- lemur/authorities/schemas.py | 2 ++ .../app/angular/authorities/authority/authority.js | 5 +++++ .../authorities/authority/distinguishedName.tpl.html | 9 +++++++++ .../app/angular/authorities/authority/tracking.tpl.html | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lemur/authorities/schemas.py b/lemur/authorities/schemas.py index ef6263a8..bead94ba 100644 --- a/lemur/authorities/schemas.py +++ b/lemur/authorities/schemas.py @@ -50,6 +50,8 @@ class AuthorityInputSchema(LemurInputSchema): missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY") ) state = fields.String(missing=lambda: current_app.config.get("LEMUR_DEFAULT_STATE")) + # Creating a String field instead of Email to allow empty value + email = fields.String() plugin = fields.Nested(PluginInputSchema) diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 9863bf4d..4868709b 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -124,4 +124,9 @@ angular.module('lemur') opened: false }; + $scope.populateSubjectEmail = function () { + if($scope.authority.plugin.title.toLowerCase() === 'cloudca') + $scope.authority.email = $scope.authority.owner; + }; + }); diff --git a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html index c6a7d312..ca3e1391 100644 --- a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html +++ b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html @@ -49,6 +49,15 @@ +
+ +
+ +
+
diff --git a/lemur/static/app/angular/authorities/authority/tracking.tpl.html b/lemur/static/app/angular/authorities/authority/tracking.tpl.html index 72d7e3d5..a561745f 100644 --- a/lemur/static/app/angular/authorities/authority/tracking.tpl.html +++ b/lemur/static/app/angular/authorities/authority/tracking.tpl.html @@ -21,7 +21,7 @@
+ class="form-control" ng-change="populateSubjectEmail()" required/>

You must enter an Certificate Authority owner

From c72661a87fb8e3e892f2244a0c9478123598b3c5 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 6 Oct 2020 18:50:37 -0700 Subject: [PATCH 2/3] Removing hardcoded name --- lemur/static/app/angular/authorities/authority/authority.js | 3 +-- .../angular/authorities/authority/distinguishedName.tpl.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 4868709b..a449cff5 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -125,8 +125,7 @@ angular.module('lemur') }; $scope.populateSubjectEmail = function () { - if($scope.authority.plugin.title.toLowerCase() === 'cloudca') - $scope.authority.email = $scope.authority.owner; + $scope.authority.email = $scope.authority.owner; }; }); diff --git a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html index ca3e1391..1303f200 100644 --- a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html +++ b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html @@ -49,7 +49,7 @@ -
- -

You must enter a location

+
- -

You must enter a - location

+