Add OIS support - #324
Open
juanli16 wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The DCN recognizes a browser by the
OPTABLE_OIDcookie, which is third-party from a publisher page and dropped by Safari/ITP, Firefox ETP and Chrome's third-party cookie restrictions. When it is blocked the DCN sees a new device on every request, and a publisher cannot configure around it.An OIS node also derives an identity for the browser, with the help of the device signals the SDK forwards in the
sigparam, and returns it onX-Optable-OID. The SDK never stored that ID, so nothing carried it from one visit to the next. This gives it a client-side memory.What Changed
lib/core/ois.ts(new): stores the derived OIS ID from theX-Optable-OIDresponse header and replays it on subsequent requests. Limited to the endpoints where the DCN derives onelib/core/network.ts: attaches the header on send, reads it on receive, both filtered by the same path set.lib/core/storage.ts,lib/core/storage-keys.ts: cached underOPTABLE_OIS_<base64(host[/node])>. Keys derived lazily, since OIS is opt-in and the SDK builds manyLocalStorageinstances./vanilla/ois.htmland/vanilla/nocookies/ois.html.How to Test
A demo page is available at
/vanilla/ois.htmland/vanilla/nocookies/ois.html, showing the ID returned, its storage key, the decodedsigsignals, and theX-Optable-OIDheader sent and received on each call.Unit tests cover the behaviour: storing and replaying the ID, path filtering in both directions, consent gating, the change event, and the storage key format.
Notes