Adding a new default issuer.

This commit is contained in:
kevgliss 2016-06-28 17:46:26 -07:00 committed by GitHub
parent ecbab64c35
commit eefff8497a
3 changed files with 12 additions and 2 deletions

View File

@ -57,7 +57,8 @@ class LemurDefaults(AuthenticatedResource):
state=current_app.config.get('LEMUR_DEFAULT_STATE'), state=current_app.config.get('LEMUR_DEFAULT_STATE'),
location=current_app.config.get('LEMUR_DEFAULT_LOCATION'), location=current_app.config.get('LEMUR_DEFAULT_LOCATION'),
organization=current_app.config.get('LEMUR_DEFAULT_ORGANIZATION'), 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') api.add_resource(LemurDefaults, '/defaults', endpoint='default')

View File

@ -73,7 +73,15 @@ angular.module('lemur')
PluginService.getByType('issuer').then(function (plugins) { PluginService.getByType('issuer').then(function (plugins) {
$scope.plugins = plugins; $scope.plugins = plugins;
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.authority.plugin = plugins[0];
}
}); });
$scope.roleService = RoleService; $scope.roleService = RoleService;

View File

@ -102,6 +102,7 @@ angular.module('lemur')
authority.location = defaults.location; authority.location = defaults.location;
authority.organization = defaults.organization; authority.organization = defaults.organization;
authority.organizationalUnit = defaults.organizationalUnit; authority.organizationalUnit = defaults.organizationalUnit;
authority.defaultIssuerPlugin = defaults.issuerPlugin;
}); });
}; };