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

Specify trigger-data matching #1064

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Changes from all 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
44 changes: 41 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,21 @@ It has the following constraints:
* Every element's [=report window/start=] is equal to the previous element's [=report window/end=], if it exists.
* There is at least one element in the list.

<h3 id="trigger-data-matching-mode-header">Trigger-data matching mode</h3>

A <dfn>trigger-data matching mode</dfn> is one of the following:

<dl dfn-for="trigger-data matching mode">
: "<dfn><code>exact</code></dfn>"
:: [=event-level trigger configuration/Trigger data=] must be less than the
[=default trigger data cardinality=]. Otherwise, no event-level attribution
takes place.
: "<dfn><code>modulus</code></dfn>"
:: [=event-level trigger configuration/Trigger data=] is taken modulo the
[=default trigger data cardinality=].

</dl>

<h3 dfn-type=dfn>Attribution source</h3>

An attribution source is a [=struct=] with the following items:
Expand Down Expand Up @@ -798,6 +813,8 @@ An attribution source is a [=struct=] with the following items:
:: A [=boolean=].
: <dfn>number of aggregatable reports</dfn>
:: Number of [=aggregatable reports=] created for this [=attribution source=].
: <dfn>trigger-data matching mode</dfn>
:: A [=trigger-data matching mode=].

</dl>

Expand Down Expand Up @@ -1059,6 +1076,7 @@ Possible values are:
<li>"<dfn><code>trigger-event-excessive-reports</code></dfn>"
<li>"<dfn><code>trigger-event-low-priority</code></dfn>"
<li>"<dfn><code>trigger-event-no-matching-configurations</code></dfn>"
<li>"<dfn><code>trigger-event-no-matching-trigger-data</code></dfn>"
<li>"<dfn><code>trigger-event-noise</code></dfn>"
<li>"<dfn><code>trigger-event-report-window-not-started</code></dfn>"
<li>"<dfn><code>trigger-event-report-window-passed</code></dfn>"
Expand Down Expand Up @@ -1965,7 +1983,11 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
1. Let |epsilon| be the user agent's [=randomized response epsilon=].
1. If the result of [=computing the channel capacity of a source=] with |randomizedResponseConfig| and |epsilon| is greater than
[=max event-level channel capacity per source=][|sourceType|], return null.

1. Let |triggerDataMatchingMode| be "<code>[=trigger-data matching mode/modulus=]</code>".
1. If |value|["`trigger_data_matching`"] [=map/exists=]:
1. If |value|["`trigger_data_matching`"] is not a [=string=], return null.
1. If |value|["`trigger_data_matching`"] is not a [=trigger-data matching mode=], return null.
1. Set |triggerDataMatchingMode| to |value|["`trigger_data_matching`"].
1. Let |source| be a new [=attribution source=] struct whose items are:

: [=attribution source/source identifier=]
Expand Down Expand Up @@ -2006,6 +2028,8 @@ To <dfn noexport>parse source-registration JSON</dfn> given a [=byte sequence=]
:: 0
: [=attribution source/debug reporting enabled=]
:: |debugReportingEnabled|
: [=attribution source/trigger-data matching mode=]
:: |triggerDataMatchingMode|
1. Return |source|.

Issue: Determine proper charset-handling for the JSON header value.
Expand Down Expand Up @@ -2102,6 +2126,7 @@ a [=trigger state=] |triggerState|:
:: "<code>[=aggregatable source registration time configuration/exclude=]</code>"
1. Let |fakeReport| be the result of running [=obtain an event-level report=] with |source|,
|fakeTrigger|, and |fakeConfig|.
1. [=Assert=]: |fakeReport| is not null.
1. Set |fakeReport|'s [=event-level report/report time=] to the result of
running [=obtain the report time at a window=] with |source| and
|triggerState|'s [=trigger state/report window=].
Expand Down Expand Up @@ -2760,6 +2785,11 @@ To <dfn>trigger event-level attribution</dfn> given an [=attribution trigger=] |
return it.
1. Let |report| be the result of running [=obtain an event-level report=] with |sourceToAttribute|, |trigger|,
and |matchedConfig|.
1. If |report| is null:
1. Let |debugData| be the result of running [=obtain debug data on trigger registration=]
with "<code>[=trigger debug data type/trigger-event-no-matching-trigger-data=]</code>", |trigger|, |sourceToAttribute| and
[=obtain debug data on trigger registration/report=] set to null.
1. Return the [=triggering result=] ("<code>[=triggering status/dropped=]</code>", |debugData|).
1. If |sourceToAttribute|'s [=attribution source/event-level attributable=] value
is false:
1. Let |debugData| be the result of running [=obtain debug data on trigger registration=]
Expand Down Expand Up @@ -3020,15 +3050,23 @@ To <dfn>obtain an aggregatable report delivery time</dfn> given a [=moment=]
To <dfn>obtain an event-level report</dfn> given an [=attribution source=] |source|, an [=attribution trigger=]
|trigger|, and an [=event-level trigger configuration=] |config|:

1. Let |triggerData| be |config|'s [=event-level trigger configuration/trigger data=].
1. Let |triggerDataCardinality| be the user agent's [=default trigger data cardinality=][|source|'s [=attribution source/source type=]].
1. If |source|'s [=attribution source/trigger-data matching mode=] is:
<dl class="switch">
: "<code>[=trigger-data matching mode/exact=]</code>":
:: If |triggerData| is greater than or equal to |triggerDataCardinality|, return null.
: "<code>[=trigger-data matching mode/modulus=]</code>":
:: Set |triggerData| to the remainder when dividing |triggerData| by |triggerDataCardinality|.

</dl>
1. Let |reportTime| be the result of running [=obtain an event-level report delivery time=] with |source| and |trigger|'s [=attribution trigger/trigger time=].
1. Let |report| be a new [=event-level report=] struct whose items are:

: [=event-level report/event ID=]
:: |source|'s [=attribution source/event ID=].
: [=event-level report/trigger data=]
:: The remainder when dividing |config|'s [=event-level trigger configuration/trigger data=] by
|triggerDataCardinality|.
:: |triggerData|
: [=event-level report/randomized trigger rate=]
:: |source|'s [=attribution source/randomized trigger rate=].
: [=event-level report/reporting origin=]
Expand Down