vpndetection-fastify 2.1.4 → 2.1.6

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.
Files changed (2) hide show
  1. package/README.md +4 -4
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -55,7 +55,7 @@ blockCondition: { isVpn: true, vpn: { provider: 'nordvpn' } } // one pro
55
55
  blockCondition: { isResproxy: true, resproxy: { hits: { gte: 5 } } } // a numeric threshold
56
56
  blockCondition: { vpn: { confidence: ['high', 'medium'] } } // any of these
57
57
  blockCondition: [{ isTor: true }, { isResproxy: true }] // a list is OR
58
- blockCondition: { isBot: true } // a bot, such as a crawler, on every plan
58
+ blockCondition: { isBot: true } // a bot, such as a crawler, on a paid plan
59
59
  ```
60
60
 
61
61
  Values are matched by equality, strings without regard to case. An array means any-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`) matches when any element does: `{ pubproxy: { protocols: 'socks5' } }` matches a proxy that speaks SOCKS5 among others, and an object term such as `{ web: { port: 443 } }` must match one element in full. Members you set to `false` or `null` 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 created rather than silently blocking all your traffic.
@@ -84,7 +84,7 @@ await app.register(vpndetection, {
84
84
  });
85
85
  ```
86
86
 
87
- A client claiming to be a crawler from an address its operator does not vouch for reads `spoofed`, so `blockCondition: { userAgent: { verdict: 'spoofed' } }` refuses a forged crawler. Any other agent, or none, is not sent, since its verdict could only be `not_bot`. One address is looked up with at most four crawler agents an hour: past those its lookup sends none, and a request passes as a crawler only where the answer's `bot.verified` is true. It is off by default, and then no agent is sent and the cache keeps one answer per address rather than one per address and agent. A verdict needs a paid plan or the trial: a served answer without one is reported once under `onMissingField`.
87
+ A client claiming to be a crawler from an address its operator does not vouch for reads `spoofed`, so `blockCondition: { userAgent: { verdict: 'spoofed' } }` refuses a forged crawler. Any other agent, or none, is not sent, since its verdict could only be `not_bot`. One address is looked up with at most four crawler agents an hour: past those its lookup sends none, and a request passes as a crawler only where the answer's `bot.verified` is true. It is off by default, and then no agent is sent and the cache keeps one answer per address rather than one per address and agent. A verdict needs a paid plan or the trial: a served answer without one is reported once under `onMissingField`. The verdict is a paid member, so an app with no key gets no bot pass.
88
88
 
89
89
  ## Where the client address comes from
90
90
 
@@ -183,13 +183,13 @@ Beyond a few million distinct visitors a day, stop calling the API per request:
183
183
 
184
184
  ## Absent is not false
185
185
 
186
- Unlimited, with a key or without one, leaves out `isHosting`, `isCdn`, the four proxy flags, the carrier, satellite and service flags, `bot`, `userAgent`, `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 `undefined`, which means "not in your plan" rather than "checked, and no".
186
+ Unlimited, with a key or without one, leaves out `isHosting`, `isCdn`, the four proxy flags, the carrier, satellite and service flags, `isBot`, `bot`, `userAgent`, `company` and `abuse`, and the AS's `type`, and of the detail behind each flag it answers only Tor's and relay's. A field your plan does not include is `undefined`, which means "not in your plan" rather than "checked, and no".
187
187
 
188
188
  ```js
189
189
  request.vpndetection.result.isHosting ?? false // when you only want the flag
190
190
  ```
191
191
 
192
- A `blockCondition` naming a member your plan does not serve can never match, so the plugin warns once instead of failing silently. Set `onMissingField: 'throw'` to make it an error.
192
+ A `blockCondition` naming a member your plan does not serve can never match, so the plugin warns once instead of failing silently. Set `onMissingField: 'throw'` to make it an error. A condition on `isBot` or `asn.type` with no key is one: both are a paid plan's, so it never matches and is reported as missing, `asn.type` by its path.
193
193
 
194
194
  ## Other Libraries
195
195
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpndetection-fastify",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "description": "Official Fastify plugin for the VPNDetection API. Detect VPNs, proxies, Tor, hosting and CDN visitors on every request.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "fastify-plugin": "^5.0.1",
48
- "vpndetection": "^5.22.1"
48
+ "vpndetection": "^5.23.1"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "fastify": "4.x || 5.x"