Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

chore: add ja3Hash to request.cf.botManagement #258

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

KianNH
Copy link
Contributor

@KianNH KianNH commented Jul 11, 2022

Closes #213

Example: https://kian.org.uk/cf.json

"botManagement": {
  "ja3Hash": "2a18e6bf307f97c5e27f0ab407dc65db",
  "staticResource": false,
  "verifiedBot": false,
  "score": 98
},

It doesn't appear on all zones with Bot Management, i.e https://workers.cloudflare.com/cf.json, so adding as optional.

Closes cloudflare#213

Example: https://kian.org.uk/cf.json

```json
"botManagement": {
  "ja3Hash": "2a18e6bf307f97c5e27f0ab407dc65db",
  "staticResource": false,
  "verifiedBot": false,
  "score": 98
},
```

It doesn't appear on all zones with Bot Management, i.e https://workers.cloudflare.com/cf.json, so adding as optional.
@changeset-bot
Copy link

changeset-bot bot commented Jul 11, 2022

⚠️ No Changeset found

Latest commit: 2689295

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mrbbot mrbbot merged commit f5015a8 into cloudflare:master Sep 1, 2022
@p-l-
Copy link

p-l- commented Sep 1, 2022

Hey there! Thanks a lot for @KianNH this PR and @mrbbot for merging it!

Is there a release planned that would ship this change? Thanks!

@KianNH
Copy link
Contributor Author

KianNH commented Sep 1, 2022

Also raised #275 for the new corporateProxy property.

@p-l-
Copy link

p-l- commented Sep 1, 2022

BTW @KianNH please excuse that newbie question here, but shouldn't this ja3Hash values also need to be added to the index.d.ts file?
yarn types:check keeps complaining on my project, and applying the following fix makes it happy:

diff --git a/index.d.ts b/index.d.ts
index 7dea8d3..073bb30 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -831,6 +831,7 @@ interface IncomingRequestCfPropertiesBotManagement {
   score: number;
   staticResource: boolean;
   verifiedBot: boolean;
+  ja3Hash: string;
 }
 
 interface IncomingRequestCfPropertiesTLSClientAuth {

I'm a total newbie here, so please let me know if I'm missing something, but I have the impression that the index.d.ts needs to be updated after updating the overrides/.

@KianNH
Copy link
Contributor Author

KianNH commented Sep 1, 2022

The types in the overrides directory are partial, and merged into index.d.ts when a release is made.

https://github.com/cloudflare/workers-types#auto-generation

@p-l-
Copy link

p-l- commented Sep 1, 2022

Thanks for your answer. The problem is that we cannot use the code from the repository (in CI for example) when it has not yet been released. For example, I currently have this in my package.json:

  "devDependencies": {
    "@cloudflare/workers-types": "https://github.com/cloudflare/workers-types/tarball/f5015a8d4b962460ea525ce5772a3296c223f9c7",
    [...]
  }

And that won't work. Do you have any idea how I could do?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bot management variables
3 participants