51Degrees / pipeline-dotnet

51Degrees Pipeline for .NET
Other
0 stars 2 forks source link

Enable Per-Detection Configuration of Enable/Disable Cookies #98

Closed ben51degrees closed 6 months ago

ben51degrees commented 6 months ago

The JavaScriptBuilderElement currently has a build option named EnableCookies.

This should be configurable per request, and should be disabled by default.

Summary of Steps

Disable by Default

Setting the option to disabled by default is a simple change to the BUILDER_DEFAULT_ENABLE_COOKIES constant.

Per-Detection Configuration

To enable configuration per request, an additional evidence key of query.fod-js-enable-cookies should be added, and used in the same way as the existing query.fod-js-object-name. Usage of the existing option can be found starting on lines 667-673.

Evidence Keys

The new evidence key query.fod-js-enable-cookies should be added to the evidence keys returned by the engine.

Tests

Tests for this should be added, and include the following:

Documentation

Documentation should be added to the builder method to make it clear that it can also be configured per-detection.

The behavior of cookies, and whether or not they are written, should be thoroughly documented in the readme with the their options (pointing to external documentation where necessary).

justadreamer commented 6 months ago

@ben51degrees could you please also update the specification with these new details

ben51degrees commented 6 months ago

As part of this work, the default will not be changed. The extra configuration options will be added, but the default will remain until the next version update as it is breaking.

ben51degrees commented 6 months ago

@ben51degrees could you please also update the specification with these new details

I've added a PR for this change here.

ben51degrees commented 6 months ago

Closed by #99