Remove password confirmation in config app

Small fix to manually clean up temp dir when creating new temp dir,
small fix to font awesome icons, change the jwt/keystone
validators to not use username/password
This commit is contained in:
Sam Chow 2018-07-17 10:57:56 -04:00
parent 496d94138c
commit f5a8116f5a
9 changed files with 61 additions and 96 deletions

View file

@ -24,6 +24,7 @@ class TransientDirectoryProvider(FileConfigProvider):
"""
Update the path with a new temporary directory, deleting the old one in the process
"""
self.temp_dir.cleanup()
temp_dir = TemporaryDirectory()
self.config_volume = temp_dir.name

View file

@ -51,15 +51,15 @@ angular.module("quay-config")
{'id': 'ldap', 'title': 'LDAP Authentication', 'condition': function(config) {
return config.AUTHENTICATION_TYPE == 'LDAP';
}, 'password': true},
}},
{'id': 'jwt', 'title': 'JWT Authentication', 'condition': function(config) {
return config.AUTHENTICATION_TYPE == 'JWT';
}, 'password': true},
}},
{'id': 'keystone', 'title': 'Keystone Authentication', 'condition': function(config) {
return config.AUTHENTICATION_TYPE == 'Keystone';
}, 'password': true},
}},
{'id': 'apptoken-auth', 'title': 'App Token Authentication', 'condition': function(config) {
return config.AUTHENTICATION_TYPE == 'AppToken';
@ -345,50 +345,7 @@ angular.module("quay-config")
$scope.validateAndSave = function() {
$scope.validating = $scope.getServices($scope.config);
var requirePassword = false;
for (var i = 0; i < $scope.validating.length; ++i) {
var serviceInfo = $scope.validating[i];
if (serviceInfo.service.password) {
requirePassword = true;
break;
}
}
if (!requirePassword) {
$scope.performValidateAndSave();
return;
}
var box = bootbox.dialog({
"message": 'Please enter your superuser password to validate your auth configuration:' +
'<form style="margin-top: 10px" action="javascript:$(\'.btn-continue\').click()">' +
'<input id="validatePassword" class="form-control" type="password" placeholder="Password">' +
'</form>',
"title": 'Enter Password',
"buttons": {
"success": {
"label": "Validate Config",
"className": "btn-success btn-continue",
"callback": function() {
$scope.performValidateAndSave($('#validatePassword').val());
}
},
"close": {
"label": "Cancel",
"className": "btn-default",
"callback": function() {
}
}
}
});
box.bind('shown.bs.modal', function(){
box.find("input").focus();
box.find("form").submit(function() {
if (!$('#validatePassword').val()) { return; }
box.modal('hide');
});
});
$scope.performValidateAndSave();
};
$scope.performValidateAndSave = function(opt_password) {

View file

@ -29,8 +29,10 @@
/* Fixes the transition to font awesome 5 */
.quay-config-app .co-alert.co-alert-warning::before {
font-family: Font Awesome\ 5 Free;
font-weight: 900;
}
.quay-config-app .co-alert.co-alert-info::before {
font-family: Font Awesome\ 5 Free;
font-weight: 900;
}