@adaptivestone/framework 5.0.0-alpha.16 → 5.0.0-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/commands/GenerateRandomBytes.js +15 -0
- package/config/auth.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { randomBytes } from 'node:crypto';
|
|
2
|
+
import AbstractCommand from '../modules/AbstractCommand.js';
|
|
3
|
+
|
|
4
|
+
class GenerateRandomBytes extends AbstractCommand {
|
|
5
|
+
async run() {
|
|
6
|
+
const sizes = [16, 32, 64, 128, 256];
|
|
7
|
+
for (const size of sizes) {
|
|
8
|
+
const bytes = randomBytes(size).toString('hex');
|
|
9
|
+
this.logger.info(`${size} bytes: ${bytes}`);
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default GenerateRandomBytes;
|
package/config/auth.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
hashRounds: 64,
|
|
3
3
|
saltSecret:
|
|
4
|
-
process.env.AUTH_SALT ||
|
|
4
|
+
process.env.AUTH_SALT ||
|
|
5
|
+
console.error(
|
|
6
|
+
'AUTH_SALT is not defined. You can "npm run cli generateRandomBytes" and use it',
|
|
7
|
+
),
|
|
5
8
|
isAuthWithVefificationFlow: true,
|
|
6
9
|
};
|