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: export obtain the Private Aggregation coordinator algorithm #163

Merged
merged 2 commits into from
Oct 18, 2024
Merged
Changes from 1 commit
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
52 changes: 26 additions & 26 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,24 @@ an [=origin=] |origin|, perform the following steps. They return a [=boolean=].

</div>

<div algorithm>
To <dfn export>obtain the Private Aggregation coordinator</dfn> given a
{{USVString}} |originString|, perform the following steps. They return an
[=aggregation coordinator=] or a {{DOMException}}.

1. Let |url| be the result of running the [=URL parser=] on |originString|.
1. If |url| is failure or null, return a new {{DOMException}} with name
"`SyntaxError`".

Issue: Consider throwing an error if the path is not empty.
1. Let |origin| be |url|'s [=url/origin=].
1. If the result of [=determining if an origin is an aggregation coordinator=]
given |origin| is false, return a new {{DOMException}} with name
"`DataError`".
1. Return |origin|.

</div>

<div algorithm>
To <dfn export>set the aggregation coordinator for a batching scope</dfn> given
an [=origin=] |origin| and a [=batching scope=] |batchingScope|:
Expand Down Expand Up @@ -1513,7 +1531,8 @@ following steps at the end of the scope nested under step 5 ("Validate the given
<div algorithm="protected-audience-joinadig-monkey-patch">
17. If |group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"]
[=map/exists=]:
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
1. Let |aggregationCoordinator| be the result of [=obtain the Private
Aggregation coordinator from a PA config|obtaining the Private
Aggregation coordinator=] given
|group|["{{AuctionAdInterestGroup/privateAggregationConfig}}"].
1. If |aggregationCoordinator| is a {{DOMException}}, then
Expand Down Expand Up @@ -1610,7 +1629,8 @@ modified to add the following steps just before the last step ("Return
: [=debug details/key=]
:: |debugKey|
1. If |config|["{{AuctionAdConfig/privateAggregationConfig}}"] [=map/exists=]:
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
1. Let |aggregationCoordinator| be the result of [=obtain the Private
Aggregation coordinator from a PA config|obtaining the Private
Aggregation coordinator=] given
|config|["{{AuctionAdConfig/privateAggregationConfig}}"].
1. If |aggregationCoordinator| is a {{DOMException}}, return failure.
Expand Down Expand Up @@ -1781,8 +1801,7 @@ steps are modified to add the following case at the end of the "Switch on
1. If |value|["`aggregationCoordinatorOrigin`"] [=map/exists=]:
1. If |value|["`aggregationCoordinatorOrigin`"] is not a [=string=],
jump to the step labeled Abort update.
1. Let |aggregationCoordinator| be the result of [=obtain the Private
Aggregation coordinator from a string|obtaining the Private
1. Let |aggregationCoordinator| be the result of [=obtaining the Private
Aggregation coordinator=] given
|value|["`aggregationCoordinatorOrigin`"].
1. If |aggregationCoordinator| is a {{DOMException}}, jump to the step
Expand Down Expand Up @@ -2119,37 +2138,18 @@ They return an [=interest group=] or null:
</div>

<div algorithm>
To <dfn>obtain the Private Aggregation coordinator</dfn> given a
To <dfn lt="obtain the Private Aggregation coordinator from a PA config">obtain
the Private Aggregation coordinator</dfn> given a

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a reason to keep this the same name as the other? Is it slightly easier to just call it "... from a PA config"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was treating them like "overloaded" functions, but I don't feel strongly. That being said, I don't love the "PA config" if it's the proper name -- maybe we could call it "obtain the coordinator from a Private Aggregation config"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went with this!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

{{ProtectedAudiencePrivateAggregationConfig}} |config|, perform the following
steps. They return an [=aggregation coordinator=], null or a {{DOMException}}.

1. If |config|["{{ProtectedAudiencePrivateAggregationConfig/aggregationCoordinatorOrigin}}"]
does not [=map/exist=], return null.
1. Return the result of [=obtain the Private Aggregation coordinator from a
string|obtaining the Private Aggregation coordinator=] given
1. Return the result of [=obtaining the Private Aggregation coordinator=] given
|config|["{{ProtectedAudiencePrivateAggregationConfig/aggregationCoordinatorOrigin}}"].

</div>

<div algorithm>
To <dfn lt="obtain the Private Aggregation coordinator from a string">obtain the
Private Aggregation coordinator</dfn> given a {{USVString}} |originString|,
perform the following steps. They return an [=aggregation coordinator=] or a
{{DOMException}}.

1. Let |url| be the result of running the [=URL parser=] on |originString|.
1. If |url| is failure or null, return a new {{DOMException}} with name
"`SyntaxError`".

Issue: Consider throwing an error if the path is not empty.
1. Let |origin| be |url|'s [=url/origin=].
1. If the result of [=determining if an origin is an aggregation coordinator=]
given |origin| is false, return a new {{DOMException}} with name
"`DataError`".
1. Return |origin|.

</div>

Privacy considerations {#privacy-considerations}
================================================

Expand Down
Loading