-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Implement bot detection categories #1618
Conversation
😎 Merged successfully - details. |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
@davidmytton I've added an example for the bot categories. Please try it out! I also included usage and details about your filtering request in the example. |
Note to self: add this to dependabot and CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the nextjs-14-bot-categories example app, but I don't get the category in the headers or when the decision is logged:
< HTTP/1.1 429 Too Many Requests
< vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch
< content-type: application/json
< x-arcjet-bot-allowed:
< x-arcjet-bot-denied: CURL
< Date: Sun, 15 Sep 2024 16:45:40 GMT
< Connection: keep-alive
< Keep-Alive: timeout=5
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
{"error":"You are a Bot!"}%
ArcjetDenyDecision {
id: 'req_01j7v96s53fc7btc6naz433qce',
results: [
ArcjetRuleResult {
ruleId: '',
ttl: 60,
state: 'RUN',
conclusion: 'DENY',
reason: [ArcjetBotReason]
}
],
ttl: 60,
ip: ArcjetIpDetails {
latitude: undefined,
longitude: undefined,
accuracyRadius: undefined,
timezone: undefined,
postalCode: undefined,
city: undefined,
region: undefined,
country: undefined,
countryName: undefined,
continent: undefined,
continentName: undefined,
asn: undefined,
asnName: undefined,
asnDomain: undefined,
asnType: undefined,
asnCountry: undefined,
service: undefined
},
conclusion: 'DENY',
reason: ArcjetBotReason { type: 'BOT', allowed: [], denied: [ 'CURL' ] }
Co-authored-by: David Mytton <david@arcjet.com>
@davidmytton did you test against the decide service running locally? Since the example is using an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh I was testing against prod. Just tested against the local branch and all looks good!
Automatically generated with [Release Please](https://github.com/googleapis/release-please). --- <details><summary>@arcjet/analyze: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/analyze-v1.0.0-alpha.26) (2024-09-16) ### 🚀 New Features * Implement bot detection categories ([#1618](#1618)) ([540cfe8](540cfe8)) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/body: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/body-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/body:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/bun: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/bun-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/bun:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/headers bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/ip bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/logger bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/transport bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * arcjet bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/decorate: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/decorate-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/decorate:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/sprintf bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/duration: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/duration-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/duration:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/env: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/env-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/env:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/eslint-config: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/eslint-config-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/eslint-config:** Synchronize arcjet-js versions </details> <details><summary>@arcjet/headers: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/headers-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/headers:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/ip: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/ip-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/ip:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/logger: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/logger-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/logger:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/sprintf bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/next: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/next-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/next:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/headers bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/ip bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/logger bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/transport bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * arcjet bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/node: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/node-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/node:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/headers bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/ip bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/logger bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/transport bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/body bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * arcjet bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/protocol: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/protocol-v1.0.0-alpha.26) (2024-09-16) ### 🚀 New Features * Implement bot detection categories ([#1618](#1618)) ([540cfe8](540cfe8)) ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/redact: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/redact-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/redact:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/redact-wasm bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/redact-wasm: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/redact-wasm-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/redact-wasm:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/rollup-config: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/rollup-config-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/rollup-config:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/runtime: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/runtime-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/runtime:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/sprintf: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/sprintf-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/sprintf:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/sveltekit: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/sveltekit-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/sveltekit:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/env bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/headers bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/ip bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/logger bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/transport bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * arcjet bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/transport: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/transport-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/transport:** Synchronize arcjet-js versions ### Dependencies * The following workspace dependencies were updated * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>@arcjet/tsconfig: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](https://github.com/arcjet/arcjet-js/compare/v1.0.0-alpha.25...@arcjet/tsconfig-v1.0.0-alpha.26) (2024-09-16) ### 🧹 Miscellaneous Chores * **@arcjet/tsconfig:** Synchronize arcjet-js versions </details> <details><summary>arcjet: 1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](v1.0.0-alpha.25...arcjet-v1.0.0-alpha.26) (2024-09-16) ### 🚀 New Features * Implement bot detection categories ([#1618](#1618)) ([540cfe8](540cfe8)) ### Dependencies * The following workspace dependencies were updated * dependencies * @arcjet/analyze bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/duration bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/headers bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/protocol bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/runtime bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * devDependencies * @arcjet/eslint-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/rollup-config bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 * @arcjet/tsconfig bumped from 1.0.0-alpha.25 to 1.0.0-alpha.26 </details> <details><summary>1.0.0-alpha.26</summary> ## [1.0.0-alpha.26](v1.0.0-alpha.25...v1.0.0-alpha.26) (2024-09-16) ### 🚀 New Features * Implement bot detection categories ([#1618](#1618)) ([540cfe8](540cfe8)) ### 🧹 Miscellaneous Chores * **ci:** Ignore eslint majors for our nestjs example ([#1638](#1638)) ([16be215](16be215)) * **ci:** Increase our dependabot open PR limit ([#1670](#1670)) ([5dee404](5dee404)) * **ci:** Sort dependabot projects and add missing nestjs example ([#1617](#1617)) ([4c0e77b](4c0e77b)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This is mostly just codegen and a little bit of type updates.
I'm planning to add a new example for categories, with the additional demonstration of filtering items from a category.