New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@idearium/certs

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@idearium/certs - npm Package Compare versions

Comparing version 2.0.0-beta.3 to 2.0.0-beta.4

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # @idearium/certs

## v2.0.0-beta.4 - 2023-03-10
### Fixed
- Fixed an issue when loading real files.
## v2.0.0-beta.3 - 2023-03-10

@@ -7,0 +13,0 @@

20

index.js

@@ -25,11 +25,17 @@ 'use strict';

const results = {};
await Promise.all(
certPaths.map((file) =>
fs.readFile(file, 'utf8', (readErr, cert) => {
if (readErr) {
throw readErr;
}
certPaths.map(
(file) =>
new Promise((resolve, reject) => {
fs.readFile(file, 'utf8', (readErr, cert) => {
if (readErr) {
reject(readErr);
}
results[file] = cert;
})
results[file] = cert;
resolve();
});
})
)

@@ -36,0 +42,0 @@ );

{
"name": "@idearium/certs",
"version": "2.0.0-beta.3",
"version": "2.0.0-beta.4",
"description": "A package to load custom and OS certificates into Node.js.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -85,2 +85,44 @@ 'use strict';

it('supports files with periods in the name', async () => {
require('fs').__setMockFiles({
'/ssl/ca/first.ca.crt': 'ssl-ca-first-content',
'/ssl/ca/second.ca.crt': 'ssl-ca-second-content',
'/ssl/mq.common.crt': 'ssl-mq-common-crt-data',
'/ssl/mq.common.key': 'ssl-mq-common-key-data',
});
const certs = await loadCerts();
expect(certs).toHaveProperty('ca', [
'ssl-ca-first-content',
'ssl-ca-second-content',
]);
expect(certs).toHaveProperty('certs', {
'mq.common': {
crt: 'ssl-mq-common-crt-data',
key: 'ssl-mq-common-key-data',
},
});
});
it('supports nested directories', async () => {
require('fs').__setMockFiles({
'/ssl/local/ca/first.ca.crt': 'ssl-local-ca-first-content',
'/ssl/local/ca/second.ca.crt': 'ssl-local-ca-second-content',
'/ssl/local/mq.common.crt': 'ssl-local-mq-common-crt-data',
'/ssl/local/mq.common.key': 'ssl-local-mq-common-key-data',
});
const certs = await loadCerts('/ssl/local');
expect(certs).toHaveProperty('ca', [
'ssl-local-ca-first-content',
'ssl-local-ca-second-content',
]);
expect(certs).toHaveProperty('certs', {
'mq.common': {
crt: 'ssl-local-mq-common-crt-data',
key: 'ssl-local-mq-common-key-data',
},
});
});
it('will load OS provided certs', async () => {

@@ -87,0 +129,0 @@ require('fs').__setMockFiles({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc