From eefff8497adb3ae58055e4ac6b2469866e377c6c Mon Sep 17 00:00:00 2001 From: kevgliss Date: Tue, 28 Jun 2016 17:46:26 -0700 Subject: [PATCH] Adding a new default issuer. --- lemur/defaults/views.py | 3 ++- .../app/angular/authorities/authority/authority.js | 10 +++++++++- lemur/static/app/angular/authorities/services.js | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lemur/defaults/views.py b/lemur/defaults/views.py index d053aef7..46987ab7 100644 --- a/lemur/defaults/views.py +++ b/lemur/defaults/views.py @@ -57,7 +57,8 @@ class LemurDefaults(AuthenticatedResource): state=current_app.config.get('LEMUR_DEFAULT_STATE'), location=current_app.config.get('LEMUR_DEFAULT_LOCATION'), organization=current_app.config.get('LEMUR_DEFAULT_ORGANIZATION'), - organizationalUnit=current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT') + organizationalUnit=current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT'), + issuerPlugin=current_app.config.get('LEMUR_DEFAULT_ISSUER_PLUGIN') ) api.add_resource(LemurDefaults, '/defaults', endpoint='default') diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index c67e7513..d4b4bdde 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -73,7 +73,15 @@ angular.module('lemur') PluginService.getByType('issuer').then(function (plugins) { $scope.plugins = plugins; - $scope.authority.plugin = plugins[0]; + if ($scope.authority.defaultIssuerPlugin) { + plugins.forEach(function(plugin) { + if (plugin.slug === $scope.authority.defaultIssuerPlugin) { + $scope.authority.plugin = plugin; + } + }); + } else { + $scope.authority.plugin = plugins[0]; + } }); $scope.roleService = RoleService; diff --git a/lemur/static/app/angular/authorities/services.js b/lemur/static/app/angular/authorities/services.js index 4af4daab..fa976b52 100644 --- a/lemur/static/app/angular/authorities/services.js +++ b/lemur/static/app/angular/authorities/services.js @@ -102,6 +102,7 @@ angular.module('lemur') authority.location = defaults.location; authority.organization = defaults.organization; authority.organizationalUnit = defaults.organizationalUnit; + authority.defaultIssuerPlugin = defaults.issuerPlugin; }); };