网页
综合
更新时间 2026-11-17 01:24:02
@rabbit-company/web-middleware - JSR
自动蜘蛛
jsr.io
正文约 2794 字
Official middleware collection for Rabbit Company Web Framework
Comprehensive HTTP request/response logging middleware using @rabbit-company/logger.
High-performance HTTP caching middleware with support for multiple storage backends, conditional requests, and stale-while-revalidate.
Protect your server from large request payloads with configurable size limits. Prevents memory exhaustion and ensures fair resource usage.
Token-based authentication for APIs.
HTTP Basic Authentication for simple username/password protection. Automatically handles base64 decoding and credential parsing.
Integration with the BurrowGate reverse proxy, built on @rabbit-company/burrowgate-auth. It provides two middleware:
BurrowGate signs every request it proxies with X-BurrowGate-Signature, an HMAC over the method, path, session ID, client IP, country, and timestamp. burrowgateOrigin recomputes it with the site's origin signing secret (no network call) and rejects requests that reached the app directly or were tampered with.
Because the client IP is covered by the signature, ctx.clientIp is set to the verified IP. You don't need ipExtract, and rateLimit, ipRestriction, and logger see the real client however your network is laid out.
Apps with their own accounts can tell BurrowGate who made each request. originUser runs after the rest of the chain, so it can read what your authentication middleware stored in the context. The response then carries X-BurrowGate-Origin-User and X-BurrowGate-Origin-User-Signature, signed with the origin signing secret and bound to that one request. BurrowGate verifies them, shows the name as Origin user in its traffic log, and removes both headers before the response reaches the client.
Usernames must be 1 to 255 characters without control characters. Anonymous, skipped and rejected requests are never reported.
The browser app gets a short-lived assertion from BurrowGate (use BrowserSessionAssertionClient from @rabbit-company/burrowgate-auth) and sends it in X-BurrowGate-Session-Assertion. burrowgateSession introspects it with BurrowGate using the server-only verification token.
Configure Cross-Origin Resource Sharing.
Advanced rate limiting with multiple algorithms to prevent API abuse and ensure fair usage..
Securely extract client IP addresses from requests, handling various proxy configurations and preventing IP spoofing attacks.
Control access to your application by allowing or blocking specific IP addresses and CIDR ranges. Supports both whitelist and blacklist modes with IPv4/IPv6.
This project is licensed under the MIT License - see the LICENSE file for details. 🐇💕
Please provide a reason for reporting this package. We will review your report and take appropriate action.
Please review the JSR usage policy before submitting a report.
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。