diff --git a/static/directives/service-keys-manager.html b/static/directives/service-keys-manager.html index b1267daeb..c87e27660 100644 --- a/static/directives/service-keys-manager.html +++ b/static/directives/service-keys-manager.html @@ -316,9 +316,9 @@ - + - A friendly name for the key for later reference. + A friendly name for the key for later reference. Must match ^[\s a-zA-Z0-9\-_:/]*$. diff --git a/static/js/directives/ui/service-keys-manager.js b/static/js/directives/ui/service-keys-manager.js index 295aa2692..96f9c3959 100644 --- a/static/js/directives/ui/service-keys-manager.js +++ b/static/js/directives/ui/service-keys-manager.js @@ -102,6 +102,17 @@ angular.module('quay').directive('serviceKeysManager', function () { 'value': key.name || '', 'callback': function(value) { if (value != null) { + if (!value.match(/^[\s a-zA-Z0-9\-_:/]*$/)){ + bootbox.alert({ + 'message': 'Invalid friendly name: input does not match ^[\\s a-zA-Z0-9\-_:/]*$', + 'callback': function(){ + $scope.showChangeName(key) + } + }); + + return + } + var data = { 'name': value };