diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 77e56c5cd94b59..898790e9ea0c7b 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -80,6 +80,7 @@ async function foo() { for (const container of containers) { const foo = await docker7.getContainer(container.Id); const inspect = await foo.inspect(); + const healthCheck = inspect.Config.Healthcheck; } const images = await docker5.listImages(); @@ -90,6 +91,7 @@ async function foo() { const inspect = await foo.inspect({ manifests: true }); const imageDescriptor = inspect.Descriptor; const imageManifests = inspect.Manifests; + const healthCheck = inspect.Config.Healthcheck; await foo.remove(); } @@ -668,7 +670,7 @@ docker.run( "ubuntu", ["bash", "-c", "uname -a"], process.stdout, - { name: "foo", platform: "linux/amd64" }, + { name: "foo", platform: "linux/amd64", Healthcheck: { Test: ["CMD-SHELL", "echo 'pass' && exit 0"] } }, (err, data) => { console.log(data.StatusCode); }, diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 5a3effc256716a..72eace6845e3f5 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -657,6 +657,7 @@ declare namespace Dockerode { Entrypoint?: string | string[] | undefined; OnBuild?: any; Labels: { [label: string]: string }; + Healthcheck?: HealthConfig | undefined; }; NetworkSettings: { Bridge: string; @@ -989,6 +990,7 @@ declare namespace Dockerode { Entrypoint?: string | string[] | undefined; OnBuild: any[]; Labels: { [label: string]: string }; + Healthcheck?: HealthConfig | undefined; }; Architecture: string; Variant?: string | undefined; diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index e5c8338360c783..04e1aa15110db5 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -278,10 +278,6 @@ declare module "node-forge" { } var oids: oids; - interface MDSigner { - sign(md: md.MessageDigest): Bytes; - } - namespace rsa { type EncryptionScheme = "RSAES-PKCS1-V1_5" | "RSA-OAEP" | "RAW" | "NONE" | null; type SignatureScheme = "RSASSA-PKCS1-V1_5" | pss.PSS | "NONE" | null; @@ -476,10 +472,10 @@ declare module "node-forge" { /** * Signs this certificate using the given private key. * - * @param signer the signer used to sign this csr + * @param key the private key to sign with. * @param md the message digest object to use (defaults to forge.md.sha1). */ - sign(signer: MDSigner, md?: md.MessageDigest): void; + sign(key: pki.rsa.PrivateKey, md?: md.MessageDigest): void; /** * Attempts verify the signature on the passed certificate using this * certificate's public key. @@ -571,10 +567,10 @@ declare module "node-forge" { /** * Signs this csr using the given private key. * - * @param signer the signer used to sign this csr + * @param key the private key to sign with. * @param md the message digest object to use (defaults to forge.md.sha1). */ - sign(signer: MDSigner, md?: md.MessageDigest): void; + sign(key: pki.rsa.PrivateKey, md?: md.MessageDigest): void; /** * Attempts verify the signature on this csr using this * csr's public key. @@ -768,23 +764,23 @@ declare module "node-forge" { /** * @description Encodes a private RSA key as an OpenSSH file */ - function privateKeyToOpenSSH(privateKey: pki.PrivateKey, passphrase?: string): string; + function privateKeyToOpenSSH(privateKey: pki.rsa.PrivateKey, passphrase?: string): string; /** * @description Encodes (and optionally encrypts) a private RSA key as a Putty PPK file */ - function privateKeyToPutty(privateKey: pki.PrivateKey, passphrase?: string, comment?: string): string; + function privateKeyToPutty(privateKey: pki.rsa.PrivateKey, passphrase?: string, comment?: string): string; /** * @description Encodes a public RSA key as an OpenSSH file */ - function publicKeyToOpenSSH(publicKey: pki.PublicKey, comment?: string): string | pki.PEM; + function publicKeyToOpenSSH(publicKey: pki.rsa.PublicKey, comment?: string): string | pki.PEM; /** * @description Gets the SSH fingerprint for the given public key */ function getPublicKeyFingerprint( - publicKey: pki.PublicKey, + publicKey: pki.rsa.PublicKey, options?: FingerprintOptions, ): util.ByteStringBuffer | Hex | string; } @@ -970,7 +966,7 @@ declare module "node-forge" { interface Bag { type: string; attributes: any; - key?: pki.PrivateKey | undefined; + key?: pki.rsa.PrivateKey | undefined; cert?: pki.Certificate | undefined; asn1: asn1.Asn1; } @@ -994,7 +990,7 @@ declare module "node-forge" { function pkcs12FromAsn1(obj: any, password?: string): Pkcs12Pfx; function toPkcs12Asn1( - key: pki.PrivateKey | null, + key: pki.rsa.PrivateKey | null, cert: pki.Certificate | pki.Certificate[], password: string | null, options?: { diff --git a/types/node-forge/node-forge-tests.ts b/types/node-forge/node-forge-tests.ts index ef7d4a14c9daab..e7e7f3dc1aa974 100644 --- a/types/node-forge/node-forge-tests.ts +++ b/types/node-forge/node-forge-tests.ts @@ -29,6 +29,7 @@ let privateKeyFromAsn1 = forge.pki.privateKeyFromAsn1(privateKeyAsn1); let byteBufferString = forge.pki.pemToDer(privateKeyPem); let cert = forge.pki.createCertificate(); cert.publicKey = keypair.publicKey; +// explicitly cast as PrivateKey to ensure expected typings are accepted cert.sign(keypair.privateKey); forge.pki.certificateFromAsn1(forge.pki.certificateToAsn1(cert)); let certPem = forge.pki.certificateToPem(cert);