From 7b733a75ccbf8a0333aaf9d8efd8a7269f32a01c Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Fri, 15 Feb 2019 15:37:15 -0500 Subject: [PATCH] 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 --- config_app/js/services/user-service.js | 16 ---------------- static/js/services/user-service.js | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/config_app/js/services/user-service.js b/config_app/js/services/user-service.js index 3203e9185..8c222b955 100644 --- a/config_app/js/services/user-service.js +++ b/config_app/js/services/user-service.js @@ -20,7 +20,6 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) { }; var userService = {}; - var _EXTERNAL_SERVICES = ['ldap', 'jwtauthn', 'keystone', 'dex']; userService.hasEverLoggedIn = function() { return CookieService.get('quay.loggedin') == 'true'; @@ -167,21 +166,6 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) { 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() { return userResponse; }; diff --git a/static/js/services/user-service.js b/static/js/services/user-service.js index af59217be..8111bb0c0 100644 --- a/static/js/services/user-service.js +++ b/static/js/services/user-service.js @@ -20,7 +20,7 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) { }; var userService = {}; - var _EXTERNAL_SERVICES = ['ldap', 'jwtauthn', 'keystone', 'dex']; + var _INTERNAL_AUTH_SERVICES = ['ldap', 'jwtauthn', 'keystone']; userService.hasEverLoggedIn = function() { return CookieService.get('quay.loggedin') == 'true'; @@ -174,7 +174,7 @@ function(ApiService, CookieService, $rootScope, Config, $location, $timeout) { var externalUsername = null; userResponse.logins.forEach(function(login) { - if (_EXTERNAL_SERVICES.indexOf(login.service) >= 0) { + if (_INTERNAL_AUTH_SERVICES.indexOf(login.service) >= 0) { externalUsername = login.service_identifier; } });