Skip to content

Commit 48776d1

Browse files
committed
Add types for outbound blocking
1 parent 5a13a32 commit 48776d1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

library/agent/Config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ export type Config = {
2828
allowedIPAddresses: string[];
2929
block?: boolean;
3030
receivedAnyStats?: boolean;
31+
blockNewOutgoingRequests?: boolean;
3132
};

library/agent/api/fetchBlockedLists.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ export type Response = {
2525
// If we want to collect stats about the individual user agents,
2626
// we can loop through the userAgentDetails and match each pattern.
2727
userAgentDetails: UserAgentDetails[];
28+
domains: Domain[];
29+
};
30+
31+
export type Domain = {
32+
hostname: string;
33+
mode: "allow" | "block";
2834
};
2935

3036
export async function fetchBlockedLists(token: Token): Promise<Response> {
@@ -56,6 +62,7 @@ export async function fetchBlockedLists(token: Token): Promise<Response> {
5662
blockedUserAgents: string;
5763
monitoredUserAgents: string;
5864
userAgentDetails: UserAgentDetails[];
65+
domains: Domain[];
5966
} = JSON.parse(body);
6067

6168
return {
@@ -85,5 +92,6 @@ export async function fetchBlockedLists(token: Token): Promise<Response> {
8592
result && Array.isArray(result.userAgentDetails)
8693
? result.userAgentDetails
8794
: [],
95+
domains: result && Array.isArray(result.domains) ? result.domains : [],
8896
};
8997
}

0 commit comments

Comments
 (0)