Remove dex from the CLI username whitelist
Dex isn't an internal auth service (one that replaces the database), but an *external* one (one that supplements the internal auth). Therefore, it should not be included in this list. Fixes https://jira.coreos.com/browse/QUAY-1333
This commit is contained in:
parent
c4f7b28dc6
commit
7b733a75cc
2 changed files with 2 additions and 18 deletions
|
@ -20,7 +20,6 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var userService = {};
|
var userService = {};
|
||||||
var _EXTERNAL_SERVICES = ['ldap', 'jwtauthn', 'keystone', 'dex'];
|
|
||||||
|
|
||||||
userService.hasEverLoggedIn = function() {
|
userService.hasEverLoggedIn = function() {
|
||||||
return CookieService.get('quay.loggedin') == 'true';
|
return CookieService.get('quay.loggedin') == 'true';
|
||||||
|
@ -167,21 +166,6 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
userService.getCLIUsername = function() {
|
|
||||||
if (!userResponse) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var externalUsername = null;
|
|
||||||
userResponse.logins.forEach(function(login) {
|
|
||||||
if (_EXTERNAL_SERVICES.indexOf(login.service) >= 0) {
|
|
||||||
externalUsername = login.service_identifier;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return externalUsername || userResponse.username;
|
|
||||||
};
|
|
||||||
|
|
||||||
userService.currentUser = function() {
|
userService.currentUser = function() {
|
||||||
return userResponse;
|
return userResponse;
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) {
|
||||||
};
|
};
|
||||||
|
|
||||||
var userService = {};
|
var userService = {};
|
||||||
var _EXTERNAL_SERVICES = ['ldap', 'jwtauthn', 'keystone', 'dex'];
|
var _INTERNAL_AUTH_SERVICES = ['ldap', 'jwtauthn', 'keystone'];
|
||||||
|
|
||||||
userService.hasEverLoggedIn = function() {
|
userService.hasEverLoggedIn = function() {
|
||||||
return CookieService.get('quay.loggedin') == 'true';
|
return CookieService.get('quay.loggedin') == 'true';
|
||||||
|
@ -174,7 +174,7 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) {
|
||||||
|
|
||||||
var externalUsername = null;
|
var externalUsername = null;
|
||||||
userResponse.logins.forEach(function(login) {
|
userResponse.logins.forEach(function(login) {
|
||||||
if (_EXTERNAL_SERVICES.indexOf(login.service) >= 0) {
|
if (_INTERNAL_AUTH_SERVICES.indexOf(login.service) >= 0) {
|
||||||
externalUsername = login.service_identifier;
|
externalUsername = login.service_identifier;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Reference in a new issue