untested WIP
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import keypair from "keypair";
|
||||
|
||||
console.log(`
|
||||
Generating Private Keys
|
||||
-----------------
|
||||
This script will go through and genrate all the keys necessary for running the Credential Manager API locally.
|
||||
This process might take several minutes.
|
||||
-----------------`);
|
||||
|
||||
await Promise.all(
|
||||
[
|
||||
".accessToken.key",
|
||||
".refreshToken.key",
|
||||
".permissions.key",
|
||||
".apiKeyToken.key",
|
||||
].map(async (v) => {
|
||||
if (
|
||||
await Bun.file(v)
|
||||
.exists()
|
||||
.then((bool) => {
|
||||
if (bool) {
|
||||
console.log(`'${v}' already exists`);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})
|
||||
) {
|
||||
console.log(`Generating '${v}'...`);
|
||||
const keys = keypair({ bits: 4096 });
|
||||
|
||||
await Bun.write(v, keys.private);
|
||||
}
|
||||
return;
|
||||
})
|
||||
);
|
||||
|
||||
console.log("\nGenerated All Keys Successfully!");
|
||||
Reference in New Issue
Block a user