mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-29 06:10:47 +00:00
- Add MaxMind ASN database integration - Implement ASN lookup and matching in resource rule verification - Add curated list of 100+ major ASNs (cloud, ISP, CDN, mobile carriers) - Add ASN dropdown selector in resource rules UI with search functionality - Support custom ASN input for unlisted ASNs - Add 'ALL ASNs' special case handling (AS0) - Cache ASN lookups with 5-minute TTL for performance - Update validation schemas to support ASN match type This allows administrators to create resource access rules based on Autonomous System Numbers, similar to existing country-based rules. Useful for restricting access by ISP, cloud provider, or mobile carrier.
14 lines
389 B
TypeScript
14 lines
389 B
TypeScript
import maxmind, { AsnResponse, Reader } from "maxmind";
|
|
import config from "@server/lib/config";
|
|
|
|
let maxmindAsnLookup: Reader<AsnResponse> | null;
|
|
if (config.getRawConfig().server.maxmind_asn_path) {
|
|
maxmindAsnLookup = await maxmind.open<AsnResponse>(
|
|
config.getRawConfig().server.maxmind_asn_path!
|
|
);
|
|
} else {
|
|
maxmindAsnLookup = null;
|
|
}
|
|
|
|
export { maxmindAsnLookup };
|