secret-stack icon indicating copy to clipboard operation
secret-stack copied to clipboard

Key should never be @undefined

Open christianbundy opened this issue 5 years ago • 3 comments

const crypto = require("crypto");
const secretStack = require("secret-stack");

const appKey = crypto.randomBytes(32).toString("base64");

const stack = secretStack({ appKey });

const app = stack();

console.log(app.id); // => "@undefined"

christianbundy avatar Aug 12 '20 21:08 christianbundy

Note to self:

We should require (TS) config.keys and/or emit a (JS) warning when it's missing.

staltz avatar Sep 11 '20 08:09 staltz

I took a swing at this based on your note @staltz , https://github.com/ssb-js/secret-stack/pull/67. A new error is logged when no keys are passed in along with the config and updated the Config type in types.d.ts. Not sure how I feel about the log since it's going to make a lot of tests throughout the ecosystem very noisy. Thoughts?

austinfrey avatar Dec 20 '20 23:12 austinfrey

@austinfrey Thanks for the PR! :) What mix said over there is what I would say too

staltz avatar Dec 21 '20 09:12 staltz