Skip to content

Commit d98b3fc

Browse files
authored
Spec: export obtain the Private Aggregation coordinator algorithm (#163)
The version that takes a USVString is shared between Protected Audience and Shared Storage, so we can export it. Also updates the name of the monkey patched version, which will be removed from this spec soon.
1 parent f5cda2b commit d98b3fc

File tree

1 file changed

+25
-28
lines changed

1 file changed

+25
-28
lines changed

spec.bs

+25-28
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,24 @@ an [=origin=] |origin|, perform the following steps. They return a [=boolean=].
641641

642642
</div>
643643

644+
<div algorithm>
645+
To <dfn export>obtain the Private Aggregation coordinator</dfn> given a
646+
{{USVString}} |originString|, perform the following steps. They return an
647+
[=aggregation coordinator=] or a {{DOMException}}.
648+
649+
1. Let |url| be the result of running the [=URL parser=] on |originString|.
650+
1. If |url| is failure or null, return a new {{DOMException}} with name
651+
"`SyntaxError`".
652+
653+
Issue: Consider throwing an error if the path is not empty.
654+
1. Let |origin| be |url|'s [=url/origin=].
655+
1. If the result of [=determining if an origin is an aggregation coordinator=]
656+
given |origin| is false, return a new {{DOMException}} with name
657+
"`DataError`".
658+
1. Return |origin|.
659+
660+
</div>
661+
644662
<div algorithm>
645663
To <dfn export>set the aggregation coordinator for a batching scope</dfn> given
646664
an [=origin=] |origin| and a [=batching scope=] |batchingScope|:
@@ -1513,8 +1531,8 @@ following steps at the end of the scope nested under step 5 ("Validate the given
15131531
<div algorithm="protected-audience-joinadig-monkey-patch">
15141532
17. If |group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"]
15151533
[=map/exists=]:
1516-
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
1517-
Aggregation coordinator=] given
1534+
1. Let |aggregationCoordinator| be the result of [=obtaining the coordinator
1535+
from a Private Aggregation config=] given
15181536
|group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"].
15191537
1. If |aggregationCoordinator| is a {{DOMException}}, then
15201538
[=exception/throw=] |aggregationCoordinator|.
@@ -1610,8 +1628,8 @@ modified to add the following steps just before the last step ("Return
16101628
: [=debug details/key=]
16111629
:: |debugKey|
16121630
1. If |config|["{{AuctionAdConfig/privateAggregationConfig}}"] [=map/exists=]:
1613-
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
1614-
Aggregation coordinator=] given
1631+
1. Let |aggregationCoordinator| be the result of [=obtaining the coordinator
1632+
from a Private Aggregation config=] given
16151633
|config|["{{AuctionAdConfig/privateAggregationConfig}}"].
16161634
1. If |aggregationCoordinator| is a {{DOMException}}, return failure.
16171635
1. Set <var ignore>auctionConfig</var>'s [=auction config/seller Private
@@ -1781,8 +1799,7 @@ steps are modified to add the following case at the end of the "Switch on
17811799
1. If |value|["`aggregationCoordinatorOrigin`"] [=map/exists=]:
17821800
1. If |value|["`aggregationCoordinatorOrigin`"] is not a [=string=],
17831801
jump to the step labeled Abort update.
1784-
1. Let |aggregationCoordinator| be the result of [=obtain the Private
1785-
Aggregation coordinator from a string|obtaining the Private
1802+
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
17861803
Aggregation coordinator=] given
17871804
|value|["`aggregationCoordinatorOrigin`"].
17881805
1. If |aggregationCoordinator| is a {{DOMException}}, jump to the step
@@ -2119,37 +2136,17 @@ They return an [=interest group=] or null:
21192136
</div>
21202137

21212138
<div algorithm>
2122-
To <dfn>obtain the Private Aggregation coordinator</dfn> given a
2139+
To <dfn>obtain the coordinator from a Private Aggregation config</dfn> given a
21232140
{{ProtectedAudiencePrivateAggregationConfig}} |config|, perform the following
21242141
steps. They return an [=aggregation coordinator=], null or a {{DOMException}}.
21252142

21262143
1. If |config|["{{ProtectedAudiencePrivateAggregationConfig/aggregationCoordinatorOrigin}}"]
21272144
does not [=map/exist=], return null.
2128-
1. Return the result of [=obtain the Private Aggregation coordinator from a
2129-
string|obtaining the Private Aggregation coordinator=] given
2145+
1. Return the result of [=obtaining the Private Aggregation coordinator=] given
21302146
|config|["{{ProtectedAudiencePrivateAggregationConfig/aggregationCoordinatorOrigin}}"].
21312147

21322148
</div>
21332149

2134-
<div algorithm>
2135-
To <dfn lt="obtain the Private Aggregation coordinator from a string">obtain the
2136-
Private Aggregation coordinator</dfn> given a {{USVString}} |originString|,
2137-
perform the following steps. They return an [=aggregation coordinator=] or a
2138-
{{DOMException}}.
2139-
2140-
1. Let |url| be the result of running the [=URL parser=] on |originString|.
2141-
1. If |url| is failure or null, return a new {{DOMException}} with name
2142-
"`SyntaxError`".
2143-
2144-
Issue: Consider throwing an error if the path is not empty.
2145-
1. Let |origin| be |url|'s [=url/origin=].
2146-
1. If the result of [=determining if an origin is an aggregation coordinator=]
2147-
given |origin| is false, return a new {{DOMException}} with name
2148-
"`DataError`".
2149-
1. Return |origin|.
2150-
2151-
</div>
2152-
21532150
Privacy considerations {#privacy-considerations}
21542151
================================================
21552152

0 commit comments

Comments
 (0)