
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Promise-delayer and connection object stubber in order to be able to use async connectors with sync limitations.
Example usage with amqplib in a factory for electrolyte.
const amqp = require("amqplib");
const {ChannelModel} = require("amqplib/lib/channel_model");
const Wrappa = require("wrappa");
const connectionString = "justAnExampleConnectionString";
module.exports = function createRmqInstance() {
return new Wrappa(() => amqp.connection(connectionString), ChannelModel).getWrappedConnectionClass();
};
module.exports["@require"] = ["base/configuration"];
module.exports["@singleton"] = true;
The fellow would return a mock equivalent for an instance of ChannelModel, every call will return a promise, they'll be
delayed until the connection function returns the connection then it'll be casted to the connection instance, by default there's lazyness built in, so the connectionFactoryFn
described upper will not be called until there's at least one call from the mock returned.
Returns an instance of Wrappa.
Returns a callable mock equivalent to ConnectionClass.
These are the main functions only, please find the rest at the tests.
An example use-case:
Given that most IoC containers are sync, You might encounter the situation that You have to use a library which provides only async return of it's connection object, but You don't want to hack through it yourself nor You want to add extra noise to every place where the lib is used to wait for the connection.
So You can then make a go with Wrappa and hopefully skip the suffering.
Code examples to be added.
Suggestions and constructive critique is highly appreciated, please feel free to drop me a line at hello@danielgulyas.me. :)
Questions also welcome!
FAQs
Connector wrapper in order to make using async connector in a sync way.
The npm package wrappa receives a total of 10 weekly downloads. As such, wrappa popularity was classified as not popular.
We found that wrappa demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.