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] Add private aggregation support for B&A response #1344

Merged
merged 13 commits into from
Dec 17, 2024
58 changes: 31 additions & 27 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3269,28 +3269,22 @@ To <dfn>handle server response private aggregation fields</dfn> given a [=server

<div algorithm>
To <dfn>commit server response private aggregation contributions</dfn> given a [=map=] from a
[=tuple=] of ([=reporting bid key=], [=string=]) to a [=list=] of [=on event contribution entries=]
[=server auction pagg contribution key=] to a [=list=] of [=on event contribution entries=]
qingxinwu marked this conversation as resolved.
Show resolved Hide resolved
|contributionsMap|, a [=reporting context=] |reportingContext|, and a [=reporting bid key=]
|reportingId|:

1. [=map/For each=] (|reportingOrigin|, |coordinator|, |event|) → |contributions| of |contributionsMap|:
1. [=map/For each=] |key| → |contributions| of |contributionsMap|:
1. Let |reportingOrigin| be |key|'s [=server auction pagg contribution key/reporting origin=].
1. Let |event| be |key|'s [=server auction pagg contribution key/event=].
1. Let |coordinator| be |key|'s [=server auction pagg contribution key/coordinator=].
1. If |coordinator| is null, set |coordinator| to the [=default aggregation coordinator=].
1. Let |eventToContributionsMap| be a new [=Private Aggregation contributions=].
1. Let |scopingDetails| be a new [=scoping details=] with the [=struct/items=]:
: <a spec="private-aggregation-api" for="scoping details">get batching scope steps</a>
:: An algorithm that performs the following steps:
1. If |coordinator| is null, set |coordinator| to the [=default aggregation coordinator=].
1. Return the result of running [=get or create a batching scope=] given |reportingOrigin|,
|coordinator| and |reportingContext|.
: <a spec="private-aggregation-api" for="scoping details">get debug scope steps</a>
:: An algorithm that returns a new [=debug scope=].

1. Let |batchingScope| be null.
1. If |event| [=string/starts with=] "`reserved.`", set |batchingScope| to the
result of running |scopingDetails|' <a spec="private-aggregation-api" for="scoping details">
get batching scope steps</a>.
result of running [=get or create a batching scope=] given |reportingOrigin|, |coordinator| and
|reportingContext|.

Note: Each non-reserved |event| will have a different [=batching scope=]
that is created later.
Note: Each non-reserved |event| will have a different [=batching scope=] that is created later.
1. [=list/For each=] |contribution| of |contributions|:
1. [=Assert=] |contribution|["{{PAExtendedHistogramContribution/bucket}}"] is a {{bigint}} and
is [=set/contained=] in [=the exclusive range|the range=] 0 to 2<sup>128</sup>, exclusive.
Expand All @@ -3304,8 +3298,7 @@ To <dfn>commit server response private aggregation contributions</dfn> given a [
: [=on event contribution entry/batching scope=]
:: |batchingScope|
: [=on event contribution entry/debug scope=]
:: The result of running |scopingDetails|' <a spec="private-aggregation-api"
for="scoping details">get debug scope steps</a>.
:: A new [=debug scope=].
: [=on event contribution entry/worklet function=]
:: "`generate-bid`" (it does not matter for server returned contributions)
: [=on event contribution entry/origin=]
Expand Down Expand Up @@ -3550,19 +3543,20 @@ A <dfn>server auction response</dfn> is a [=struct=] that contains auction resul
: <dfn>component seller reporting</dfn>
:: Null or [=server auction reporting info=].
: <dfn>component win private aggregation contributions</dfn>
:: A [=map=] whose [=map/keys=] are [=tuples=] of ([=reporting bid key=], [=string=]), and whose
:: A [=map=] whose [=map/keys=] are [=server auction pagg contribution keys=], and whose
[=map/values=] are [=lists=] of [=on event contribution entries=]. Private aggregation
contributions from winners of component auctions run on trusted auction servers. These need to
be filtered by the client based on the top level auction's outcome.
: <dfn>server filtered private aggregation reserved contributions</dfn>
:: A [=map=] from a [=tuple=] of ([=reporting bid key=], [=string=]) to a [=list=] of [=on event
contribution entries=]. Server filtered private aggregation contributions with reserved event
types (already set to "reserved.always"), which are not dependent on the final auction result and
should always be reported.
:: A [=map=] whose [=map/keys=] are [=server auction pagg contribution keys=], and whose
[=map/values=] are [=lists=] of [=on event contribution entries=]. Server filtered private
aggregation contributions with reserved event types (already set to "reserved.always"), which
are not dependent on the final auction result and should always be reported.
: <dfn>server filtered private aggregation non reserved contributions</dfn>
:: A [=map=] from a [=tuple=] of ([=reporting bid key=], [=string=]) to a [=list=] of [=on event
contribution entries=]. Server filtered private aggregation contributions with non reserved event
types, which are not dependent on the final auction result and should always be reported.
:: A [=map=] whose [=map/keys=] are [=server auction pagg contribution keys=], and whose
[=map/values=] are [=lists=] of [=on event contribution entries=]. Server filtered private
aggregation contributions with non reserved event types, which are not dependent on the final
auction result and should always be reported.
: <dfn>component win debugging only reports</dfn>
:: A [=map=] whose [=map/keys=] are [=server auction debug report keys=], and whose [=map/values=]
are [=lists=] of [=urls=].
Expand All @@ -3587,6 +3581,16 @@ a <dfn>server auction debug report key</dfn> is a [=struct=] with the following
:: A [=boolean=].
</dl>

a <dfn>server auction pagg contribution key</dfn> is a [=struct=] with the following [=struct/items=]:
<dl dfn-for="server auction pagg contribution key">
: <dfn>reporting origin</dfn>
:: The [=origin=] of the script that contributed the contribution.
: <dfn>coordinator</dfn>
:: Null or an [=aggregation coordinator=].
: <dfn>event</dfn>
:: A [=string=].
</dl>

<div algorithm="getInterestGroupAdAuctionData()">

The <dfn for=Navigator method>getInterestGroupAdAuctionData(|configIDL|)</dfn> method steps are:
Expand Down Expand Up @@ -6134,8 +6138,6 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
reserved event types are added later.
1. If |event| is "`reserved.once`" and |function| is [=worklet function/report-result=] or
[=worklet function/report-win=], [=exception/throw=] a {{TypeError}}.
1. If |event| does not [=string/start with=] "`reserved.`", and |function| is "`scoreAd()`" or
"`report-result`", return.
1. Let |bucket| be |contribution|["{{PAExtendedHistogramContribution/bucket}}"].
1. If |bucket| is a {{PASignalValue}}:
1. If |bucket|["{{PASignalValue/baseValue}}"] is not a valid [=signal base
Expand Down Expand Up @@ -6166,6 +6168,8 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:

Note: It is not currently possible to set a non-default filtering ID max
bytes for Protected Audience.
1. If |event| does not [=string/start with=] "`reserved.`", and |function| is
[=worklet function/score-ad=] or [=worklet function/report-result=], return.
1. Let |batchingScope| be null.
1. If |event| [=string/starts with=] "`reserved.`", set |batchingScope| to the
result of running |scopingDetails|' <a spec="private-aggregation-api" for="scoping details">
Expand Down
Loading