add stryker, test for timeout valid signature

This commit is contained in:
2020-03-09 07:50:35 +01:00
parent 314b9ffb19
commit d47281149f
5 changed files with 26 additions and 3148 deletions

View File

@ -103,6 +103,16 @@ test ('reject old signatures', async (t) => {
t.is (dec, null);
});
test ('do not reject valid signatures', async (t) => {
const obj = { foo: 'bar' };
const str = crypto.sign_object (obj, 'baz');
await new Promise ((res) => {
setTimeout (res, 10);
});
const dec = crypto.verify_signature (str, 'baz', 100);
t.deepEqual (obj, dec);
});
test ('decode problematic token', (t) => {
// eslint-disable-next-line max-len
const str = 'eyJpYXQiOjE1ODE0NDAwMTIyODgsIm9iaiI6eyJpZCI6MX19.24ZOsWrnfkNe%2FbM0r7DaVJMqE2bfn2aAM%2BZSzWeSf31OCTlXXNWD34RBL2X5v3UliYQ4IIsLNBFbaW9texPHug%3D%3D';