diff --git a/awx/ui/.eslintrc.js b/awx/ui/.eslintrc.js index 9a42d34ab2..27759bf2b9 100644 --- a/awx/ui/.eslintrc.js +++ b/awx/ui/.eslintrc.js @@ -31,7 +31,8 @@ module.exports = { $: true, _: true, codemirror: true, - jsyaml: true + jsyaml: true, + crypto: true }, rules: { 'arrow-parens': 'off', diff --git a/awx/ui/.jshintrc b/awx/ui/.jshintrc index a2bb56723e..363d2e5ba8 100644 --- a/awx/ui/.jshintrc +++ b/awx/ui/.jshintrc @@ -35,7 +35,8 @@ "moment": false, "spyOn": false, "jasmine": false, - "dagre": false + "dagre": false, + "crypto": false }, "strict": false, "quotmark": false, diff --git a/awx/ui/client/src/templates/job_templates/factories/md-5-setup.factory.js b/awx/ui/client/src/templates/job_templates/factories/md-5-setup.factory.js index bce1485d7a..eefdb0beb2 100644 --- a/awx/ui/client/src/templates/job_templates/factories/md-5-setup.factory.js +++ b/awx/ui/client/src/templates/job_templates/factories/md-5-setup.factory.js @@ -1,5 +1,5 @@ export default - function md5Setup(md5) { + function md5Setup() { return function(params) { var scope = params.scope, master = params.master, @@ -10,8 +10,9 @@ export default master[check_field] = default_val; scope.genMD5 = function (fld) { - var now = new Date(); - scope[fld] = md5.createHash('AnsibleWorks' + now.getTime()); + scope[fld] = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c => + (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16) + ); scope.$emit('NewMD5Generated'); }; @@ -26,5 +27,3 @@ export default }; }; } - -md5Setup.$inject = [ 'md5' ];