vpndetection-fastapi 2.1.28__tar.gz → 2.1.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/CHANGELOG.md +6 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/PKG-INFO +4 -4
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/README.md +2 -2
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/pyproject.toml +1 -1
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/src/vpndetection_fastapi/__init__.py +1 -1
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/testdata/testdata.json +323 -20
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/tests/test_middleware.py +13 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/.github/workflows/ci.yml +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/.github/workflows/release.yml +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/.gitignore +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/LICENSE +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/SECURITY.md +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/src/vpndetection_fastapi/py.typed +0 -0
- {vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/testdata/bogons.json +0 -0
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
What each release changed for you, newest first. Each line is a commit's summary, linked to its full description and diff. Releases before 2.0.5 are described by their release commits.
|
|
4
4
|
|
|
5
|
+
## 2.1.29 - 2026-11-22
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Require vpndetection 5.20.0: is_bot and bot, and the AS's country and RPKI status required ([`6448579`](https://github.com/vpndetection-io/sdk-python-fastapi/commit/64485792c122bfe1c5a8684a9ec5ed9fd3896056))
|
|
10
|
+
|
|
5
11
|
## 2.1.28 - 2026-11-20
|
|
6
12
|
|
|
7
13
|
### Features
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vpndetection-fastapi
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.29
|
|
4
4
|
Summary: Official FastAPI and Starlette middleware for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN visitors on every request.
|
|
5
5
|
Project-URL: Homepage, https://vpndetection.io
|
|
6
6
|
Project-URL: Source, https://github.com/vpndetection-io/sdk-python-fastapi
|
|
@@ -20,7 +20,7 @@ Classifier: Topic :: Security
|
|
|
20
20
|
Classifier: Typing :: Typed
|
|
21
21
|
Requires-Python: >=3.11
|
|
22
22
|
Requires-Dist: starlette>=0.37
|
|
23
|
-
Requires-Dist: vpndetection<6,>=5.
|
|
23
|
+
Requires-Dist: vpndetection<6,>=5.20.0
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: fastapi>=0.115; extra == 'dev'
|
|
26
26
|
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
@@ -89,7 +89,7 @@ A condition is written in the shape of a result, keyed by the same names the API
|
|
|
89
89
|
[{"is_tor": True}, {"is_resproxy": True}] # a list is OR
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
Values are matched by equality, strings without regard to case. A list means any-of. A dict of `gte`/`gt`/`lte`/`lt` compares numbers, and every bound you give must hold, so two of them are a range. Members set to `False` or `None` are ignored, so a condition states the signals you act on; one that constrains nothing would match every request, and is refused when the middleware is built rather than silently blocking all your traffic.
|
|
92
|
+
Values are matched by equality, strings without regard to case. A list means any-of. A dict of `gte`/`gt`/`lte`/`lt` compares numbers, and every bound you give must hold, so two of them are a range. A member the answer holds as a list (`web`, `pubproxy.protocols`, `bittorrent.clients`, `bot.agents`, `bot.categories`) is never matched, so block on its flag alone. Members set to `False` or `None` are ignored, so a condition states the signals you act on; one that constrains nothing would match every request, and is refused when the middleware is built rather than silently blocking all your traffic.
|
|
93
93
|
|
|
94
94
|
Replace the refusal with `on_blocked`.
|
|
95
95
|
|
|
@@ -146,7 +146,7 @@ Beyond a few million distinct visitors a day, stop calling the API per request:
|
|
|
146
146
|
|
|
147
147
|
## Absent is not false
|
|
148
148
|
|
|
149
|
-
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn`, the four proxy flags, the carrier, satellite and service flags, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's. A field your plan does not include is `None`, which means "not in your plan" rather than "checked, and no".
|
|
149
|
+
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn`, the four proxy flags, the carrier, satellite and service flags, `bot`, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's. A field your plan does not include is `None`, which means "not in your plan" rather than "checked, and no".
|
|
150
150
|
|
|
151
151
|
```python
|
|
152
152
|
lookup(request).result.is_hosting # None when your plan does not include it
|
|
@@ -59,7 +59,7 @@ A condition is written in the shape of a result, keyed by the same names the API
|
|
|
59
59
|
[{"is_tor": True}, {"is_resproxy": True}] # a list is OR
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
Values are matched by equality, strings without regard to case. A list means any-of. A dict of `gte`/`gt`/`lte`/`lt` compares numbers, and every bound you give must hold, so two of them are a range. Members set to `False` or `None` are ignored, so a condition states the signals you act on; one that constrains nothing would match every request, and is refused when the middleware is built rather than silently blocking all your traffic.
|
|
62
|
+
Values are matched by equality, strings without regard to case. A list means any-of. A dict of `gte`/`gt`/`lte`/`lt` compares numbers, and every bound you give must hold, so two of them are a range. A member the answer holds as a list (`web`, `pubproxy.protocols`, `bittorrent.clients`, `bot.agents`, `bot.categories`) is never matched, so block on its flag alone. Members set to `False` or `None` are ignored, so a condition states the signals you act on; one that constrains nothing would match every request, and is refused when the middleware is built rather than silently blocking all your traffic.
|
|
63
63
|
|
|
64
64
|
Replace the refusal with `on_blocked`.
|
|
65
65
|
|
|
@@ -116,7 +116,7 @@ Beyond a few million distinct visitors a day, stop calling the API per request:
|
|
|
116
116
|
|
|
117
117
|
## Absent is not false
|
|
118
118
|
|
|
119
|
-
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn`, the four proxy flags, the carrier, satellite and service flags, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's. A field your plan does not include is `None`, which means "not in your plan" rather than "checked, and no".
|
|
119
|
+
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn`, the four proxy flags, the carrier, satellite and service flags, `bot`, `company` and `abuse`, and of the detail behind each flag it answers only Tor's and relay's. A field your plan does not include is `None`, which means "not in your plan" rather than "checked, and no".
|
|
120
120
|
|
|
121
121
|
```python
|
|
122
122
|
lookup(request).result.is_hosting # None when your plan does not include it
|
|
@@ -1438,6 +1438,7 @@
|
|
|
1438
1438
|
"is_relay",
|
|
1439
1439
|
"is_tor",
|
|
1440
1440
|
"is_cdn",
|
|
1441
|
+
"is_bot",
|
|
1441
1442
|
"is_resproxy",
|
|
1442
1443
|
"is_dcproxy",
|
|
1443
1444
|
"is_mobproxy",
|
|
@@ -1457,6 +1458,7 @@
|
|
|
1457
1458
|
"relay",
|
|
1458
1459
|
"tor",
|
|
1459
1460
|
"cdn",
|
|
1461
|
+
"bot",
|
|
1460
1462
|
"resproxy",
|
|
1461
1463
|
"dcproxy",
|
|
1462
1464
|
"mobproxy",
|
|
@@ -1864,7 +1866,9 @@
|
|
|
1864
1866
|
"name": "M247 Europe SRL",
|
|
1865
1867
|
"domain": "m247global.com",
|
|
1866
1868
|
"type": "hosting",
|
|
1867
|
-
"prefix": "146.70.116.0/24"
|
|
1869
|
+
"prefix": "146.70.116.0/24",
|
|
1870
|
+
"country": "US",
|
|
1871
|
+
"rpki_status": "valid"
|
|
1868
1872
|
}
|
|
1869
1873
|
},
|
|
1870
1874
|
"expect": {
|
|
@@ -1912,7 +1916,9 @@
|
|
|
1912
1916
|
"name": "M247 Europe SRL",
|
|
1913
1917
|
"domain": "m247global.com",
|
|
1914
1918
|
"type": "hosting",
|
|
1915
|
-
"prefix": "146.70.116.0/24"
|
|
1919
|
+
"prefix": "146.70.116.0/24",
|
|
1920
|
+
"country": "US",
|
|
1921
|
+
"rpki_status": "valid"
|
|
1916
1922
|
}
|
|
1917
1923
|
}
|
|
1918
1924
|
},
|
|
@@ -1950,7 +1956,9 @@
|
|
|
1950
1956
|
"name": "M247 Europe SRL",
|
|
1951
1957
|
"domain": "m247global.com",
|
|
1952
1958
|
"type": "hosting",
|
|
1953
|
-
"prefix": "146.70.116.0/24"
|
|
1959
|
+
"prefix": "146.70.116.0/24",
|
|
1960
|
+
"country": "US",
|
|
1961
|
+
"rpki_status": "valid"
|
|
1954
1962
|
}
|
|
1955
1963
|
},
|
|
1956
1964
|
"expect": {
|
|
@@ -1997,7 +2005,9 @@
|
|
|
1997
2005
|
"name": "M247 Europe SRL",
|
|
1998
2006
|
"domain": "m247global.com",
|
|
1999
2007
|
"type": "hosting",
|
|
2000
|
-
"prefix": "146.70.116.0/24"
|
|
2008
|
+
"prefix": "146.70.116.0/24",
|
|
2009
|
+
"country": "US",
|
|
2010
|
+
"rpki_status": "valid"
|
|
2001
2011
|
}
|
|
2002
2012
|
}
|
|
2003
2013
|
},
|
|
@@ -2050,7 +2060,9 @@
|
|
|
2050
2060
|
"name": "M247 Europe SRL",
|
|
2051
2061
|
"domain": "m247global.com",
|
|
2052
2062
|
"type": "hosting",
|
|
2053
|
-
"prefix": "146.70.116.0/24"
|
|
2063
|
+
"prefix": "146.70.116.0/24",
|
|
2064
|
+
"country": "US",
|
|
2065
|
+
"rpki_status": "valid"
|
|
2054
2066
|
},
|
|
2055
2067
|
"trial_expired": false
|
|
2056
2068
|
},
|
|
@@ -2100,7 +2112,9 @@
|
|
|
2100
2112
|
"name": "M247 Europe SRL",
|
|
2101
2113
|
"domain": "m247global.com",
|
|
2102
2114
|
"type": "hosting",
|
|
2103
|
-
"prefix": "146.70.116.0/24"
|
|
2115
|
+
"prefix": "146.70.116.0/24",
|
|
2116
|
+
"country": "US",
|
|
2117
|
+
"rpki_status": "valid"
|
|
2104
2118
|
}
|
|
2105
2119
|
}
|
|
2106
2120
|
},
|
|
@@ -2132,7 +2146,9 @@
|
|
|
2132
2146
|
"name": "M247 Europe SRL",
|
|
2133
2147
|
"domain": "m247global.com",
|
|
2134
2148
|
"type": "hosting",
|
|
2135
|
-
"prefix": "146.70.116.0/24"
|
|
2149
|
+
"prefix": "146.70.116.0/24",
|
|
2150
|
+
"country": "US",
|
|
2151
|
+
"rpki_status": "valid"
|
|
2136
2152
|
},
|
|
2137
2153
|
"trial_expired": true
|
|
2138
2154
|
},
|
|
@@ -2181,7 +2197,9 @@
|
|
|
2181
2197
|
"name": "M247 Europe SRL",
|
|
2182
2198
|
"domain": "m247global.com",
|
|
2183
2199
|
"type": "hosting",
|
|
2184
|
-
"prefix": "146.70.116.0/24"
|
|
2200
|
+
"prefix": "146.70.116.0/24",
|
|
2201
|
+
"country": "US",
|
|
2202
|
+
"rpki_status": "valid"
|
|
2185
2203
|
}
|
|
2186
2204
|
}
|
|
2187
2205
|
},
|
|
@@ -2213,7 +2231,9 @@
|
|
|
2213
2231
|
"name": "M247 Europe SRL",
|
|
2214
2232
|
"domain": "m247global.com",
|
|
2215
2233
|
"type": "hosting",
|
|
2216
|
-
"prefix": "146.70.116.0/24"
|
|
2234
|
+
"prefix": "146.70.116.0/24",
|
|
2235
|
+
"country": "US",
|
|
2236
|
+
"rpki_status": "valid"
|
|
2217
2237
|
},
|
|
2218
2238
|
"is_bogon": false,
|
|
2219
2239
|
"cap_reached": true
|
|
@@ -2263,13 +2283,15 @@
|
|
|
2263
2283
|
"name": "M247 Europe SRL",
|
|
2264
2284
|
"domain": "m247global.com",
|
|
2265
2285
|
"type": "hosting",
|
|
2266
|
-
"prefix": "146.70.116.0/24"
|
|
2286
|
+
"prefix": "146.70.116.0/24",
|
|
2287
|
+
"country": "US",
|
|
2288
|
+
"rpki_status": "valid"
|
|
2267
2289
|
}
|
|
2268
2290
|
}
|
|
2269
2291
|
},
|
|
2270
2292
|
{
|
|
2271
2293
|
"name": "unlimited-anycast-hostname",
|
|
2272
|
-
"why": "Unlimited's answer, with a key or without one, also carries is_anycast, hostname, and the AS's country and RPKI status. The paid members stay absent, never false or empty.",
|
|
2294
|
+
"why": "Unlimited's answer, with a key or without one, also carries is_bot, is_anycast, hostname, and the AS's country and RPKI status. The paid members stay absent, never false or empty.",
|
|
2273
2295
|
"status": 200,
|
|
2274
2296
|
"body": {
|
|
2275
2297
|
"ip": "1.1.1.1",
|
|
@@ -2277,6 +2299,7 @@
|
|
|
2277
2299
|
"is_vpn": false,
|
|
2278
2300
|
"is_relay": false,
|
|
2279
2301
|
"is_tor": false,
|
|
2302
|
+
"is_bot": false,
|
|
2280
2303
|
"is_anycast": true,
|
|
2281
2304
|
"relay": {},
|
|
2282
2305
|
"tor": {},
|
|
@@ -2310,6 +2333,7 @@
|
|
|
2310
2333
|
"is_vpn": false,
|
|
2311
2334
|
"is_relay": false,
|
|
2312
2335
|
"is_tor": false,
|
|
2336
|
+
"is_bot": false,
|
|
2313
2337
|
"is_anycast": true
|
|
2314
2338
|
},
|
|
2315
2339
|
"absent": [
|
|
@@ -2341,7 +2365,8 @@
|
|
|
2341
2365
|
"bittorrent",
|
|
2342
2366
|
"web",
|
|
2343
2367
|
"company",
|
|
2344
|
-
"abuse"
|
|
2368
|
+
"abuse",
|
|
2369
|
+
"bot"
|
|
2345
2370
|
],
|
|
2346
2371
|
"emptyPresent": [
|
|
2347
2372
|
"relay",
|
|
@@ -2383,6 +2408,7 @@
|
|
|
2383
2408
|
"is_relay": false,
|
|
2384
2409
|
"is_tor": false,
|
|
2385
2410
|
"is_cdn": false,
|
|
2411
|
+
"is_bot": false,
|
|
2386
2412
|
"is_resproxy": false,
|
|
2387
2413
|
"is_dcproxy": false,
|
|
2388
2414
|
"is_mobproxy": false,
|
|
@@ -2400,6 +2426,7 @@
|
|
|
2400
2426
|
"relay": {},
|
|
2401
2427
|
"tor": {},
|
|
2402
2428
|
"cdn": {},
|
|
2429
|
+
"bot": {},
|
|
2403
2430
|
"resproxy": {},
|
|
2404
2431
|
"dcproxy": {},
|
|
2405
2432
|
"mobproxy": {},
|
|
@@ -2508,6 +2535,7 @@
|
|
|
2508
2535
|
"is_anycast": true,
|
|
2509
2536
|
"is_carrier": false,
|
|
2510
2537
|
"is_satellite": false,
|
|
2538
|
+
"is_bot": false,
|
|
2511
2539
|
"is_ssh": false,
|
|
2512
2540
|
"is_smtp": false,
|
|
2513
2541
|
"is_web": true,
|
|
@@ -2523,7 +2551,8 @@
|
|
|
2523
2551
|
"satellite",
|
|
2524
2552
|
"ssh",
|
|
2525
2553
|
"smtp",
|
|
2526
|
-
"bittorrent"
|
|
2554
|
+
"bittorrent",
|
|
2555
|
+
"bot"
|
|
2527
2556
|
],
|
|
2528
2557
|
"web": [
|
|
2529
2558
|
{
|
|
@@ -2629,6 +2658,7 @@
|
|
|
2629
2658
|
"is_relay": false,
|
|
2630
2659
|
"is_tor": false,
|
|
2631
2660
|
"is_cdn": false,
|
|
2661
|
+
"is_bot": false,
|
|
2632
2662
|
"is_resproxy": false,
|
|
2633
2663
|
"is_dcproxy": false,
|
|
2634
2664
|
"is_mobproxy": false,
|
|
@@ -2646,6 +2676,7 @@
|
|
|
2646
2676
|
"relay": {},
|
|
2647
2677
|
"tor": {},
|
|
2648
2678
|
"cdn": {},
|
|
2679
|
+
"bot": {},
|
|
2649
2680
|
"resproxy": {},
|
|
2650
2681
|
"dcproxy": {},
|
|
2651
2682
|
"mobproxy": {},
|
|
@@ -2747,6 +2778,7 @@
|
|
|
2747
2778
|
"is_anycast": false,
|
|
2748
2779
|
"is_carrier": true,
|
|
2749
2780
|
"is_satellite": false,
|
|
2781
|
+
"is_bot": false,
|
|
2750
2782
|
"is_ssh": true,
|
|
2751
2783
|
"is_smtp": true,
|
|
2752
2784
|
"is_web": false,
|
|
@@ -2756,7 +2788,8 @@
|
|
|
2756
2788
|
"absent": [],
|
|
2757
2789
|
"emptyPresent": [
|
|
2758
2790
|
"satellite",
|
|
2759
|
-
"dns_resolver"
|
|
2791
|
+
"dns_resolver",
|
|
2792
|
+
"bot"
|
|
2760
2793
|
],
|
|
2761
2794
|
"carrier": {
|
|
2762
2795
|
"name": "T-Mobile US",
|
|
@@ -2858,6 +2891,7 @@
|
|
|
2858
2891
|
"is_relay": false,
|
|
2859
2892
|
"is_tor": false,
|
|
2860
2893
|
"is_cdn": false,
|
|
2894
|
+
"is_bot": false,
|
|
2861
2895
|
"is_resproxy": false,
|
|
2862
2896
|
"is_dcproxy": false,
|
|
2863
2897
|
"is_mobproxy": false,
|
|
@@ -2875,6 +2909,7 @@
|
|
|
2875
2909
|
"relay": {},
|
|
2876
2910
|
"tor": {},
|
|
2877
2911
|
"cdn": {},
|
|
2912
|
+
"bot": {},
|
|
2878
2913
|
"resproxy": {},
|
|
2879
2914
|
"dcproxy": {},
|
|
2880
2915
|
"mobproxy": {},
|
|
@@ -2949,6 +2984,7 @@
|
|
|
2949
2984
|
"isBogon": false,
|
|
2950
2985
|
"present": {
|
|
2951
2986
|
"is_satellite": true,
|
|
2987
|
+
"is_bot": false,
|
|
2952
2988
|
"is_carrier": false,
|
|
2953
2989
|
"is_web": false
|
|
2954
2990
|
},
|
|
@@ -2958,7 +2994,8 @@
|
|
|
2958
2994
|
"ssh",
|
|
2959
2995
|
"smtp",
|
|
2960
2996
|
"dns_resolver",
|
|
2961
|
-
"bittorrent"
|
|
2997
|
+
"bittorrent",
|
|
2998
|
+
"bot"
|
|
2962
2999
|
],
|
|
2963
3000
|
"satellite": {
|
|
2964
3001
|
"provider": "starlink",
|
|
@@ -3019,6 +3056,262 @@
|
|
|
3019
3056
|
},
|
|
3020
3057
|
"hostname": "customer.lsancax1.isp.starlinkisp.net"
|
|
3021
3058
|
}
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
"name": "unlimited-bot",
|
|
3062
|
+
"why": "Unlimited answers is_bot, true for an address a bot uses, here a verified Googlebot crawler's; whose bot it is, the bot object, is a paid plan's and stays absent, never empty.",
|
|
3063
|
+
"status": 200,
|
|
3064
|
+
"body": {
|
|
3065
|
+
"ip": "66.249.66.1",
|
|
3066
|
+
"is_bogon": false,
|
|
3067
|
+
"is_vpn": false,
|
|
3068
|
+
"is_relay": false,
|
|
3069
|
+
"is_tor": false,
|
|
3070
|
+
"is_bot": true,
|
|
3071
|
+
"is_anycast": false,
|
|
3072
|
+
"relay": {},
|
|
3073
|
+
"tor": {},
|
|
3074
|
+
"location": {
|
|
3075
|
+
"continent": "NA",
|
|
3076
|
+
"continent_name": "North America",
|
|
3077
|
+
"country": "US",
|
|
3078
|
+
"country_name": "United States",
|
|
3079
|
+
"timezone": "America/Los_Angeles",
|
|
3080
|
+
"currency_code": "USD",
|
|
3081
|
+
"currency_name": "Dollar",
|
|
3082
|
+
"currency_symbol": "$",
|
|
3083
|
+
"flag_emoji": "🇺🇸",
|
|
3084
|
+
"flag_unicode": "U+1F1FA U+1F1F8"
|
|
3085
|
+
},
|
|
3086
|
+
"asn": {
|
|
3087
|
+
"asn": 15169,
|
|
3088
|
+
"name": "Google LLC",
|
|
3089
|
+
"domain": "google.com",
|
|
3090
|
+
"type": "hosting",
|
|
3091
|
+
"prefix": "66.249.64.0/20",
|
|
3092
|
+
"country": "US",
|
|
3093
|
+
"rpki_status": "valid"
|
|
3094
|
+
},
|
|
3095
|
+
"hostname": "crawl-66-249-66-1.googlebot.com"
|
|
3096
|
+
},
|
|
3097
|
+
"expect": {
|
|
3098
|
+
"ip": "66.249.66.1",
|
|
3099
|
+
"isBogon": false,
|
|
3100
|
+
"present": {
|
|
3101
|
+
"is_vpn": false,
|
|
3102
|
+
"is_relay": false,
|
|
3103
|
+
"is_tor": false,
|
|
3104
|
+
"is_bot": true,
|
|
3105
|
+
"is_anycast": false
|
|
3106
|
+
},
|
|
3107
|
+
"absent": [
|
|
3108
|
+
"is_hosting",
|
|
3109
|
+
"is_cdn",
|
|
3110
|
+
"is_resproxy",
|
|
3111
|
+
"is_dcproxy",
|
|
3112
|
+
"is_mobproxy",
|
|
3113
|
+
"is_pubproxy",
|
|
3114
|
+
"is_carrier",
|
|
3115
|
+
"is_satellite",
|
|
3116
|
+
"is_ssh",
|
|
3117
|
+
"is_smtp",
|
|
3118
|
+
"is_web",
|
|
3119
|
+
"is_dns_resolver",
|
|
3120
|
+
"is_bittorrent",
|
|
3121
|
+
"vpn",
|
|
3122
|
+
"hosting",
|
|
3123
|
+
"cdn",
|
|
3124
|
+
"resproxy",
|
|
3125
|
+
"dcproxy",
|
|
3126
|
+
"mobproxy",
|
|
3127
|
+
"pubproxy",
|
|
3128
|
+
"carrier",
|
|
3129
|
+
"satellite",
|
|
3130
|
+
"ssh",
|
|
3131
|
+
"smtp",
|
|
3132
|
+
"dns_resolver",
|
|
3133
|
+
"bittorrent",
|
|
3134
|
+
"web",
|
|
3135
|
+
"company",
|
|
3136
|
+
"abuse",
|
|
3137
|
+
"bot"
|
|
3138
|
+
],
|
|
3139
|
+
"emptyPresent": [
|
|
3140
|
+
"relay",
|
|
3141
|
+
"tor"
|
|
3142
|
+
],
|
|
3143
|
+
"location": {
|
|
3144
|
+
"continent": "NA",
|
|
3145
|
+
"continent_name": "North America",
|
|
3146
|
+
"country": "US",
|
|
3147
|
+
"country_name": "United States",
|
|
3148
|
+
"timezone": "America/Los_Angeles",
|
|
3149
|
+
"currency_code": "USD",
|
|
3150
|
+
"currency_name": "Dollar",
|
|
3151
|
+
"currency_symbol": "$",
|
|
3152
|
+
"flag_emoji": "🇺🇸",
|
|
3153
|
+
"flag_unicode": "U+1F1FA U+1F1F8"
|
|
3154
|
+
},
|
|
3155
|
+
"asn": {
|
|
3156
|
+
"asn": 15169,
|
|
3157
|
+
"name": "Google LLC",
|
|
3158
|
+
"domain": "google.com",
|
|
3159
|
+
"type": "hosting",
|
|
3160
|
+
"prefix": "66.249.64.0/20",
|
|
3161
|
+
"country": "US",
|
|
3162
|
+
"rpki_status": "valid"
|
|
3163
|
+
},
|
|
3164
|
+
"hostname": "crawl-66-249-66-1.googlebot.com"
|
|
3165
|
+
}
|
|
3166
|
+
},
|
|
3167
|
+
{
|
|
3168
|
+
"name": "paid-verified-bot",
|
|
3169
|
+
"why": "A paid answer names whose bot uses the address in bot: the operator by ID and name, the bots by their user agents' names, what they do, and whether the operator vouches for the address (verified, identity, verified_by), with the confidence and the first and last day. agents and categories are lists, which a client keeps in order.",
|
|
3170
|
+
"status": 200,
|
|
3171
|
+
"body": {
|
|
3172
|
+
"ip": "66.249.66.1",
|
|
3173
|
+
"is_bogon": false,
|
|
3174
|
+
"is_vpn": false,
|
|
3175
|
+
"is_hosting": false,
|
|
3176
|
+
"is_relay": false,
|
|
3177
|
+
"is_tor": false,
|
|
3178
|
+
"is_cdn": false,
|
|
3179
|
+
"is_bot": true,
|
|
3180
|
+
"is_resproxy": false,
|
|
3181
|
+
"is_dcproxy": false,
|
|
3182
|
+
"is_mobproxy": false,
|
|
3183
|
+
"is_pubproxy": false,
|
|
3184
|
+
"is_anycast": false,
|
|
3185
|
+
"is_carrier": false,
|
|
3186
|
+
"is_satellite": false,
|
|
3187
|
+
"is_ssh": false,
|
|
3188
|
+
"is_smtp": false,
|
|
3189
|
+
"is_web": false,
|
|
3190
|
+
"is_dns_resolver": false,
|
|
3191
|
+
"is_bittorrent": false,
|
|
3192
|
+
"vpn": {},
|
|
3193
|
+
"hosting": {},
|
|
3194
|
+
"relay": {},
|
|
3195
|
+
"tor": {},
|
|
3196
|
+
"cdn": {},
|
|
3197
|
+
"bot": {
|
|
3198
|
+
"provider": "google",
|
|
3199
|
+
"provider_name": "Google",
|
|
3200
|
+
"agents": [
|
|
3201
|
+
"Google-CloudVertexBot",
|
|
3202
|
+
"GoogleOther",
|
|
3203
|
+
"Googlebot"
|
|
3204
|
+
],
|
|
3205
|
+
"categories": [
|
|
3206
|
+
"ai_search",
|
|
3207
|
+
"other",
|
|
3208
|
+
"search_engine"
|
|
3209
|
+
],
|
|
3210
|
+
"verified": true,
|
|
3211
|
+
"identity": "verified",
|
|
3212
|
+
"verified_by": "list",
|
|
3213
|
+
"confidence": "high",
|
|
3214
|
+
"first_seen": "2026-11-21",
|
|
3215
|
+
"last_seen": "2026-11-21"
|
|
3216
|
+
},
|
|
3217
|
+
"resproxy": {},
|
|
3218
|
+
"dcproxy": {},
|
|
3219
|
+
"mobproxy": {},
|
|
3220
|
+
"pubproxy": {},
|
|
3221
|
+
"carrier": {},
|
|
3222
|
+
"satellite": {},
|
|
3223
|
+
"ssh": {},
|
|
3224
|
+
"smtp": {},
|
|
3225
|
+
"web": [],
|
|
3226
|
+
"dns_resolver": {},
|
|
3227
|
+
"bittorrent": {},
|
|
3228
|
+
"location": {
|
|
3229
|
+
"continent": "NA",
|
|
3230
|
+
"continent_name": "North America",
|
|
3231
|
+
"country": "US",
|
|
3232
|
+
"country_name": "United States",
|
|
3233
|
+
"timezone": "America/Los_Angeles",
|
|
3234
|
+
"currency_code": "USD",
|
|
3235
|
+
"currency_name": "US Dollar",
|
|
3236
|
+
"currency_symbol": "$",
|
|
3237
|
+
"flag_emoji": "🇺🇸",
|
|
3238
|
+
"flag_unicode": "U+1F1FA U+1F1F8",
|
|
3239
|
+
"region": "California",
|
|
3240
|
+
"region_code": "US-CA",
|
|
3241
|
+
"city": "Los Angeles",
|
|
3242
|
+
"postal_code": "90001",
|
|
3243
|
+
"latitude": 34.05223,
|
|
3244
|
+
"longitude": -118.24368,
|
|
3245
|
+
"accuracy_radius": 500,
|
|
3246
|
+
"geoname_id": "5368361",
|
|
3247
|
+
"dma_code": "803",
|
|
3248
|
+
"last_changed": "2026-10-20"
|
|
3249
|
+
},
|
|
3250
|
+
"asn": {
|
|
3251
|
+
"asn": 14593,
|
|
3252
|
+
"name": "Space Exploration Technologies Corporation",
|
|
3253
|
+
"domain": "spacex.com",
|
|
3254
|
+
"type": "isp",
|
|
3255
|
+
"prefix": "98.97.0.0/20",
|
|
3256
|
+
"country": "US",
|
|
3257
|
+
"rpki_status": "valid"
|
|
3258
|
+
},
|
|
3259
|
+
"company": {
|
|
3260
|
+
"name": "Starlink",
|
|
3261
|
+
"domain": "starlink.com",
|
|
3262
|
+
"type": "isp",
|
|
3263
|
+
"country": "US"
|
|
3264
|
+
},
|
|
3265
|
+
"hostname": "customer.lsancax1.isp.starlinkisp.net",
|
|
3266
|
+
"abuse": {
|
|
3267
|
+
"email": "abuse@spacex.com",
|
|
3268
|
+
"name": "SpaceX Abuse",
|
|
3269
|
+
"phone": "",
|
|
3270
|
+
"address": "Hawthorne, CA, US",
|
|
3271
|
+
"country": "US",
|
|
3272
|
+
"network": "98.97.0.0-98.97.15.255",
|
|
3273
|
+
"validated": true,
|
|
3274
|
+
"unvalidated_since": ""
|
|
3275
|
+
},
|
|
3276
|
+
"cap_reached": false
|
|
3277
|
+
},
|
|
3278
|
+
"expect": {
|
|
3279
|
+
"ip": "66.249.66.1",
|
|
3280
|
+
"isBogon": false,
|
|
3281
|
+
"present": {
|
|
3282
|
+
"is_vpn": false,
|
|
3283
|
+
"is_bot": true,
|
|
3284
|
+
"is_hosting": false,
|
|
3285
|
+
"is_satellite": false
|
|
3286
|
+
},
|
|
3287
|
+
"absent": [],
|
|
3288
|
+
"emptyPresent": [
|
|
3289
|
+
"vpn",
|
|
3290
|
+
"hosting",
|
|
3291
|
+
"satellite",
|
|
3292
|
+
"cdn"
|
|
3293
|
+
],
|
|
3294
|
+
"bot": {
|
|
3295
|
+
"provider": "google",
|
|
3296
|
+
"provider_name": "Google",
|
|
3297
|
+
"agents": [
|
|
3298
|
+
"Google-CloudVertexBot",
|
|
3299
|
+
"GoogleOther",
|
|
3300
|
+
"Googlebot"
|
|
3301
|
+
],
|
|
3302
|
+
"categories": [
|
|
3303
|
+
"ai_search",
|
|
3304
|
+
"other",
|
|
3305
|
+
"search_engine"
|
|
3306
|
+
],
|
|
3307
|
+
"verified": true,
|
|
3308
|
+
"identity": "verified",
|
|
3309
|
+
"verified_by": "list",
|
|
3310
|
+
"confidence": "high",
|
|
3311
|
+
"first_seen": "2026-11-21",
|
|
3312
|
+
"last_seen": "2026-11-21"
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3022
3315
|
}
|
|
3023
3316
|
],
|
|
3024
3317
|
"errors": [
|
|
@@ -8072,7 +8365,9 @@
|
|
|
8072
8365
|
"name": "M247 Europe SRL",
|
|
8073
8366
|
"domain": "m247global.com",
|
|
8074
8367
|
"type": "hosting",
|
|
8075
|
-
"prefix": "146.70.116.0/24"
|
|
8368
|
+
"prefix": "146.70.116.0/24",
|
|
8369
|
+
"country": "US",
|
|
8370
|
+
"rpki_status": "valid"
|
|
8076
8371
|
}
|
|
8077
8372
|
},
|
|
8078
8373
|
"condition": {
|
|
@@ -8112,7 +8407,9 @@
|
|
|
8112
8407
|
"name": "M247 Europe SRL",
|
|
8113
8408
|
"domain": "m247global.com",
|
|
8114
8409
|
"type": "hosting",
|
|
8115
|
-
"prefix": "146.70.116.0/24"
|
|
8410
|
+
"prefix": "146.70.116.0/24",
|
|
8411
|
+
"country": "US",
|
|
8412
|
+
"rpki_status": "valid"
|
|
8116
8413
|
}
|
|
8117
8414
|
},
|
|
8118
8415
|
"condition": {
|
|
@@ -8155,7 +8452,9 @@
|
|
|
8155
8452
|
"name": "M247 Europe SRL",
|
|
8156
8453
|
"domain": "m247global.com",
|
|
8157
8454
|
"type": "hosting",
|
|
8158
|
-
"prefix": "146.70.116.0/24"
|
|
8455
|
+
"prefix": "146.70.116.0/24",
|
|
8456
|
+
"country": "US",
|
|
8457
|
+
"rpki_status": "valid"
|
|
8159
8458
|
}
|
|
8160
8459
|
},
|
|
8161
8460
|
"condition": {
|
|
@@ -8195,7 +8494,9 @@
|
|
|
8195
8494
|
"name": "M247 Europe SRL",
|
|
8196
8495
|
"domain": "m247global.com",
|
|
8197
8496
|
"type": "hosting",
|
|
8198
|
-
"prefix": "146.70.116.0/24"
|
|
8497
|
+
"prefix": "146.70.116.0/24",
|
|
8498
|
+
"country": "US",
|
|
8499
|
+
"rpki_status": "valid"
|
|
8199
8500
|
}
|
|
8200
8501
|
},
|
|
8201
8502
|
"condition": {
|
|
@@ -8235,7 +8536,9 @@
|
|
|
8235
8536
|
"name": "M247 Europe SRL",
|
|
8236
8537
|
"domain": "m247global.com",
|
|
8237
8538
|
"type": "hosting",
|
|
8238
|
-
"prefix": "146.70.116.0/24"
|
|
8539
|
+
"prefix": "146.70.116.0/24",
|
|
8540
|
+
"country": "US",
|
|
8541
|
+
"rpki_status": "valid"
|
|
8239
8542
|
}
|
|
8240
8543
|
},
|
|
8241
8544
|
"condition": {
|
|
@@ -106,6 +106,19 @@ def test_blocks_when_the_condition_matches_and_the_endpoint_never_runs() -> None
|
|
|
106
106
|
assert status == 200
|
|
107
107
|
|
|
108
108
|
|
|
109
|
+
@pytest.mark.parametrize("condition", [{"is_bot": True}, {"bot": {"verified": True}}])
|
|
110
|
+
def test_a_condition_on_a_bot_blocks_a_bot_and_passes_the_rest(
|
|
111
|
+
condition: dict[str, Any],
|
|
112
|
+
) -> None:
|
|
113
|
+
for is_bot, bot in ((True, {"provider": "google", "verified": True}), (False, {})):
|
|
114
|
+
served = serving({"is_vpn": False, "is_bot": is_bot, "bot": bot})
|
|
115
|
+
status, _ = get(
|
|
116
|
+
app_with(client=served, ip_selector=fixed_ip, block_condition=condition)
|
|
117
|
+
)
|
|
118
|
+
assert status == (403 if is_bot else 200), f"{condition} against is_bot {is_bot}"
|
|
119
|
+
assert served.asked == [PUBLIC_IP]
|
|
120
|
+
|
|
121
|
+
|
|
109
122
|
def test_a_condition_reaches_the_evidence_fields() -> None:
|
|
110
123
|
nord = serving({"is_vpn": True, "vpn": {"provider": "nordvpn"}})
|
|
111
124
|
status, _ = get(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vpndetection_fastapi-2.1.28 → vpndetection_fastapi-2.1.29}/src/vpndetection_fastapi/py.typed
RENAMED
|
File without changes
|
|
File without changes
|