Skip to content

Commit 3ba98b9

Browse files
committed
Remove isMonitoredIPAddress
1 parent 40a7f2e commit 3ba98b9

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

library/agent/ServiceConfig.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ t.test("bypassed ips support cidr", async () => {
262262
t.test("it sets and updates monitored IP lists", async (t) => {
263263
const config = new ServiceConfig([], 0, [], [], false, [], []);
264264

265-
t.same(config.isMonitoredIPAddress("9.9.9.9"), false);
266-
t.same(config.isMonitoredIPAddress("1.2.3.4"), false);
265+
t.same(config.getMatchingMonitoredIPListKeys("9.9.9.9"), []);
266+
t.same(config.getMatchingMonitoredIPListKeys("1.2.3.4"), []);
267267

268268
config.updateMonitoredIPAddresses([
269269
{
@@ -274,13 +274,13 @@ t.test("it sets and updates monitored IP lists", async (t) => {
274274
},
275275
]);
276276

277-
t.same(config.isMonitoredIPAddress("9.9.9.9"), true);
278-
t.same(config.isMonitoredIPAddress("1.2.3.4"), true);
277+
t.same(config.getMatchingMonitoredIPListKeys("9.9.9.9"), ["tor/exit_nodes"]);
278+
t.same(config.getMatchingMonitoredIPListKeys("1.2.3.4"), ["tor/exit_nodes"]);
279279

280280
config.updateMonitoredIPAddresses([]);
281281

282-
t.same(config.isMonitoredIPAddress("9.9.9.9"), false);
283-
t.same(config.isMonitoredIPAddress("1.2.3.4"), false);
282+
t.same(config.getMatchingMonitoredIPListKeys("9.9.9.9"), []);
283+
t.same(config.getMatchingMonitoredIPListKeys("1.2.3.4"), []);
284284
});
285285

286286
t.test("it returns matching IP lists keys", async (t) => {

library/agent/ServiceConfig.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ export class ServiceConfig {
159159
this.setMonitoredIPAddresses(monitoredIPAddresses);
160160
}
161161

162-
isMonitoredIPAddress(ip: string): boolean {
163-
return this.monitoredIPAddresses.some((list) => list.list.has(ip));
164-
}
165-
166162
updateBlockedUserAgents(blockedUserAgents: string) {
167163
if (!blockedUserAgents) {
168164
// If an empty string is passed, we want to set the regex to undefined

0 commit comments

Comments
 (0)