From 6b96aefa2185f49e2a211a60463f17a29c4cd8a8 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 6 Oct 2020 18:35:28 -0700 Subject: [PATCH] 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