Add support for filtering github login by org

This commit is contained in:
Joseph Schorr 2015-03-03 19:58:42 -05:00
parent 9e61668c34
commit 4ca5d9b04b
7 changed files with 86 additions and 5 deletions

View file

@ -262,6 +262,15 @@
display: block;
}
.config-list-field-element input {
vertical-align: middle;
}
.config-list-field-element .item-delete {
display: inline-block;
margin-left: 20px;
}
.config-list-field-element input {
width: 350px;
}

View file

@ -400,6 +400,28 @@
</span>
</td>
</tr>
<tr>
<td>Organization Filtering:</td>
<td>
<div class="co-checkbox">
<input id="ftghlof" type="checkbox"
ng-model="config.GITHUB_LOGIN_CONFIG.ORG_RESTRICT">
<label for="ftghlof">Restrict By Organization Membership</label>
</div>
<div class="help-text" style="margin-bottom: 20px;">
If enabled, only members of specified GitHub
<span ng-if="mapped.GITHUB_LOGIN_KIND == 'enterprise'">Enterprise</span> organizations will be allowed to login via GitHub
<span ng-if="mapped.GITHUB_LOGIN_KIND == 'enterprise'">Enterprise</span>.
</div>
<span class="config-list-field"
item-title="Organization ID"
binding="config.GITHUB_LOGIN_CONFIG.ALLOWED_ORGANIZATIONS"
ng-if="config.GITHUB_LOGIN_CONFIG.ORG_RESTRICT">
</span>
</td>
</tr>
</table>
</div>
</div> <!-- /GitHub Authentication -->

View file

@ -124,7 +124,7 @@ function SetupCtrl($scope, $timeout, ApiService, Features, UserService, Containe
$scope.showSuperuserPanel = function() {
$('#setupModal').modal('hide');
var prefix = $scope.hasSSL ? 'https' : 'http';
var hostname = $scope.hostname;
var hostname = $scope.hostname || document.location.hostname;
window.location = prefix + '://' + hostname + '/superuser';
};

View file

@ -23,7 +23,7 @@ angular.module('quay').factory('KeyService', ['$location', 'Config', function($l
keyService['githubTriggerEndpoint'] = oauth['GITHUB_TRIGGER_CONFIG']['GITHUB_ENDPOINT'];
keyService['githubTriggerAuthorizeUrl'] = oauth['GITHUB_TRIGGER_CONFIG']['AUTHORIZE_ENDPOINT'];
keyService['githubLoginScope'] = 'user:email';
keyService['githubLoginScope'] = 'user:email,read:org';
keyService['googleLoginScope'] = 'openid email';
keyService.isEnterprise = function(service) {