
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@apogeelabs/hoppity
Advanced tools
A middleware pipeline for Rascal broker configuration that enables modular, composable broker setup.
npm install @apogeelabs/hoppity
import hoppity from "@apogeelabs/hoppity";
import { BrokerConfig } from "rascal";
// Start with a base topology
const baseTopology: BrokerConfig = {
vhosts: {
"/": {
connection: {
url: "amqp://localhost",
},
},
},
};
// Create broker with middleware
const broker = await hoppity
.withTopology(baseTopology)
.use(myMiddleware1)
.use(myMiddleware2)
.build();
The middleware pattern supports context sharing between middleware functions. Each middleware receives a context object that can be used to share data with downstream middleware.
interface MiddlewareContext {
data: Record<string, any>; // Arbitrary data for sharing
middlewareNames: string[]; // Names of executed middleware
logger: Logger; // Logger instance for middleware to use
}
import { MiddlewareFunction, MiddlewareContext } from "@apogeelabs/hoppity";
// First middleware: sets up exchanges and shares info
const exchangeSetupMiddleware: MiddlewareFunction = (topology, context) => {
// Use the logger for debugging
context.logger.info("Setting up exchanges...");
// Modify topology to add exchanges
const modifiedTopology = { ...topology };
// ... add exchanges ...
// Share exchange names with downstream middleware
context.data.exchangeNames = ["user-events", "order-events"];
context.data.serviceName = "user-service";
context.logger.debug("Exchanges configured", { exchangeNames: context.data.exchangeNames });
return { topology: modifiedTopology };
};
// Second middleware: uses context from previous middleware
const queueSetupMiddleware: MiddlewareFunction = (topology, context) => {
// Access data from previous middleware
const exchangeNames = context.data.exchangeNames || [];
const serviceName = context.data.serviceName;
context.logger.info("Setting up queues for service", { serviceName, exchangeNames });
// Check if required middleware has run
if (!context.middlewareNames.includes("exchangeSetupMiddleware")) {
throw new Error("exchangeSetupMiddleware must run before queueSetupMiddleware");
}
// Use the shared data to set up queues
const modifiedTopology = { ...topology };
// ... set up queues bound to the exchanges ...
return { topology: modifiedTopology };
};
hoppity.withTopology(topology)
- Start with an existing topologyhoppity.use(middleware)
- Start with empty topology and add middlewarebuilder.use(middleware)
- Add middleware to the pipelinebuilder.build()
- Create the broker and execute the pipelineMiddlewareFunction
- Function signature for middlewareMiddlewareContext
- Context object for sharing stateMiddlewareResult
- Return type for middleware functionsBrokerCreatedCallback
- Callback for post-creation setupBrokerWithExtensions<T>
- Utility type for combining broker extensionsLogger
- Logger interface for middleware loggingBuilderInterface
- Interface for the builder patternConsoleLogger
- Console-based logger implementationdefaultLogger
- Default logger instanceSee the examples/
directory for complete working examples demonstrating:
For RPC communication patterns, see the separate @apogeelabs/hoppity-rpc
package.
This package depends on:
rascal
- The underlying RabbitMQ librarylodash
- For deep cloning and utility functionsISC
FAQs
Core hoppity library
The npm package @apogeelabs/hoppity receives a total of 0 weekly downloads. As such, @apogeelabs/hoppity popularity was classified as not popular.
We found that @apogeelabs/hoppity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.