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

Add k-anonymity support for automation #1382

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 21 additions & 28 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,7 @@ spec: CSPEE; urlPrefix: https://w3c.github.io/webappsec-cspee/
text: required csp; url: browsing-context-required-csp
spec: webdriver; urlPrefix: https://w3c.github.io/webdriver/
type: dfn
text: extension command; url: dfn-extension-commands
text: getting a property; url: dfn-getting-properties
text: invalid argument; url: dfn-invalid-argument
text: remote end steps; url: dfn-remote-end-steps
text: success; url: dfn-success
text: undefined; url: dfn-undefined
text: WebDriver error; url: dfn-error
text: WebDriver error code; url: dfn-error-code
</pre>

<pre class=link-defaults>
Expand Down Expand Up @@ -9100,7 +9093,7 @@ an {{unsigned short}}-or-null |experimentGroupId|, an [=origin=] |topLevelOrigin
for [=bidding partition/id=], and [=bidding partitions=] as their [=map/values=].
1. Let |compressionIdMap| be an empty [=map=], whose [=map/keys=] are [=origins=] and [=map/values=] are integers.
1. Let |interestGroupIdMap| be an empty [=map=], whose [=map/keys=] are [=strings=] and [=map/values=] are [=tuples=]
of (interger, integer).
of (integer, integer).
1. Let |slotSizeParams| be the result of [=strictly splitting=] |slotSizeQueryParam| on U+003D (=).
1. Let |nextCompressionGroupId| be 0.
1. [=list/For each=] |group| of |interestGroups|:
Expand Down Expand Up @@ -10137,10 +10130,10 @@ defines the below [[WebDriver2]] [=extension commands=].
## <dfn>Set Protected Audience K-Anonymity</dfn> ## {#sctn-automation-set-protected-audience-k-anonymity}

The [=Set Protected Audience K-Anonymity=] WebDriver [=extension command=] instructs the
user agent to use the specified hashes as the only k-anonymous sets for the interest
group with the given owner and name.
user agent to use the specified hashes as the only k-anonymous sets for the
[=interest group=] with the given [=interest group/owner=] and [=interest group/name=].

The <dfn>k-anonymity overrides</dfn> is a [=map=] containing the currently
The <dfn>k-anonymity overrides</dfn> is a [=map=] [=map/containing=] the currently
active set of k-anonymity overrides, which is initially empty.
The [=map/keys=] of [=k-anonymity overrides=] are [=tuples=] of (an [=origin=]
for interest group owner, a [=string=] for interest group name).
Expand All @@ -10166,43 +10159,43 @@ The [=k-anonymity overrides=] are checked before and take precedence over the
</table>
</figure>

The [=remote end steps=] are:
<div algorithm="remote end steps">
The <dfn export for="Protected Audience">remote end steps</dfn> are:

1. If |parameters| is not a JSON [[ECMASCRIPT#sec-json-object|Object]], return a
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
[=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |owner| be the result of [=getting a property=] named `"owner"` from
|parameters|.
1. If |owner| is [=undefined=] or is not a [=string=], return a
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
1. If |owner| is {{undefined}} or is not a [=string=], return a
[=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |owner origin| be the result running [=parse an https origin=] on |owner|.
1. If |owner origin| is failure, return a [=WebDriver error=] with
[=WebDriver error code=] [=invalid argument=].

1. If |owner origin| is failure, return a [=error|WebDriver error=] with
[=error code=] [=invalid argument=].
1. Let |name| be the result of [=getting a property=] named `"name"` from
|parameters|.
1. If |name| is [=undefined=] or is not a [=string=], return a
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].

1. If |name| is {{undefined}} or is not a [=string=], return a
[=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |hashes| be the result of [=getting a property=] named `"hashes"` from
|parameters|.
1. If |hashes| is [=undefined=] or is not an [=list=], return a
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
1. If |hashes| is {{undefined}} or is not a [=list=], return a
[=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |override| be a [=map=] whose [=map/keys=] are [=SHA-256=] hashes and
whose [=map/values=] are [=k-anonymity records=].
1. [=list/For each=] |hash string| of |hashes|:
1. If |hash string| is not a [=string=], return a
[=WebDriver error=] with [=WebDriver error code=] [=invalid argument=].
[=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |hash| be the result of running [=forgiving-base64 decode=] with |hash string|.
1. If |hash| is failure, return a [=WebDriver error=] with
[=WebDriver error code=] [=invalid argument=].
1. If |hash|'s [=byte sequence/length=] is not 32, return a [=WebDriver error=]
with [=WebDriver error code=] [=invalid argument=].
1. If |hash| is failure or |hash|'s [=byte sequence/length=] is not 32, return
a [=error|WebDriver error=] with [=error code=] [=invalid argument=].
1. Let |record| be a new [=k-anonymity record=].
1. Set |record|'s [=k-anonymity record/timestamp=] field to the [=current coarsened wall time=].
1. Set |record|'s [=k-anonymity record/is k-anonymous=] field to true.
1. [=map/Set=] |override|[|hash|] to |record|.
1. Set [=k-anonymity overrides=][(|owner origin|,|name|)] to |override|.
1. Return [=success=] with data `null`.

</div>

# Privacy Considerations # {#privacy-considerations}

Protected Audience aims to advance the privacy of remarketing and custom audience
Expand Down