From 58e69008eee1aa6097da438098c155db856f9837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Fri, 31 Jan 2025 09:37:14 +0100 Subject: [PATCH] Add comment, fix import --- library/agent/ServiceConfig.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/agent/ServiceConfig.ts b/library/agent/ServiceConfig.ts index 21ad9378..9c493d2b 100644 --- a/library/agent/ServiceConfig.ts +++ b/library/agent/ServiceConfig.ts @@ -1,7 +1,7 @@ import { IPMatcher } from "../helpers/ip-matcher/IPMatcher"; import { LimitedContext, matchEndpoints } from "../helpers/matchEndpoints"; import { Endpoint } from "./Config"; -import { IPList as IPList } from "./api/fetchBlockedLists"; +import { IPList } from "./api/fetchBlockedLists"; export class ServiceConfig { private blockedUserIds: Map = new Map(); @@ -145,6 +145,9 @@ export class ServiceConfig { this.setOnlyAllowedIPAddresses(ipAddresses); } + /** + * Returns true if only some IP addresses are allowed to access the service, e.g. if a geoip country allowlist is set. + */ shouldOnlyAllowSomeIPAddresses() { return this.onlyAllowedIPAddresses !== undefined; }