Skip to content

Commit

Permalink
fix: tests, eslint and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Dec 16, 2023
1 parent d1d20b3 commit bf3cad5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"lint": "eslint .",
"format": "prettier --write .",
"build": "tsup",
"build-docs": "typedoc"
"build-docs": "typedoc --skipErrorChecking"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@typescript-eslint/eslint-plugin": "^6.5.0",
"@typescript-eslint/parser": "^6.5.0",
"eslint": "^8.32.0",
"eslint-plugin-security": "^2.1.0",
"eslint-plugin-security": "^1.7.1",
"jest": "^29.5.0",
"license-checker-rseidelsohn": "^4.2.10",
"prettier": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/ocsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { OCSPStatusConfig, OCSPStatusResponse } from './index';
const cryptoEngine = new pkijs.CryptoEngine({
crypto: webcrypto as Crypto,
});
pkijs.setEngine('crypto', cryptoEngine);
pkijs.setEngine('crypto', cryptoEngine as pkijs.ICryptoEngine);

export async function buildOCSPRequest(cert: pkijs.Certificate, issuerCert: pkijs.Certificate, config: OCSPStatusConfig) {
const ocspReq = new pkijs.OCSPRequest();
Expand Down
56 changes: 28 additions & 28 deletions test/certs/le-staging-revoked.pem
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
-----BEGIN CERTIFICATE-----
MIIFHDCCBASgAwIBAgITAPrwMJBK4Y2dP9dC98evjCEFqDANBgkqhkiG9w0BAQsF
ADBZMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXKFNUQUdJTkcpIExldCdzIEVuY3J5
cHQxKDAmBgNVBAMTHyhTVEFHSU5HKS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rIrPRoozy7ZNpVjcaQkkFtJnqiKn2ljmDmc8+IS5xNBBREBsvpwq7GTLsOSF
fJ0iT38Q0/u9JtENstXg0hjJojsR3R1f3oixFUzUg8TYTMxf03wB25BH8dWe+smX
0fBwfVyr+SB6BiCS1dFRnSOIS7oVKUJPB6m1bTyKenMrrJ2Gk8mfIOSbh7EsfYzI
dRyt2ydWrDIBb3r57+E+iMatC0I3DlXe
-----END CERTIFICATE-----
8 changes: 4 additions & 4 deletions test/le-revoked.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ beforeAll(async () => {
test('Check revoked Lets Encrypt cert', async () => {
const result = await getCertStatus(cert);
expect(result.status).toBe('revoked');
expect(result.revocationTime?.getTime()).toBe(1694016850000);
expect(result.revocationTime?.getTime()).toBe(1702737476000);
});

test('Get OCSP and issuer URLs', async () => {
Expand All @@ -35,19 +35,19 @@ test('Set ocsp url manually', async () => {
ocspUrl: 'http://stg-r3.o.lencr.org',
});
expect(result.status).toBe('revoked');
expect(result.revocationTime?.getTime()).toBe(1694016850000);
expect(result.revocationTime?.getTime()).toBe(1702737476000);
});

test('Set ca manually', async () => {
const result = await getCertStatus(cert, {
ca: intermediateCA,
});
expect(result.status).toBe('revoked');
expect(result.revocationTime?.getTime()).toBe(1694016850000);
expect(result.revocationTime?.getTime()).toBe(1702737476000);
});

test('Pass X509Certificate object', async () => {
const result = await getCertStatus(new X509Certificate(cert));
expect(result.status).toBe('revoked');
expect(result.revocationTime?.getTime()).toBe(1694016850000);
expect(result.revocationTime?.getTime()).toBe(1702737476000);
});

0 comments on commit bf3cad5

Please sign in to comment.