migrate ResourceAuthenticator into here from separate package
[squeep-authentication-module] / lib / common.js
index 120c87045613e008988ed39f3db651aa09e2544c..5563254f0bab35b7b54322dd46ad0cfa9c49e3c4 100644 (file)
@@ -1,7 +1,10 @@
 'use strict';
 
 const { common } = require('@squeep/api-dingus');
+const { randomBytes } = require('node:crypto');
+const { promisify } = require('node:util');
 
+const randomBytesAsync = promisify(randomBytes);
 
 /**
  * Recursively freeze an object.
@@ -66,4 +69,5 @@ module.exports = Object.assign(Object.create(common), {
   mysteryBoxLogger,
   obscureAuthorizationHeader,
   omit,
+  randomBytesAsync,
 });