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

Spec for introducing null reports and source registration time configuration #750

Merged
merged 12 commits into from
Apr 18, 2023
7 changes: 6 additions & 1 deletion app_to_web.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ sequenceDiagram
```
See Android's [Attribution reporting: cross app and web measurement proposal](https://developer.android.com/design-for-safety/privacy-sandbox/attribution-app-to-web) for one example of an OS API that a browser can integrate with to do cross app and web measurement.

The existing API involves sending requests to the reporting origin to register events. These requests will have a new request header `Attribution-Reporting-Eligible`. On requests with this header, the browser will additionally broadcast possible OS-level support for attribution to the reporting origin’s server via a new [dictionary structured request header](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-header-structure-15#section-3.2):
The existing API involves sending requests to the reporting origin to register events. These requests will have a new request header `Attribution-Reporting-Eligible`. On requests with this header, the browser will additionally broadcast possible web or OS-level support for attribution to the reporting origin’s server via a new [dictionary structured request header](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-header-structure-15#section-3.2):
```
Attribution-Reporting-Support: os, web
```

Note that if there is neither web nor OS-level support for attribution, no
background requests will be made and the browser will not set
`Attribution-Reporting-Eligible` header on `<a>`, `window.open`, `<img>`, and
`<script>` requests.

For subresource requests without the `Attribution-Reporting-Eligible` header,
the server can optionally respond to the request with a [boolean structured header](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-header-structure-15#section-3.3.6):
```http
Expand Down
18 changes: 18 additions & 0 deletions header-validator/data.trigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const testCases = [
"filters": {"x": []},
"not_filters": {"y": []}
}],
"aggregatable_source_registration_time": "include",
"aggregatable_trigger_data": [{
"filters": {"a": ["b"]},
"key_piece": "0x1",
Expand Down Expand Up @@ -527,4 +528,21 @@ export const testCases = [
msg: "must match 'aws-cloud' (case-sensitive)",
}],
},

{
name: "aggregatable-source-registration-time-wrong-type",
json: `{"aggregatable_source_registration_time": 1}`,
expectedErrors: [{
path: ["aggregatable_source_registration_time"],
msg: "must be a string",
}],
},
{
name: "aggregatable-source-registration-time-unknown-value",
json: `{"aggregatable_source_registration_time": "EXCLUDE"}`,
expectedErrors: [{
path: ["aggregatable_source_registration_time"],
msg: "must match 'exclude' or 'include' (case-sensitive)",
}],
},
];
10 changes: 10 additions & 0 deletions header-validator/validate-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,15 @@ const aggregatableDedupKeys = list(
not_filters: optional(filters()),
}))

const aggregatableSourceRegistrationTime = string((state, value) => {
const exclude = 'exclude'
const include = 'include'
if (value === exclude || value === include) {
return
}
state.error(`must match '${exclude}' or '${include}' (case-sensitive)`)
})

export function validateTrigger(trigger) {
const state = new State()
state.validate(trigger, {
Expand All @@ -313,6 +322,7 @@ export function validateTrigger(trigger) {
filters: optional(orFilters),
not_filters: optional(orFilters),
aggregatable_deduplication_keys: optional(aggregatableDedupKeys),
aggregatable_source_registration_time : optional(aggregatableSourceRegistrationTime),
})
return state.result()
}
Expand Down
Loading