Skip to content

About

More middleware for inkan: auth, sessions, secure headers, ETags, idempotency, a proxy, circuit breakers and tracing. One package each.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

53 Commits

Folders and files

Repository files navigation

inkan middleware

More middleware for inkan, one package each. Like inkan itself, every package keeps no dependencies, but @inkanjs/otel, which needs @opentelemetry/api as a peer.

package what it does
@inkanjs/auth Login, sessions, JWT and JWKS, API keys, basic auth, roles, 2FA with recovery codes, OAuth and OIDC, refresh tokens, brute-force protection.
@inkanjs/session Cookie sessions, signed or encrypted, or a store behind a random id; flash messages.
@inkanjs/secure-headers The security headers a browser-facing API should send, with a strict CSP and per-request nonces.
@inkanjs/etag ETags and 304 answers for JSON, before compression.
@inkanjs/idempotency Idempotency keys for safe retries of POST and PATCH, scoped per caller.
@inkanjs/proxy A streaming reverse proxy: a prefix or one route handed on to an upstream.
@inkanjs/circuit-breaker Circuit breakers for outgoing calls and for routes: fail fast while something is down.
@inkanjs/otel OpenTelemetry tracing: a server span per request, with the HTTP semantic conventions.
@inkanjs/mongo A Store on MongoDB, on your own client: jobs, rate limits and sessions shared by every process.
@inkanjs/mysql A Store on MySQL 8, on your own mysql2 pool: jobs, rate limits and sessions shared by every process.
@inkanjs/redis A Store on Redis, on your own redis or ioredis client: jobs, rate limits and sessions shared by every process, with pub/sub.
@inkanjs/postgres A Store on PostgreSQL, on your own pg pool or postgres.js: jobs, rate limits and sessions shared by every process, with LISTEN/NOTIFY.

Every package is tested in CI on Node 22, 24 and 26; the stores against MongoDB 7 and MySQL 8.4 (locally they download a server once, or use MONGO_URL and MYSQL_URL):

npm install
npm run typecheck
npm test

MIT licensed.

Releasing a package

A GitHub release with the tag <package>-v<version>, as auth-v0.1.0, publishes that one package from packages/<package>, after its tests: to npmjs.com with provenance, and to GitHub Packages. Each package keeps a CHANGELOG.md; its section is the release notes.

About

More middleware for inkan: auth, sessions, secure headers, ETags, idempotency, a proxy, circuit breakers and tracing. One package each.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages