
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
https://medium.com/@junaid1460/hapiest-7f3a184604b7 read use cases here.
npm i hapiest@latest
hapi 17+ typescript 3 (es6)
import { Server } from "hapi";
import { Hapiest } from "hapiest";
@Hapiest.Routes({ baseUrl: "api", auth: false })
class AdminRoutes extends Hapiest.HapiestRoutes {
@Hapiest.get({ path: "" }) // Path: /api
public api(args: Hapiest.HapiestParams) {
return "base\n";
}
@Hapiest.get() // Path: /api/getTest
public getTest({
request
}: Hapiest.HapiestParams<Hapiest.HapiestRequest<{ username: string }>>) {
return `hey, what's up? I know type of payload ${request.payload.username}\n`;
}
@Hapiest.get({ path: "name" }) // Path: /api/name
public async getit(args: Hapiest.HapiestParams) {
return "junaid\n";
}
}
class MyFirstHapiestModule extends Hapiest.HapiestModule {
public routeSets = [AdminRoutes];
public baseUrl = "dev";
public auth = "simple"; // Make sure that you registered auth plugin
}
class ModuleWithNoAuth extends Hapiest.HapiestModule {
public routeSets = [AdminRoutes];
public baseUrl = "test";
public auth: false = false;
}
const hapiServer = new Server({
host: "0",
port: 8000,
routes: { cors: true }
});
async function start() {
await hapiServer.register({
plugin: require("hapi-auth-basic")
});
hapiServer.auth.strategy("simple", "basic", {
validate: () => true
});
hapiServer.route(new MyFirstHapiestModule().getRoutes());
hapiServer.route(new ModuleWithNoAuth().getRoutes());
await hapiServer.start().then(e => {
console.log("server started");
const routesText = hapiServer
.table()
.map(route => {
return `${route.method}: (${JSON.stringify(
route.settings.auth
) || "No auth"}) ${route.path}`;
})
.join("\n");
console.log(routesText);
// server started
// get: ({"strategies":["simple"],"mode":"required"}) /dev/api/api
// get: ({"strategies":["simple"],"mode":"required"}) /dev/api/getTest
// get: ({"strategies":["simple"],"mode":"required"}) /dev/api/name
// get: (false) /test/api/api
// get: (false) /test/api/getTest
// get: (false) /test/api/name
});
}
start();
FAQs
Decorators for hapi 17+
We found that hapiest 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.