fixed type and eslint issues;
This commit is contained in:
Родитель
3f6d526a00
Коммит
bccd74e64f
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import jose, { JWK } from 'node-jose';
|
import jose from 'node-jose';
|
||||||
|
|
||||||
|
|
||||||
interface KeyGenerationArgs {
|
interface KeyGenerationArgs {
|
||||||
|
@ -28,12 +28,13 @@ async function generateAndStoreKey(outFileName: string, keyGenArgs: KeyGeneratio
|
||||||
fs.writeFileSync(outFilePath, JSON.stringify(jwkSet));
|
fs.writeFileSync(outFilePath, JSON.stringify(jwkSet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
generateAndStoreKey('valid_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' } });
|
|
||||||
generateAndStoreKey('private_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' }}, 1, true);
|
void generateAndStoreKey('valid_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' } });
|
||||||
generateAndStoreKey('valid_keys.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' } }, 3);
|
void generateAndStoreKey('private_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' }}, 1, true);
|
||||||
generateAndStoreKey('wrong_kid_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig', kid: 'ThisIsNotTheThumbprintOfTheKey' } });
|
void generateAndStoreKey('valid_keys.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig' } }, 3);
|
||||||
generateAndStoreKey('wrong_curve_key.json', { kty: 'EC', size: 'P-384', props: { alg: 'ES384', crv: 'P-384', use: 'sig' } });
|
void generateAndStoreKey('wrong_kid_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'sig', kid: 'ThisIsNotTheThumbprintOfTheKey' } });
|
||||||
generateAndStoreKey('wrong_use_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'enc' } });
|
void generateAndStoreKey('wrong_curve_key.json', { kty: 'EC', size: 'P-384', props: { alg: 'ES384', crv: 'P-384', use: 'sig' } });
|
||||||
generateAndStoreKey('wrong_alg_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256K', crv: 'P-256', use: 'sig' } });
|
void generateAndStoreKey('wrong_use_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256', crv: 'P-256', use: 'enc' } });
|
||||||
generateAndStoreKey('wrong_kty_key.json', { kty: 'RSA', size: 2048 });
|
void generateAndStoreKey('wrong_alg_key.json', { kty: 'EC', size: 'P-256', props: { alg: 'ES256K', crv: 'P-256', use: 'sig' } });
|
||||||
|
void generateAndStoreKey('wrong_kty_key.json', { kty: 'RSA', size: 2048 });
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ test("Cards: valid 02 JWS payload expanded", async () => expect(await testCard([
|
||||||
|
|
||||||
test("Cards: valid 00 JWS payload minified", async () => expect(await testCard(['example-00-c-jws-payload-minified.json'], "jwspayload")).toHaveLength(0));
|
test("Cards: valid 00 JWS payload minified", async () => expect(await testCard(['example-00-c-jws-payload-minified.json'], "jwspayload")).toHaveLength(0));
|
||||||
test("Cards: valid 01 JWS payload minified", async () => expect(await testCard(['example-01-c-jws-payload-minified.json'], "jwspayload")).toHaveLength(0));
|
test("Cards: valid 01 JWS payload minified", async () => expect(await testCard(['example-01-c-jws-payload-minified.json'], "jwspayload")).toHaveLength(0));
|
||||||
test("Cards: valid 02 JWS payload expanded", async () => expect(await testCard(['example-02-b-jws-payload-expanded.json'], "jwspayload")).toHaveLength(0));
|
test("Cards: valid 02 JWS payload minified", async () => expect(await testCard(['example-02-c-jws-payload-minified.json'], "jwspayload")).toHaveLength(0));
|
||||||
|
|
||||||
test("Cards: valid 00 JWS", async () => expect(await testCard(['example-00-d-jws.txt'], "jws")).toHaveLength(0));
|
test("Cards: valid 00 JWS", async () => expect(await testCard(['example-00-d-jws.txt'], "jws")).toHaveLength(0));
|
||||||
test("Cards: valid 01 JWS", async () => expect(await testCard(['example-01-d-jws.txt'], "jws")).toHaveLength(0));
|
test("Cards: valid 01 JWS", async () => expect(await testCard(['example-01-d-jws.txt'], "jws")).toHaveLength(0));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче