Skip to content
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

How match keys are retrieved #32

Open
martinthomson opened this issue Jan 13, 2023 · 1 comment
Open

How match keys are retrieved #32

martinthomson opened this issue Jan 13, 2023 · 1 comment

Comments

@martinthomson
Copy link
Collaborator

We need a more thorough description of how match keys are stored and subsequently retrieved.

This is non-trivial as we have the case where no match key is set, default values, and a need to consider how site state clearly interacts with this.

@martinthomson
Copy link
Collaborator Author

Copying a comment from @dominiccooney:

When there is no match key set, what to encrypt. I suggest random bytes which are then the match key for the epoch. There were some proposals to try and carve up the key space amongst UA brands though.
When there was a match key for a prior epoch, but none set this epoch, what to encrypt. I suggest the UA should re-commit to the previous match key for this epoch.
...if you accept 2, then there's the obvious question of how they get updated.

So I think the UA stores two match keys per provider, an operative one+epoch, and a pending one. Here's a rough proposal:

Writes:

  • If there's no operative match key, writing the match key sets both the pending and operative match keys; the operative match key gets the current epoch.
  • If there is an operative match key, writing the match key sets the pending one.

Reads:

  • If there is an operative match key for the current epoch, reading the match key returns it.
  • If there is no pending match key, reading the match key sets the operative match key to a random string and the current epoch.
  • If your UA wanted its identity to be sticky, also set the pending match key to the same string of bits. The UA should reflect user preference here.
  • If there is an operative match key for an old epoch, set the operative match key to the pending match key and the current epoch.

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

No branches or pull requests

1 participant