mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 03:00: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,
|
||||||
_: true,
|
_: true,
|
||||||
codemirror: true,
|
codemirror: true,
|
||||||
jsyaml: true
|
jsyaml: true,
|
||||||
|
crypto: true
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
'arrow-parens': 'off',
|
'arrow-parens': 'off',
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
"moment": false,
|
"moment": false,
|
||||||
"spyOn": false,
|
"spyOn": false,
|
||||||
"jasmine": false,
|
"jasmine": false,
|
||||||
"dagre": false
|
"dagre": false,
|
||||||
|
"crypto": false
|
||||||
},
|
},
|
||||||
"strict": false,
|
"strict": false,
|
||||||
"quotmark": false,
|
"quotmark": false,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default
|
export default
|
||||||
function md5Setup(md5) {
|
function md5Setup() {
|
||||||
return function(params) {
|
return function(params) {
|
||||||
var scope = params.scope,
|
var scope = params.scope,
|
||||||
master = params.master,
|
master = params.master,
|
||||||
@@ -10,8 +10,9 @@ export default
|
|||||||
master[check_field] = default_val;
|
master[check_field] = default_val;
|
||||||
|
|
||||||
scope.genMD5 = function (fld) {
|
scope.genMD5 = function (fld) {
|
||||||
var now = new Date();
|
scope[fld] = ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
|
||||||
scope[fld] = md5.createHash('AnsibleWorks' + now.getTime());
|
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
||||||
|
);
|
||||||
scope.$emit('NewMD5Generated');
|
scope.$emit('NewMD5Generated');
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -26,5 +27,3 @@ export default
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
md5Setup.$inject = [ 'md5' ];
|
|
||||||
|
|||||||
Reference in New Issue
Block a user