mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
generate host_config_key using random UUIDs, not a time-based md5 hash
This commit is contained in:
@@ -31,7 +31,8 @@ module.exports = {
|
||||
$: true,
|
||||
_: true,
|
||||
codemirror: true,
|
||||
jsyaml: true
|
||||
jsyaml: true,
|
||||
crypto: true
|
||||
},
|
||||
rules: {
|
||||
'arrow-parens': 'off',
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
"moment": false,
|
||||
"spyOn": false,
|
||||
"jasmine": false,
|
||||
"dagre": false
|
||||
"dagre": false,
|
||||
"crypto": false
|
||||
},
|
||||
"strict": false,
|
||||
"quotmark": false,
|
||||
|
||||
@@ -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' ];
|
||||
|
||||
Reference in New Issue
Block a user