Merge pull request #59 from kevgliss/cleanup

Cleanup
This commit is contained in:
kevgliss 2015-08-29 10:30:03 -07:00
commit 80136834b5
6 changed files with 13 additions and 47 deletions

View File

@ -233,8 +233,10 @@ Verisign/Symantec and CloudCA
Authentication Authentication
-------------- --------------
Lemur currently supports Basic Authentication and Ping OAuth2, additional flows can be added relatively easily Lemur currently supports Basic Authentication and Ping OAuth2 out of the box, additional flows can be added relatively easily
If you are not using PING you do not need to configure any of these options If you are not using Ping you do not need to configure any of these options.
For more information about how to use social logins, see: `Satellizer <https://github.com/sahat/satellizer>`_
.. data:: PING_SECRET .. data:: PING_SECRET
:noindex: :noindex:

View File

@ -183,10 +183,6 @@ class Ping(Resource):
# update their google 'roles' # update their google 'roles'
roles = [] roles = []
# Legacy edge case - 'admin' has some special privileges associated with it
if 'secops@netflix.com' in profile['googleGroups']:
roles.append(role_service.get_by_name('admin'))
for group in profile['googleGroups']: for group in profile['googleGroups']:
role = role_service.get_by_name(group) role = role_service.get_by_name(group)
if not role: if not role:
@ -196,10 +192,12 @@ class Ping(Resource):
# if we get an sso user create them an account # if we get an sso user create them an account
# we still pick a random password in case sso is down # we still pick a random password in case sso is down
if not user: if not user:
# every user is an operator (tied to the verisignCA)
v = role_service.get_by_name('verisign') # every user is an operator (tied to a default role)
if v: if current_app.config.get('LEMUR_DEFAULT_ROLE'):
roles.append(v) v = role_service.get_by_name(current_app.config.get('LEMUR_DEFAULT_ROLE'))
if v:
roles.append(v)
user = user_service.create( user = user_service.create(
profile['email'], profile['email'],

View File

@ -25,7 +25,7 @@ var lemur = angular
}); });
$authProvider.oauth2({ $authProvider.oauth2({
name: 'ping', name: 'example',
url: 'http://localhost:5000/api/1/auth/ping', url: 'http://localhost:5000/api/1/auth/ping',
redirectUri: 'http://localhost:3000/', redirectUri: 'http://localhost:3000/',
clientId: 'client-id', clientId: 'client-id',

View File

@ -3,8 +3,8 @@
<div class="login"> <div class="login">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12"> <div class="col-xs-12 col-sm-12 col-md-12">
<button class="btn btn-block btn-default" ng-click="authenticate('ping')"> <button class="btn btn-block btn-default" ng-click="authenticate('Example')">
Login with Meechum Login with Example
</button> </button>
</div> </div>
</div> </div>

View File

@ -1,18 +0,0 @@
'use strict';
angular.module('lemur')
.config(function config($routeProvider) {
$routeProvider.when('/unlock', {
templateUrl: '/angular/authentication/unlock/unlock.tpl.html',
controller: 'UnlockCtrl'
});
})
.controller('UnlockCtrl', function ($scope, $location, lemurRestangular, messageService) {
$scope.unlock = function () {
lemurRestangular.one('unlock').customPOST({'password': $scope.password})
.then(function (data) {
messageService.addMessage(data);
$location.path('/dashboard');
});
};
});

View File

@ -1,16 +0,0 @@
<h2 class="featurette-heading">Unlock <span class="text-muted"><small>Assume 9 is twice 5; how will you write 6 times 5 in the same system of notation?</small></span></h2>
<form class="form-horizontal" _lpchecked="1">
<fieldset class="col-lg-offset-4">
<div class="form-group">
<div class="col-lg-4">
<input type="password" ng-model="password" placeholder="Password" class="form-control"/>
</div>
</div>
<hr class="featurette-divider">
<div class="form-group">
<div class="col-lg-4">
<button ng-click="unlock()" class="btn btn-success">Unlock</button>
</div>
</div>
</fieldset>
</form>