Stealing this code form the attachSubAltName function in the certificates workflow. (#655)

The function was wiping out any extensions that weren't SAN names from the authority UI.
This commit is contained in:
Neil Schelly 2017-01-18 17:24:15 -05:00 committed by kevgliss
parent 1b6f88f6fd
commit 02cfb2d877
1 changed files with 12 additions and 3 deletions

View File

@ -14,12 +14,21 @@ angular.module('lemur')
this.roles.splice(index, 1); this.roles.splice(index, 1);
}, },
attachSubAltName: function () { attachSubAltName: function () {
if (this.extensions === undefined || this.extensions.subAltNames === undefined) { if (this.extensions === undefined) {
this.extensions = {'subAltNames': {'names': []}}; this.extensions = {};
} }
if (angular.isString(this.subAltType) && angular.isString(this.subAltValue)) { if (this.extensions.subAltNames === undefined) {
this.extensions.subAltNames = {'names': []};
}
if (!angular.isString(this.subAltType)) {
this.subAltType = 'DNSName';
}
if (angular.isString(this.subAltValue) && angular.isString(this.subAltType)) {
this.extensions.subAltNames.names.push({'nameType': this.subAltType, 'value': this.subAltValue}); this.extensions.subAltNames.names.push({'nameType': this.subAltType, 'value': this.subAltValue});
//this.findDuplicates();
} }
this.subAltType = null; this.subAltType = null;