Skip to content

Commit 4552911

Browse files
authored
Spec: auctionReportBuyerDebugModeConfig (#118)
Specs out the ability to set debug mode details for auctionReportBuyer reporting. See https://github.com/WICG/turtledove/blob/main/FLEDGE_extended_PA_reporting.md#temporary-debugging-mechanism.
1 parent b09c9c4 commit 4552911

File tree

1 file changed

+41
-10
lines changed

1 file changed

+41
-10
lines changed

spec.bs

+41-10
Original file line numberDiff line numberDiff line change
@@ -469,15 +469,20 @@ To <dfn algorithm export>get a debug details</dfn> given a [=debug scope=]
469469
1. Otherwise, return a new [=debug details=].
470470

471471
To <dfn algorithm export>mark a debug scope complete</dfn> given a [=debug
472-
scope=] |debugScope|:
473-
474-
1. Let |debugDetails| be a new [=debug details=].
472+
scope=] |debugScope| and an optional [=debug details=] or null
473+
|debugDetailsOverride| (default null):
474+
1. Let |debugDetails| be |debugDetailsOverride|.
475475
1. Let |debugScopeMap| be the [=debug scope map=].
476476
1. If |debugScopeMap|[|debugScope|] [=map/exists=]:
477-
1. Set |debugDetails| to |debugScopeMap|[|debugScope|].
477+
1. [=Assert=]: |debugDetailsOverride| is null.
478+
479+
Note: The override can be provided if the debug details have not been
480+
set otherwise.
481+
1. Set |debugDetails| to |debugScopeMap|[|debugScope|].
478482
1. [=map/Remove=] |debugScopeMap|[|debugScope|].
479483
1. If |debugDetails|'s [=debug details/key=] is not null, [=assert=]:
480484
|debugDetails|'s [=debug details/enabled=] is true.
485+
1. If |debugDetails| is null, set |debugDetails| to a new [=debug details=].
481486
1. [=list/iterate|For each=] |entry| of the [=contribution cache=]:
482487
1. If |entry|'s [=contribution cache entry/debug scope=] is |debugScope|,
483488
set |entry|'s [=contribution cache entry/debug details=] to
@@ -1249,9 +1254,17 @@ dictionary AuctionReportBuyersConfig {
12491254
required double scale;
12501255
};
12511256

1257+
dictionary AuctionReportBuyerDebugModeConfig {
1258+
boolean enabled = false;
1259+
1260+
// Must only be provided if `enabled` is true.
1261+
bigint? debugKey;
1262+
};
1263+
12521264
partial dictionary AuctionAdConfig {
12531265
sequence<bigint> auctionReportBuyerKeys;
12541266
record<DOMString, AuctionReportBuyersConfig> auctionReportBuyers;
1267+
AuctionReportBuyerDebugModeConfig auctionReportBuyerDebugModeConfig;
12551268
};
12561269
</xmp>
12571270

@@ -1375,6 +1388,8 @@ Extend the <a spec="turtledove">auction config</a> [=struct=] to add new fields:
13751388
:: A [=map=] from buyer [=origins=] to {{bigint}}s.
13761389
: <dfn>auction report buyers</dfn>
13771390
:: A [=map=] from [=strings=] to {{AuctionReportBuyersConfig}}s.
1391+
: <dfn>auction report buyer debug details</dfn>
1392+
:: A [=debug details=].
13781393

13791394
Issue: Consider replacing the strings above with specific enum types.
13801395

@@ -1576,7 +1591,26 @@ modified to add the following steps just before the last step ("Return
15761591
1. [=map/Set=] |auctionConfig|'s [=auction config/auction report
15771592
buyers=][|reportType|] to |reportBuyerConfig|.
15781593

1579-
Issue: Handle `auctionReportBuyerDebugModeConfig` here.
1594+
1. Set |auctionConfig|'s [=auction config/auction report buyer debug details=]
1595+
to a new [=debug details=].
1596+
1. If |config|[{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}]
1597+
[=map/exists=]:
1598+
1. Let |debugModeConfig| be
1599+
|config|[{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}].
1600+
1. Let |enabled| be
1601+
|debugModeConfig|[{{AuctionReportBuyerDebugModeConfig/enabled}}].
1602+
1. Let |debugKey| be
1603+
|debugModeConfig|[{{AuctionReportBuyerDebugModeConfig/debugKey}}].
1604+
1. If |debugKey| is not null:
1605+
1. If |debugKey| is not in the range [0, 2<sup>64</sup>−1], [=exception/
1606+
throw=] a {{TypeError}}.
1607+
1. If |enabled| is false, [=exception/throw=] a {{TypeError}}.
1608+
1. Set |auctionConfig|'s [=auction config/auction report buyer debug
1609+
details=] to a new [=debug details=] with the items:
1610+
: [=debug details/enabled=]
1611+
:: |enabled|
1612+
: [=debug details/key=]
1613+
:: |debugKey|
15801614
1. If |config|[{{AuctionAdConfig/privateAggregationConfig}}] [=map/exists=]:
15811615
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
15821616
Aggregation coordinator=] given
@@ -1908,11 +1942,8 @@ an <a spec="turtledove">auction config</a> |auctionConfig| and a
19081942
:: |auctionReportBuyersDebugScope|
19091943
1. [=Append an entry to the contribution cache|Append=] |entry| to
19101944
the [=contribution cache=].
1911-
1912-
Issue: Handle `auctionReportBuyerDebugModeConfig` here, may need to pass an
1913-
override to [=mark a debug scope complete=] and possibly refactor to merge
1914-
handling with {{PrivateAggregation/enableDebugMode()}}.
1915-
1. [=Mark a debug scope complete=] given |auctionReportBuyersDebugScope|.
1945+
1. [=Mark a debug scope complete=] given |auctionReportBuyersDebugScope| and
1946+
|auctionConfig|'s [=auction config/auction report buyer debug details=].
19161947
1. [=map/For each=] (|origin|, |aggregationCoordinator|) → |batchingScope| of
19171948
|auctionConfig|'s [=auction config/batching scope map=]:
19181949
1. [=Process contributions for a batching scope=] given |batchingScope|,

0 commit comments

Comments
 (0)