vpndetection-fastapi 2.1.20__tar.gz → 2.1.22__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.20 → vpndetection_fastapi-2.1.22}/CHANGELOG.md +12 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/PKG-INFO +4 -4
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/README.md +2 -2
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/pyproject.toml +1 -1
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/src/vpndetection_fastapi/__init__.py +1 -1
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/testdata/testdata.json +205 -16
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/.github/workflows/ci.yml +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/.github/workflows/release.yml +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/.gitignore +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/LICENSE +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/SECURITY.md +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/src/vpndetection_fastapi/py.typed +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/testdata/bogons.json +0 -0
- {vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/tests/test_middleware.py +0 -0
|
@@ -2,6 +2,18 @@
|
|
|
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.22 - 2026-11-11
|
|
6
|
+
|
|
7
|
+
### Fixes
|
|
8
|
+
|
|
9
|
+
- Require vpndetection 5.15.1: the free plan's daily trial, never a trial key ([`46742f4`](https://github.com/vpndetection-io/sdk-python-fastapi/commit/46742f4a2b4c9a43af7fd7ca49938c9b60f28694))
|
|
10
|
+
|
|
11
|
+
## 2.1.21 - 2026-11-11
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Require vpndetection 5.15.0: trial_expired on a trial key's answers ([`24fa4aa`](https://github.com/vpndetection-io/sdk-python-fastapi/commit/24fa4aaa83e87cbf43203aaf71d9686e7ba2c9f2))
|
|
16
|
+
|
|
5
17
|
## 2.1.20 - 2026-11-11
|
|
6
18
|
|
|
7
19
|
### Fixes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: vpndetection-fastapi
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.22
|
|
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.15.1
|
|
24
24
|
Provides-Extra: dev
|
|
25
25
|
Requires-Dist: fastapi>=0.115; extra == 'dev'
|
|
26
26
|
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
@@ -45,7 +45,7 @@ pip install vpndetection-fastapi
|
|
|
45
45
|
|
|
46
46
|
Requires Python 3.11 or newer.
|
|
47
47
|
|
|
48
|
-
You need an API key. Create one in the [console](https://app.vpndetection.io); without one a lookup is on
|
|
48
|
+
You need an API key on a paid plan. Create one in the [console](https://app.vpndetection.io); without one a lookup is on Unlimited, the free plan, and leaves out the hosting, CDN and proxy flags, so a paid plan is what makes this usable in production rather than optional. A free account tries every field, 100 lookups a day.
|
|
49
49
|
|
|
50
50
|
```python
|
|
51
51
|
from fastapi import FastAPI
|
|
@@ -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
|
-
|
|
149
|
+
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn` and the four proxy flags, 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
|
|
@@ -15,7 +15,7 @@ pip install vpndetection-fastapi
|
|
|
15
15
|
|
|
16
16
|
Requires Python 3.11 or newer.
|
|
17
17
|
|
|
18
|
-
You need an API key. Create one in the [console](https://app.vpndetection.io); without one a lookup is on
|
|
18
|
+
You need an API key on a paid plan. Create one in the [console](https://app.vpndetection.io); without one a lookup is on Unlimited, the free plan, and leaves out the hosting, CDN and proxy flags, so a paid plan is what makes this usable in production rather than optional. A free account tries every field, 100 lookups a day.
|
|
19
19
|
|
|
20
20
|
```python
|
|
21
21
|
from fastapi import FastAPI
|
|
@@ -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
|
-
|
|
119
|
+
Unlimited, with a key or without one, leaves out `is_hosting`, `is_cdn` and the four proxy flags, 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
|
|
@@ -371,7 +371,8 @@
|
|
|
371
371
|
"dcproxy",
|
|
372
372
|
"mobproxy",
|
|
373
373
|
"is_pubproxy",
|
|
374
|
-
"pubproxy"
|
|
374
|
+
"pubproxy",
|
|
375
|
+
"trial_expired"
|
|
375
376
|
]
|
|
376
377
|
}
|
|
377
378
|
},
|
|
@@ -624,7 +625,9 @@
|
|
|
624
625
|
"is_mobproxy": false,
|
|
625
626
|
"is_pubproxy": false
|
|
626
627
|
},
|
|
627
|
-
"absent": [
|
|
628
|
+
"absent": [
|
|
629
|
+
"trial_expired"
|
|
630
|
+
],
|
|
628
631
|
"emptyPresent": [
|
|
629
632
|
"vpn",
|
|
630
633
|
"hosting",
|
|
@@ -639,8 +642,8 @@
|
|
|
639
642
|
}
|
|
640
643
|
},
|
|
641
644
|
{
|
|
642
|
-
"name": "
|
|
643
|
-
"why": "The answer
|
|
645
|
+
"name": "unlimited-location-asn",
|
|
646
|
+
"why": "The Unlimited tier's answer, with a key or without one: Tor and relay beside the VPN flag, and where the address is and which AS announces it. location and asn carry every key whenever present, so each maps whole.",
|
|
644
647
|
"status": 200,
|
|
645
648
|
"body": {
|
|
646
649
|
"ip": "146.70.116.130",
|
|
@@ -690,7 +693,8 @@
|
|
|
690
693
|
"resproxy",
|
|
691
694
|
"dcproxy",
|
|
692
695
|
"mobproxy",
|
|
693
|
-
"pubproxy"
|
|
696
|
+
"pubproxy",
|
|
697
|
+
"trial_expired"
|
|
694
698
|
],
|
|
695
699
|
"emptyPresent": [
|
|
696
700
|
"relay",
|
|
@@ -718,8 +722,8 @@
|
|
|
718
722
|
}
|
|
719
723
|
},
|
|
720
724
|
{
|
|
721
|
-
"name": "
|
|
722
|
-
"why": "
|
|
725
|
+
"name": "flags-without-detail",
|
|
726
|
+
"why": "Every flag, but no detail object behind the six flags past the Unlimited tier's and no vpn object. Each flag maps on its own, and the detail it lacks stays absent rather than empty.",
|
|
723
727
|
"status": 200,
|
|
724
728
|
"body": {
|
|
725
729
|
"ip": "146.70.116.130",
|
|
@@ -801,6 +805,190 @@
|
|
|
801
805
|
"prefix": "146.70.116.0/24"
|
|
802
806
|
}
|
|
803
807
|
}
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
"name": "trial-full-answer",
|
|
811
|
+
"why": "A free-plan key within its UTC day's trial, the first 100 lookups: every field, as a paid plan answers it, and trial_expired false. trial_expired maps on presence like any flag.",
|
|
812
|
+
"status": 200,
|
|
813
|
+
"body": {
|
|
814
|
+
"ip": "146.70.116.130",
|
|
815
|
+
"is_vpn": true,
|
|
816
|
+
"is_hosting": true,
|
|
817
|
+
"is_relay": false,
|
|
818
|
+
"is_tor": false,
|
|
819
|
+
"is_cdn": false,
|
|
820
|
+
"is_resproxy": false,
|
|
821
|
+
"is_dcproxy": false,
|
|
822
|
+
"is_mobproxy": false,
|
|
823
|
+
"is_pubproxy": false,
|
|
824
|
+
"vpn": {
|
|
825
|
+
"provider": "mullvad",
|
|
826
|
+
"last_seen": "2026-09-02",
|
|
827
|
+
"confidence": "high"
|
|
828
|
+
},
|
|
829
|
+
"hosting": {
|
|
830
|
+
"provider": "m247",
|
|
831
|
+
"confidence": "high",
|
|
832
|
+
"last_seen": "2026-09-02"
|
|
833
|
+
},
|
|
834
|
+
"relay": {},
|
|
835
|
+
"tor": {},
|
|
836
|
+
"cdn": {},
|
|
837
|
+
"resproxy": {},
|
|
838
|
+
"dcproxy": {},
|
|
839
|
+
"mobproxy": {},
|
|
840
|
+
"pubproxy": {},
|
|
841
|
+
"location": {
|
|
842
|
+
"continent": "EU",
|
|
843
|
+
"continent_name": "Europe",
|
|
844
|
+
"country": "AT",
|
|
845
|
+
"country_name": "Austria",
|
|
846
|
+
"timezone": "Europe/Vienna",
|
|
847
|
+
"currency_code": "EUR",
|
|
848
|
+
"currency_name": "Euro",
|
|
849
|
+
"currency_symbol": "€",
|
|
850
|
+
"flag_emoji": "🇦🇹",
|
|
851
|
+
"flag_unicode": "U+1F1E6 U+1F1F9"
|
|
852
|
+
},
|
|
853
|
+
"asn": {
|
|
854
|
+
"asn": 9009,
|
|
855
|
+
"name": "M247 Europe SRL",
|
|
856
|
+
"domain": "m247global.com",
|
|
857
|
+
"type": "hosting",
|
|
858
|
+
"prefix": "146.70.116.0/24"
|
|
859
|
+
},
|
|
860
|
+
"trial_expired": false
|
|
861
|
+
},
|
|
862
|
+
"expect": {
|
|
863
|
+
"ip": "146.70.116.130",
|
|
864
|
+
"isBogon": false,
|
|
865
|
+
"present": {
|
|
866
|
+
"is_vpn": true,
|
|
867
|
+
"is_hosting": true,
|
|
868
|
+
"is_relay": false,
|
|
869
|
+
"is_tor": false,
|
|
870
|
+
"is_cdn": false,
|
|
871
|
+
"is_resproxy": false,
|
|
872
|
+
"is_dcproxy": false,
|
|
873
|
+
"is_mobproxy": false,
|
|
874
|
+
"is_pubproxy": false,
|
|
875
|
+
"trial_expired": false
|
|
876
|
+
},
|
|
877
|
+
"emptyPresent": [
|
|
878
|
+
"relay",
|
|
879
|
+
"tor",
|
|
880
|
+
"cdn",
|
|
881
|
+
"resproxy",
|
|
882
|
+
"dcproxy",
|
|
883
|
+
"mobproxy",
|
|
884
|
+
"pubproxy"
|
|
885
|
+
],
|
|
886
|
+
"vpn": {
|
|
887
|
+
"provider": "mullvad",
|
|
888
|
+
"last_seen": "2026-09-02",
|
|
889
|
+
"confidence": "high"
|
|
890
|
+
},
|
|
891
|
+
"location": {
|
|
892
|
+
"continent": "EU",
|
|
893
|
+
"continent_name": "Europe",
|
|
894
|
+
"country": "AT",
|
|
895
|
+
"country_name": "Austria",
|
|
896
|
+
"timezone": "Europe/Vienna",
|
|
897
|
+
"currency_code": "EUR",
|
|
898
|
+
"currency_name": "Euro",
|
|
899
|
+
"currency_symbol": "€",
|
|
900
|
+
"flag_emoji": "🇦🇹",
|
|
901
|
+
"flag_unicode": "U+1F1E6 U+1F1F9"
|
|
902
|
+
},
|
|
903
|
+
"asn": {
|
|
904
|
+
"asn": 9009,
|
|
905
|
+
"name": "M247 Europe SRL",
|
|
906
|
+
"domain": "m247global.com",
|
|
907
|
+
"type": "hosting",
|
|
908
|
+
"prefix": "146.70.116.0/24"
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"name": "trial-expired-answer",
|
|
914
|
+
"why": "A free-plan key past its UTC day's trial: Unlimited's answer, and trial_expired true. What the day no longer answers is absent, never false.",
|
|
915
|
+
"status": 200,
|
|
916
|
+
"body": {
|
|
917
|
+
"ip": "146.70.116.130",
|
|
918
|
+
"is_vpn": true,
|
|
919
|
+
"is_relay": false,
|
|
920
|
+
"is_tor": false,
|
|
921
|
+
"relay": {},
|
|
922
|
+
"tor": {},
|
|
923
|
+
"location": {
|
|
924
|
+
"continent": "EU",
|
|
925
|
+
"continent_name": "Europe",
|
|
926
|
+
"country": "AT",
|
|
927
|
+
"country_name": "Austria",
|
|
928
|
+
"timezone": "Europe/Vienna",
|
|
929
|
+
"currency_code": "EUR",
|
|
930
|
+
"currency_name": "Euro",
|
|
931
|
+
"currency_symbol": "€",
|
|
932
|
+
"flag_emoji": "🇦🇹",
|
|
933
|
+
"flag_unicode": "U+1F1E6 U+1F1F9"
|
|
934
|
+
},
|
|
935
|
+
"asn": {
|
|
936
|
+
"asn": 9009,
|
|
937
|
+
"name": "M247 Europe SRL",
|
|
938
|
+
"domain": "m247global.com",
|
|
939
|
+
"type": "hosting",
|
|
940
|
+
"prefix": "146.70.116.0/24"
|
|
941
|
+
},
|
|
942
|
+
"trial_expired": true
|
|
943
|
+
},
|
|
944
|
+
"expect": {
|
|
945
|
+
"ip": "146.70.116.130",
|
|
946
|
+
"isBogon": false,
|
|
947
|
+
"present": {
|
|
948
|
+
"is_vpn": true,
|
|
949
|
+
"is_relay": false,
|
|
950
|
+
"is_tor": false,
|
|
951
|
+
"trial_expired": true
|
|
952
|
+
},
|
|
953
|
+
"absent": [
|
|
954
|
+
"is_hosting",
|
|
955
|
+
"is_cdn",
|
|
956
|
+
"is_resproxy",
|
|
957
|
+
"is_dcproxy",
|
|
958
|
+
"is_mobproxy",
|
|
959
|
+
"is_pubproxy",
|
|
960
|
+
"vpn",
|
|
961
|
+
"hosting",
|
|
962
|
+
"cdn",
|
|
963
|
+
"resproxy",
|
|
964
|
+
"dcproxy",
|
|
965
|
+
"mobproxy",
|
|
966
|
+
"pubproxy"
|
|
967
|
+
],
|
|
968
|
+
"emptyPresent": [
|
|
969
|
+
"relay",
|
|
970
|
+
"tor"
|
|
971
|
+
],
|
|
972
|
+
"location": {
|
|
973
|
+
"continent": "EU",
|
|
974
|
+
"continent_name": "Europe",
|
|
975
|
+
"country": "AT",
|
|
976
|
+
"country_name": "Austria",
|
|
977
|
+
"timezone": "Europe/Vienna",
|
|
978
|
+
"currency_code": "EUR",
|
|
979
|
+
"currency_name": "Euro",
|
|
980
|
+
"currency_symbol": "€",
|
|
981
|
+
"flag_emoji": "🇦🇹",
|
|
982
|
+
"flag_unicode": "U+1F1E6 U+1F1F9"
|
|
983
|
+
},
|
|
984
|
+
"asn": {
|
|
985
|
+
"asn": 9009,
|
|
986
|
+
"name": "M247 Europe SRL",
|
|
987
|
+
"domain": "m247global.com",
|
|
988
|
+
"type": "hosting",
|
|
989
|
+
"prefix": "146.70.116.0/24"
|
|
990
|
+
}
|
|
991
|
+
}
|
|
804
992
|
}
|
|
805
993
|
],
|
|
806
994
|
"errors": [
|
|
@@ -885,14 +1073,14 @@
|
|
|
885
1073
|
}
|
|
886
1074
|
},
|
|
887
1075
|
{
|
|
888
|
-
"name": "
|
|
889
|
-
"why": "Retry-After present. A
|
|
1076
|
+
"name": "unlimited-rate-limit-is-retryable",
|
|
1077
|
+
"why": "Retry-After present. A lookup on Unlimited, the free plan, with a key or without one, that the API is protecting itself from is told when to come back, which is a rate limit, so retrying after the wait WILL succeed.",
|
|
890
1078
|
"status": 429,
|
|
891
1079
|
"headers": {
|
|
892
1080
|
"Retry-After": "1"
|
|
893
1081
|
},
|
|
894
1082
|
"body": {
|
|
895
|
-
"error": "per-minute limit for
|
|
1083
|
+
"error": "per-minute limit for Unlimited lookups exceeded; retry shortly, or use a paid plan"
|
|
896
1084
|
},
|
|
897
1085
|
"expect": {
|
|
898
1086
|
"kind": "rate_limited",
|
|
@@ -901,16 +1089,17 @@
|
|
|
901
1089
|
}
|
|
902
1090
|
},
|
|
903
1091
|
{
|
|
904
|
-
"name": "plan-
|
|
905
|
-
"why": "
|
|
906
|
-
"status":
|
|
1092
|
+
"name": "batch-needs-a-paid-plan-is-a-bad-request",
|
|
1093
|
+
"why": "A free-plan key's batch of more than one address answers 402. To a client it is any other 4xx: refused as asked, never retried, its message the API's.",
|
|
1094
|
+
"status": 402,
|
|
907
1095
|
"headers": {},
|
|
908
1096
|
"body": {
|
|
909
|
-
"error": "
|
|
1097
|
+
"error": "POST /batch needs a paid plan"
|
|
910
1098
|
},
|
|
911
1099
|
"expect": {
|
|
912
|
-
"kind": "
|
|
913
|
-
"retryable": false
|
|
1100
|
+
"kind": "bad_request",
|
|
1101
|
+
"retryable": false,
|
|
1102
|
+
"message": "POST /batch needs a paid plan"
|
|
914
1103
|
}
|
|
915
1104
|
},
|
|
916
1105
|
{
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{vpndetection_fastapi-2.1.20 → vpndetection_fastapi-2.1.22}/src/vpndetection_fastapi/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|