Git Product home page Git Product logo

fingerprintjs / botd-integrations Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 4.0 2.75 MB

Botd integrations with popular cloud platforms and CDNs.

License: MIT License

Rust 52.22% Go 10.06% HTML 7.87% Makefile 1.76% VCL 4.01% CSS 3.11% TypeScript 20.02% JavaScript 0.96%
bot bot-detection cloud cloud-integration fastly cloudflare cloudfront fastly-compute-at-edge cloudflare-workers cloudfront-lambda-at-edge

botd-integrations's Issues

More naming consistency required

We should use end-user and end-user's browser instead of ambiguous terms like 'client'.
We should only use requestID everywhere. (or request-id when describing cookie values)

Flow step #5 needs clarification

Response from origin returns to client's browser with cookie botd-request-id.

I think this step needs expansion and further clarification, e.g. that the request ID is random and its value can be used to retrieve the bot detection results etc.

Example app bot emulation does not affect the user agent

From the readme:

Checking the Emulate bot checkbox will replace User-Agent to Headless Chrome. It will force the bot branch of the flow.

Steps to reproduce

(Chrome + FF Win10)

  1. Tick Emulate bot checkbox.
  2. Check user agent in the request.

Exptected user agent: Headless Chrome
Actual user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

There are probably two issues

Setting user agent

We are trying to set user agent like

Object.defineProperty(navigator, 'userAgent', {
                get: function () {
                    return userAgent;
                },
                configurable: true,
            });

Which doesn't work (Win10 Chrome and FF).
According to MDN documentation:

The User-Agent header is no longer forbidden header. It can be changed programatically by Fetch Headers object, or via XHR setRequestHeader().

Source: https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name
I believe we should change this implementation and tweak the user agent directly in the request instead.

Chromium bug

Even if we change the user agent the way mentioned above, it won't work in Chromium browsers due to this bug. I believe we should add a note to readme as well as directly to the sample app's login screen - something like: 'This demo does not work correctly on Chromium-based browsers.'

Food for thought

Another way might be changing the user agent directly on CDN/integration provider or BE according to the bot: on form data but I believe this might be confusing for users and must be explained properly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.