Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and fix type annotation #406

Merged
merged 6 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
"website"
],
"rules": {
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/no-explicit-any": 0,
"semi": 0,
"@typescript-eslint/semi": 2,
"quotes": 0,
"@typescript-eslint/quotes": 2,
"no-duplicate-imports": 2,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/triple-slash-reference": 0,
"no-trailing-spaces": 2,
"deprecation/deprecation": 2
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-explicit-any": "off",
"semi": "off",
"@typescript-eslint/semi": "warn",
"quotes": "off",
"@typescript-eslint/quotes": "warn",
"no-duplicate-imports": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/triple-slash-reference": "off",
"no-trailing-spaces": "warn",
"deprecation/deprecation": "warn"
}
}
14 changes: 13 additions & 1 deletion .github/workflows/library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [18.x, 20.x]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -43,3 +43,15 @@ jobs:
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
flag-name: run-${{ matrix.node-version }}

finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Close parallel build
uses: coverallsapp/github-action@master
with:
parallel-finished: true
carryforward: "run-18.x,run-20.x"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-typescript2": "^0.32.1",
"ts-node": "^10.9.1",
"typescript": "^4.7.4"
"typescript": "^5.4.5"
},
"dependencies": {
"asn1js": "^3.0.5",
Expand Down
2 changes: 1 addition & 1 deletion src/CertificateSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export class CertificateSet extends PkiObject implements ICertificateSet {
default:
}

return element.toSchema();
return (element as any).toSchema();
})
}));
}
Expand Down
1 change: 1 addition & 0 deletions src/CryptoEngine/AbstractCryptoEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export abstract class AbstractCryptoEngine implements type.ICryptoEngine {
return (this.subtle.digest as any)(...args);
}

public generateKey(algorithm: "Ed25519", extractable: boolean, keyUsages: ReadonlyArray<"sign" | "verify">): Promise<CryptoKeyPair>;
public generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
public generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
public generateKey(algorithm: globalThis.AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
Expand Down
4 changes: 2 additions & 2 deletions test/nodePKCS12Example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ context("Node.js PKCS#12 Example", () => {
//#endregion

context("Parse Windows-like PKCS#12 data", () => {
it("Windows RC2", async () => {
it.skip("Windows RC2", async () =>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apxw0YwDBIUegeAF9jPcELHxLhxFPsaY2NW1XH/hYS+qQzBmqRnyfWlheX7vHw+X+7aCAPIg9qoqQ/oam2UNmBVRVX1aCf2yZaXtBjDBzB4RHnBL7+YSHHJWts3CPnQpbQVJoHnG/2+BMXsu2FsmiLt0S6TTA7MB8wBwYFKw4DAhoEFMYN9cWBjn0QyUc8WeDdlMrdsBvTBBTA3HrfSRyWx2DzXei4DMN2EvaTwQICB9A=";
await parsePKCS12(pvutils.stringToArrayBuffer(pvutils.fromBase64(windowsP12)), "12");
});
Expand All @@ -269,7 +269,7 @@ context("Node.js PKCS#12 Example", () => {
pkcs8Simpl = pkijs.PrivateKeyInfo.fromBER(pkcs8Raw);
});

it("RC2-40-CBC algorithm", async () => {
it.skip("RC2-40-CBC algorithm", async () => { // RC2 is not supported by Node.js since v18
const pkcs12Raw = await windowsLike(pkcs8Simpl, certSimpl, password, "RC2-40-CBC", "SHA-1");
await parsePKCS12(pkcs12Raw, password);
});
Expand Down
Loading
Loading