Kind: Interface
Source: src/middleware/ip-restriction/index.ts
Part of: Middleware
Rules for IP Restriction Middleware
IPRestrictionRules defines the allow and deny rule collections used by IP Restriction Middleware. The middleware reads allowList and denyList to determine whether an incoming IP address matches a restriction rule.
Properties
| Property | Type |
|---|---|
denyList | IPRestrictionRule[] |
allowList | IPRestrictionRule[] |
Diagram
mermaidgraph LR Rules[IPRestrictionRules] Allow[allowList: IPRestrictionRule[]] Deny[denyList: IPRestrictionRule[]] Rule[IPRestrictionRule] Rules --> Allow Rules --> Deny Allow --> Rule Deny --> Rule
Usage
tsimport type { IPRestrictionRules } from "./middleware/ip-restriction";
const rules: IPRestrictionRules = {
allowList: [],
denyList: [],
};
// Pass `rules` to the IP Restriction Middleware configuration.
AI Coding Instructions
- Keep both
allowListanddenyListpresent when creating anIPRestrictionRulesobject. - Store only
IPRestrictionRuleentries in each list. - Check middleware behavior when an IP matches entries in both lists.
- Keep rule construction consistent with the
IPRestrictionRuletype.
Was this page helpful?