Skip to content

Commit ed0420f

Browse files
authored
Spec: minor fixes (#130)
Makes some minor improvements to the spec, primarily in improving hyperlinks when indexing into objects, using a range and fixing a stale monkeypatched algorithm name. This should not affect any behavior (just description).
1 parent 7634a8a commit ed0420f

File tree

1 file changed

+56
-50
lines changed

1 file changed

+56
-50
lines changed

spec.bs

+56-50
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,9 @@ contributeToHistogram(PAHistogramContribution contribution)</dfn> method steps
164164
are:
165165
</div>
166166

167-
1. If |contribution|["{{PAHistogramContribution/bucket}}"] is not in the range
168-
[0, 2<sup>128</sup>−1], [=exception/throw=] a {{RangeError}}.
167+
1. If |contribution|["{{PAHistogramContribution/bucket}}"] is not [=set/
168+
contained=] in [=the exclusive range|the range=] 0 to 2<sup>128</sup>,
169+
exclusive, [=exception/throw=] a {{RangeError}}.
169170
1. If |contribution|["{{PAHistogramContribution/value}}"] is negative,
170171
[=exception/throw=] a {{RangeError}}.
171172
1. Let |scopingDetails| be [=this=]'s [=PrivateAggregation/scoping details=].
@@ -212,10 +213,10 @@ enableDebugMode(optional PADebugModeOptions options)</dfn> method steps are:
212213
[=debug scope=].
213214
1. Let |debugKey| be null.
214215
1. If |options| was given:
215-
1. If |options|["{{PADebugModeOptions/debugKey}}] is not in the range
216-
[0, 2<sup>64</sup>−1], [=exception/throw=] a "{{DataError}}"
217-
{{DOMException}}.
218-
1. Set |debugKey| to |options|["{{PADebugModeOptions/debugKey}}].
216+
1. If |options|["{{PADebugModeOptions/debugKey}}"] is not [=set/contained=]
217+
in [=the exclusive range|the range=] 0 to 2<sup>64</sup>, exclusive,
218+
[=exception/throw=] a "{{DataError}}" {{DOMException}}.
219+
1. Set |debugKey| to |options|["{{PADebugModeOptions/debugKey}}"].
219220
1. Let |debugDetails| be a new [=debug details=] with the items:
220221
: [=debug details/enabled=]
221222
:: true
@@ -659,8 +660,10 @@ null |timeout|:
659660
1. Otherwise, set |truncatedContributions| to |contributions|.
660661
1. Let |contributionSum| be 0.
661662
1. [=set/iterate|For each=] |contribution| of |truncatedContributions|:
662-
1. [=Assert=]: |contribution|["|value|"] is non-negative.
663-
1. Add |contribution|["|value|"] to |contributionSum|.
663+
1. [=Assert=]: |contribution|["{{PAHistogramContribution/value}}"] is
664+
non-negative.
665+
1. Add |contribution|["{{PAHistogramContribution/value}}"] to
666+
|contributionSum|.
664667
1. Let |currentWallTime| be the [=current wall time=].
665668
1. Let |sufficientBudget| be the result of [=consuming budget if permitted=]
666669
given |contributionSum|, |reportingOrigin|, |api| and |currentWallTime|.
@@ -1104,12 +1107,14 @@ To <dfn algorithm>obtain the aggregation coordinator</dfn> given a
11041107
{{SharedStorageRunOperationMethodOptions}} |options|, perform the following
11051108
steps. They return an [=aggregation coordinator=], null or a {{DOMException}}:
11061109

1107-
1. If |options|["`privateAggregationConfig`"] does not [=map/exist=], return
1108-
null.
1109-
1. If |options|["`privateAggregationConfig`"]["`aggregatonCoordinatorOrigin`"]
1110+
1. If
1111+
|options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]
1112+
does not [=map/exist=], return null.
1113+
1. If
1114+
|options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/aggregationCoordinatorOrigin}}"]
11101115
does not [=map/exist=], return null.
11111116
1. Let |url| be the result of running the [=URL parser=] on
1112-
|options|["`privateAggregationConfig`"]["`aggregatonCoordinatorOrigin`"].
1117+
|options|["{{SharedStorageRunOperationMethodOptions/privateAggregationConfig}}"]["{{SharedStoragePrivateAggregationConfig/aggregationCoordinatorOrigin}}"].
11131118
1. If |url| is failure or null, return a new {{DOMException}} with name
11141119
"`SyntaxError`".
11151120

@@ -1395,8 +1400,8 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
13951400
1. If |bucket|["{{PASignalValue/offset}}"] is not a {{bigint}}, [=exception/
13961401
throw=] a {{TypeError}}.
13971402
1. Otherwise, if |contribution|["{{PAExtendedHistogramContribution/bucket}}"] is
1398-
not in the range [0, 2<sup>128</sup>−1], [=exception/throw=] a
1399-
{{TypeError}}.
1403+
not [=set/contained=] in [=the exclusive range|the range=] 0 to
1404+
2<sup>128</sup>, exclusive, [=exception/throw=] a {{TypeError}}.
14001405

14011406
Issue: Make the error type consistent with
14021407
{{PrivateAggregation/contributeToHistogram(contribution)}}.
@@ -1406,7 +1411,7 @@ event, PAExtendedHistogramContribution contribution)</dfn> method steps are:
14061411
value=], [=exception/throw=] a {{TypeError}}.
14071412
1. If |value|["{{PASignalValue/offset}}"] is a {{bigint}}, [=exception/
14081413
throw=] a {{TypeError}}.
1409-
1. Otherwise, if |contribution|["{{PAHistogramContribution/value}}"] is
1414+
1. Otherwise, if |contribution|["{{PAExtendedHistogramContribution/value}}"] is
14101415
negative, [=exception/throw=] a {{TypeError}}.
14111416
1. If |contribution|["{{PAExtendedHistogramContribution/filteringId}}"] is
14121417
not [=set/contained=] in [=the exclusive range|the range=] 0 to
@@ -1631,11 +1636,11 @@ The {{Navigator/joinAdInterestGroup()}} method steps are modified to add the
16311636
following steps at the end of the scope nested under step 5 ("Validate the given
16321637
<var ignore>group</var> and ..."):
16331638
<div algorithm="protected-audience-joinadig-monkey-patch">
1634-
17. If |group|[{{AuctionAdInterestGroup/privateAggregationConfig}}]
1639+
17. If |group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"]
16351640
[=map/exists=]:
16361641
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
16371642
Aggregation coordinator=] given
1638-
|group|[{{AuctionAdInterestGroup/privateAggregationConfig}}].
1643+
|group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"].
16391644
1. If |aggregationCoordinator| is a {{DOMException}}, then
16401645
[=exception/throw=] |aggregationCoordinator|.
16411646
1. Set <var ignore>interestGroup</var>'s [=interest group/Private
@@ -1660,19 +1665,19 @@ The <a spec="turtledove">validate and convert auction ad config</a> steps are
16601665
modified to add the following steps just before the last step ("Return
16611666
<var ignore>auctionConfig</var>"), renumbering the later step as appropriate:
16621667
<div algorithm="protected-audience-validate-config-monkey-patch">
1663-
31. If |config|["<code>{{AuctionAdConfig/auctionReportBuyerKeys}}</code>"]
1664-
[=map/exists=]:
1668+
31. If |config|["{{AuctionAdConfig/auctionReportBuyerKeys}}"] [=map/exists=]:
16651669
1. Let |interestGroupBuyers| be |auctionConfig|'s <a spec="turtledove"
16661670
for="auction config">interest group buyers</a>.
16671671
1. If |interestGroupBuyers| is null, set |interestGroupBuyers| to a new
16681672
[=list=].
16691673
1. [=list/For each=] |index| of [=the exclusive range|the range=] 0 to
1670-
|config|["<code>{{AuctionAdConfig/auctionReportBuyerKeys}}</code>"]'s
1671-
[=list/size=], exclusive:
1674+
|config|["{{AuctionAdConfig/auctionReportBuyerKeys}}"]'s [=list/size=],
1675+
exclusive:
16721676
1. Let |key| be
1673-
|config|["<code>{{AuctionAdConfig/auctionReportBuyerKeys}}</code>"][|index|].
1674-
1. If |key| is not in the range [0, 2<sup>128</sup>−1],
1675-
[=exception/throw=] a {{TypeError}}.
1677+
|config|["{{AuctionAdConfig/auctionReportBuyerKeys}}"][|index|].
1678+
1. If |key| is not [=set/contained=] in [=the exclusive range|the
1679+
range=] 0 to 2<sup>128</sup>, exclusive, [=exception/throw=] a
1680+
{{TypeError}}.
16761681
1. If |index| is equal to or greater than |interestGroupBuyers|' [=list/
16771682
size=], [=iteration/continue=].
16781683

@@ -1684,10 +1689,9 @@ modified to add the following steps just before the last step ("Return
16841689

16851690
Issue: Check behavior when an origin is repeated in
16861691
{{AuctionAdConfig/interestGroupBuyers}}.
1687-
1. If |config|["<code>{{AuctionAdConfig/auctionReportBuyers}}</code>"] [=map/
1688-
exists=]:
1692+
1. If |config|["{{AuctionAdConfig/auctionReportBuyers}}"] [=map/exists=]:
16891693
1. [=map/For each=] |reportType| → |reportBuyerConfig| of
1690-
|config|["<code>{{AuctionAdConfig/auctionReportBuyers}}</code>"]:
1694+
|config|["{{AuctionAdConfig/auctionReportBuyers}}"]:
16911695
1. If « "`interestGroupCount`", "`bidCount`",
16921696
"`totalGenerateBidLatency`", "`totalSignalsFetchLatency`" » does not
16931697
[=list/contain=] |reportType|, [=iteration/continue=].
@@ -1697,9 +1701,9 @@ modified to add the following steps just before the last step ("Return
16971701

16981702
Issue: Should these strings be dash delimited?
16991703

1700-
1. If |reportBuyerConfig|["<code>{{AuctionReportBuyersConfig
1701-
/bucket}}</code>"] is not in the range [0, 2<sup>128</sup>−1],
1702-
[=exception/throw=] a {{TypeError}}.
1704+
1. If |reportBuyerConfig|["{{AuctionReportBuyersConfig/bucket}}"] is not
1705+
[=set/contained=] in [=the exclusive range|the range=] 0 to
1706+
2<sup>128</sup>, exclusive, [=exception/throw=] a {{TypeError}}.
17031707

17041708
Issue: Consider validating the case where the bucket used (after
17051709
summing) is too large. Currently, the implementation appears to
@@ -1711,28 +1715,29 @@ modified to add the following steps just before the last step ("Return
17111715

17121716
1. Set |auctionConfig|'s [=auction config/auction report buyer debug details=]
17131717
to a new [=debug details=].
1714-
1. If |config|[{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}]
1718+
1. If |config|["{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}"]
17151719
[=map/exists=]:
17161720
1. Let |debugModeConfig| be
1717-
|config|[{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}].
1721+
|config|["{{AuctionAdConfig/auctionReportBuyerDebugModeConfig}}"].
17181722
1. Let |enabled| be
1719-
|debugModeConfig|[{{AuctionReportBuyerDebugModeConfig/enabled}}].
1723+
|debugModeConfig|["{{AuctionReportBuyerDebugModeConfig/enabled}}"].
17201724
1. Let |debugKey| be
1721-
|debugModeConfig|[{{AuctionReportBuyerDebugModeConfig/debugKey}}].
1725+
|debugModeConfig|["{{AuctionReportBuyerDebugModeConfig/debugKey}}"].
17221726
1. If |debugKey| is not null:
1723-
1. If |debugKey| is not in the range [0, 2<sup>64</sup>−1], [=exception/
1724-
throw=] a {{TypeError}}.
1727+
1. If |debugKey| is not [=set/contained=] in [=the exclusive range|the
1728+
range=] 0 to 2<sup>64</sup>, exclusive, [=exception/throw=] a
1729+
{{TypeError}}.
17251730
1. If |enabled| is false, [=exception/throw=] a {{TypeError}}.
17261731
1. Set |auctionConfig|'s [=auction config/auction report buyer debug
17271732
details=] to a new [=debug details=] with the items:
17281733
: [=debug details/enabled=]
17291734
:: |enabled|
17301735
: [=debug details/key=]
17311736
:: |debugKey|
1732-
1. If |config|[{{AuctionAdConfig/privateAggregationConfig}}] [=map/exists=]:
1737+
1. If |config|["{{AuctionAdConfig/privateAggregationConfig}}"] [=map/exists=]:
17331738
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
17341739
Aggregation coordinator=] given
1735-
|config|[{{AuctionAdConfig/privateAggregationConfig}}].
1740+
|config|["{{AuctionAdConfig/privateAggregationConfig}}"].
17361741
1. If |aggregationCoordinator| is a {{DOMException}}, return failure.
17371742
1. Set <var ignore>auctionConfig</var>'s [=auction config/seller Private
17381743
Aggregation coordinator=] to |aggregationCoordinator|.
@@ -1859,13 +1864,13 @@ renumbering the later step as appropriate:
18591864
Then, we modify the invocations of the above algorithms to plumb the new
18601865
parameters in:
18611866

1862-
The <a spec="turtledove">generate a bid</a> algorithm is modified to add a new
1863-
<a spec="turtledove">auction config</a> parameter |auctionConfig|. Additionally,
1864-
its last step is modified by adding the argument |auctionConfig| to the
1865-
invocation of <a spec="turtledove">evaluating a bidding script</a>. Further, the
1866-
<a spec="turtledove">generate and score bids</a> algorithm is modified by
1867-
adding the argument |auctionConfig| to both invocations of
1868-
<a spec="turtledove">generate a bid</a>.
1867+
The <a spec="turtledove">generate potentially multiple bids</a> algorithm is
1868+
modified to add a new <a spec="turtledove">auction config</a> parameter
1869+
|auctionConfig|. Additionally, its last step is modified by adding the argument
1870+
|auctionConfig| to the invocation of <a spec="turtledove">evaluating a bidding
1871+
script</a>. Further, the <a spec="turtledove">generate and score bids</a>
1872+
algorithm is modified by adding the argument |auctionConfig| to both invocations
1873+
of <a spec="turtledove">generate potentially multiple bids</a>.
18691874

18701875
The <a spec="turtledove">score and rank a bid</a> algorithm is modified by
18711876
adding the argument |auctionConfig| to the invocation of
@@ -2122,7 +2127,8 @@ integer |maxAllowed| and a <a spec="turtledove">leading bid info</a>
21222127
truncating its fractional part.
21232128
1. If |value|["{{PASignalValue/offset}}"] [=map/exists=], set |returnValue| to
21242129
the result of adding |returnValue| to |value|["{{PASignalValue/offset}}"].
2125-
1. Clamp |returnValue| to the range [0, |maxAllowed|] and return the result.
2130+
1. Clamp |returnValue| to [=the inclusive range|the range=] 0 to |maxAllowed|,
2131+
inclusive, and return the result.
21262132

21272133
To <dfn>determine a signal's numeric value</dfn> given a [=signal base value=]
21282134
|signalBaseValue| and a <a spec="turtledove">leading bid info</a>
@@ -2305,17 +2311,17 @@ namely how many contributions are included. To protect against this, the payload
23052311
is padded to a fixed number of contributions.
23062312
### Temporary debugging mechanism ### {#temporary-debugging-mechanism}
23072313

2308-
The <code>{{PrivateAggregation/enableDebugMode()}}</code> method allows for many
2309-
of the protections of this API to be bypassed to ease testing and integration.
2314+
The {{PrivateAggregation/enableDebugMode()}} method allows for many of the
2315+
protections of this API to be bypassed to ease testing and integration.
23102316
Specifically, the contents of the payload, i.e. the histogram contributions, are
23112317
revealed in the clear when the debug mode is enabled. Optionally, a debug key
23122318
can also be set to associate the report with the calling context. In the future,
23132319
this mechanism will only be available for callers that are eligible to set
23142320
third-party cookies. In that case, the API caller already has the ability to
23152321
communicate information cross-site.
23162322

2317-
Issue(57): Tie <code>{{PrivateAggregation/enableDebugMode()}}</code> to
2318-
third-party cookie eligibility.
2323+
Issue(57): Tie {{PrivateAggregation/enableDebugMode()}} to third-party cookie
2324+
eligibility.
23192325

23202326
### Privacy parameters ### {#privacy-parameters}
23212327

0 commit comments

Comments
 (0)