File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,11 @@ export const MAINNET_RPC = process.env.MAINNET_RPC;
55
55
export const HERMES_URL = getOr ( "HERMES_URL" , "https://hermes.pyth.network" ) ;
56
56
export const BLOCKED_REGIONS = transformOr ( "BLOCKED_REGIONS" , fromCsv , [ ] ) ;
57
57
export const IP_ALLOWLIST = transformOr ( "IP_ALLOWLIST" , fromCsv , [ ] ) ;
58
+ export const VPN_ORGANIZATION_ALLOWLIST = transformOr (
59
+ "VPN_ORGANIZATION_ALLOWLIST" ,
60
+ fromCsv ,
61
+ [ "iCloud Private Relay" ] ,
62
+ ) ;
58
63
export const GOVERNANCE_ONLY_REGIONS = transformOr (
59
64
"GOVERNANCE_ONLY_REGIONS" ,
60
65
fromCsv ,
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
GOVERNANCE_ONLY_REGIONS ,
13
13
PROXYCHECK_API_KEY ,
14
14
IP_ALLOWLIST ,
15
+ VPN_ORGANIZATION_ALLOWLIST ,
15
16
} from "./config/server" ;
16
17
17
18
const GEO_BLOCKED_PATH = `/${ GEO_BLOCKED_SEGMENT } ` ;
@@ -61,8 +62,13 @@ const isProxyBlocked = async ({ ip }: NextRequest) => {
61
62
if ( proxyCheckClient === undefined || ip === undefined ) {
62
63
return false ;
63
64
} else {
64
- const result = await proxyCheckClient . checkIP ( ip , { vpn : 2 } ) ;
65
- return result [ ip ] ?. proxy === "yes" ;
65
+ const response = await proxyCheckClient . checkIP ( ip , { vpn : 2 } ) ;
66
+ const result = response [ ip ] ;
67
+ return (
68
+ result &&
69
+ result . proxy === "yes" &&
70
+ ! VPN_ORGANIZATION_ALLOWLIST . includes ( result . organisation )
71
+ ) ;
66
72
}
67
73
} ;
68
74
You can’t perform that action at this time.
0 commit comments