From 91f88b3785962540e27a1b6da8c213bd981719b8 Mon Sep 17 00:00:00 2001 From: Youssef Date: Wed, 4 Sep 2024 11:54:58 -0400 Subject: [PATCH 01/27] New Deals Spec --- spec.bs | 106 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 89 insertions(+), 17 deletions(-) diff --git a/spec.bs b/spec.bs index ef004b546..e8ed67db2 100644 --- a/spec.bs +++ b/spec.bs @@ -197,6 +197,7 @@ dictionary AuctionAd { USVString buyerReportingId; USVString buyerAndSellerReportingId; + USVString selectableBuyerAndSellerReportingIds; sequence allowedReportingOrigins; }; @@ -413,6 +414,8 @@ This is detectable because it can change the set of fields that are read from th |igAd|'s [=interest group ad/buyer reporting ID=] to it. 1. If |ad|["{{AuctionAd/buyerAndSellerReportingId}}"] [=map/exists=], then set |igAd|'s [=interest group ad/buyer and seller reporting ID=] to it. + 1. If |ad|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] [=map/exists=], + then set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to it. 1. If |ad|["{{AuctionAd/allowedReportingOrigins}}"] [=map/exists=]: 1. Let |allowedReportingOrigins| be a new [=list=] of [=origins=]. 1. [=list/For each=] |originStr| in |ad|["{{AuctionAd/allowedReportingOrigins}}"]: @@ -1861,7 +1864,7 @@ To generate and score bids given an [=auction config=] |auctionConfig 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is true, set |foundKAnonBids| to true. 1. If |bidsToScore| [=list/is not empty=] but |foundKAnonBids| is false: - + TODO probably need something here, like what happens when the bid is not k anon Note: [=generate potentially multiple bids=] is now rerun with only k-anonymous [=interest group/ads=] to give the buyer a chance to [=generate potentially multiple bids=] for k-anonymous [=interest group/ads=]. Allowing the buyer to first [=generate potentially multiple bids=] for non-k-anonymous [=interest group/ads=] provides a @@ -1997,6 +2000,15 @@ To convert to an AuctionAd sequence given a [=list=]-or-null |ads|: 1. Let |adIDL| be a new {{AuctionAd}}. 1. [=map/Set=] |adIDL|["{{AuctionAd/renderURL}}"] to the [=URL serializer|serialization=] of |ad|'s [=interest group ad/render url=]. + 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting ids=] is not null: + 1.[=map/set=] |adIDL|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] to + |ad|'s [=interest group ad/selectable buyer and seller reporting ids=]. + 1. If |ad|'s [=interest group ad/buyer and seller reporting id=] is not null then + [=map/set=] |adIDL|["{{AuctionAd/buyerAndSellerReportingId}}"] to + |ad|'s [=interest group ad/buyer and seller reporting id=]. + 1. If |ad|'s [=interest group ad/buyer reporting id=] is not null then + [=map/set=] |adIDL|["{{AuctionAd/buyerReportingId}}"] to + |ad|'s [=interest group ad/buyer reporting id=]. 1. If |ad|'s [=interest group ad/size group=] is not null, then [=map/set=] |adIDL|["{{AuctionAd/sizeGroup}}"] to |ad|'s [=interest group ad/size group=]. 1. If |ad|'s [=interest group ad/metadata=] is not null, then [=map/set=] @@ -2708,6 +2720,11 @@ To report result given a [=leading bid info=] |leadingBidInfo|, a given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s [=interest group ad/buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] + [=map/exists=] and the result of [=query reporting ID k-anonymity count=] + given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to + |igAd|'s [=interest group ad/selected buyer and seller reporting ID=]. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]'s [=environment settings object/origin=]. @@ -2772,14 +2789,24 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] - does not [=map/exist=] and the result of [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=] and |igAd| is true: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to - |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] - to |winner|'s [=generated bid/interest group=] [=interest group/name=]. + 1. TODO logic needs to be added here for reporting + 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: + 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to + |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerAndSellerReportingId}}"] to + |igAd|'s [=interest group ad/buyer reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to + |igAd|'s [=interest group ad/buyer reporting ID=]. + 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] + does not [=map/exist=] and the result of [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=] and |igAd| is true: + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to + |igAd|'s [=interest group ad/buyer reporting ID=]. + 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] + to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Let |buyerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=] and |frameOrigin|. 1. Let |buyerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -3878,6 +3905,7 @@ threshold when responding to [=query k-anonymity count=]. 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] 1. the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] + 1. TODO add logic here 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: 1. "BuyerAndSellerReportingId" @@ -4450,6 +4478,7 @@ dictionary GenerateBidOutput { DOMString bidCurrency; (DOMString or AdRender) render; any ad; + USVString selectedBuyerAndSellerReportingId; sequence<(DOMString or AdRender)> adComponents; double adCost; unrestricted double modelingSignals; @@ -4537,6 +4566,9 @@ To convert GenerateBidOutput to generated bid given a {{GenerateBidOu 1. If |bidAd| is null, return failure. 1. Set |bid|'s [=generated bid/ad descriptor=] to |adDescriptor|. 1. Set |bid|'s [=generated bid/bid ad=] to |bidAd|. + 1. If |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"] is specified: + 1. Set |bid|'s [=generated bid/selected buyer and seller reporting id=] to + |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"]. 1. If |generateBidOutput|["{{GenerateBidOutput/adComponents}}"] [=map/exists=]: 1. Let |adComponents| be |generateBidOutput|["{{GenerateBidOutput/adComponents}}"]. 1. Return failure if any of the following conditions hold: @@ -5063,6 +5095,8 @@ navigating to another page. Some implementations, such as Chromium, have chosen |igAd|'s [=interest group ad/buyer reporting ID=] to it. 1. If |ad|["{{AuctionAd/buyerAndSellerReportingId}}"] [=map/exists=] then set |igAd|'s [=interest group ad/buyer and seller reporting ID=] to it. + 1. If |ad|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] [=map/exists=] + then set |igAd|'s [=interest group ad/selectable buyer and seller reporting ID=] to it. 1. [=list/Append=] |igAd| to |igAds|. 1. If |igAds| is not [=list/is empty=]: 1. Set |ig|'s |interestGroupField| to |igAds|. @@ -5727,6 +5761,7 @@ dictionary ReportingBrowserSignals { USVString componentSeller; USVString buyerAndSellerReportingId; + USVString selectedBuyerAndSellerReportingId; }; @@ -5758,6 +5793,8 @@ dictionary ReportingBrowserSignals { listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, and [=ad creative=] URL. +
{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} +
SET IF TODO @@ -5791,6 +5828,8 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { boolean madeHighestScoringOtherBid; DOMString interestGroupName; DOMString buyerReportingId; + DOMString buyerAndSellerReportingId; + DOMString selectedBuyerAndSellerReportingId; unsigned short modelingSignals; unsigned long dataVersion; KAnonStatus kAnonStatus; @@ -5807,11 +5846,30 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dt>{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} <dd>True if the interest group owner was the only bidder that made bids with the second highest score + <dt>{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}} + <dd>Set if the winning ad had a [=interest group ad/selected buyer and seller reporting ID=] + set in its listing in the interest group, and that value was + [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + [=interest group ad/buyer and seller reporting ID=] (if present), + [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. + <dt>{{ReportWinBrowserSignals/buyerAndSellerReportingId}} + <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] and a + [=interest group ad/selected buyer and seller reporting ID=] set in its listing in the interest group, and that value was + [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + [=interest group ad/selected buyer and seller reporting ID=], + [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/buyerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a - [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, - and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - interest group owner, bidding script URL, and [=ad creative=] URL. + <dd>There are two scenerios in which this can be set: + * Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a + [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, + and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + interest group owner, bidding script URL, and [=ad creative=] URL. + * Set if the winning ad had a [=interest group ad/selected buyer and seller reporting ID=] and + [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was + [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + [=interest group ad/selected buyer and seller reporting ID=], + [=interest group ad/buyer and seller reporting ID=] (if present), interest group owner, bidding + script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/interestGroupName}} <dd>Only set if the tuple of interest group owner, name, bidding script URL and [=ad creative=] URL @@ -5987,14 +6045,20 @@ An <dfn>interest group ad</dfn> is a [=struct=] with the following [=struct/item : <dfn>metadata</dfn> :: Null or a [=string=]. Extra arbitary information about this ad, passed to `generateBid()`. : <dfn>buyer reporting ID</dfn> - :: Null or a [=string=]. Will be passed in place of interest group name to [=report win=], subject + :: Null or a [=string=]. Will be passed in place of interest group name to [=report win=], + or alongside the [=generated bid/selected buyer and seller reporting id=], subject to [=k-anonymity=] checks. Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>buyer and seller reporting ID</dfn> :: Null or a [=string=]. Will be passed in place of interest group name or - [=interest group ad/buyer reporting ID=] to [=report win=] and [=report result=], subject to - [=k-anonymity=] checks. Only meaningful in [=interest group/ads=], but ignored in - [=interest group/ad components=]. + [=interest group ad/buyer reporting ID=], or alongside the + [=generated bid/selected buyer and seller reporting id=], to [=report win=] and + [=report result=], subject to [=k-anonymity=] checks. Only meaningful in + [=interest group/ads=], but ignored in [=interest group/ad components=]. + : <dfn>selectable buyer and seller reporting IDs</dfn> + :: Null or a [=list=] of [=strings=]. A list of reporting ids which will be sent to `generateBid()`, + in order to get a [=generated bid/selected buyer and seller reporting id=]. Only meaningful in + [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>allowed reporting origins</dfn> :: Null or a [=list=] of [=origins=]. A list of up to 10 reporting origins that can receive reports with registered macros. Each origin's [=origin/scheme=] must be "`https`" and each origin must be @@ -6617,6 +6681,14 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by was specified, it will have exactly that many [=list/items=]) by the time the bid participates in the auction. Must be null if the interest group making this bid has a null [=interest group/ad components=] field. + : <dfn>selected buyer and seller reporting id</dfn> + :: A [=string=]. Selected reporting id from the + [=interest group ad/selectable buyer and seller reporting IDs=] within the + [=generated bid/interest group=]. If present, will be passed alongside with + [=interest group ad/buyer reporting ID=], and + [=interest group ad/buyer and seller reporting ID=] to [=report win=] and with only the + [=interest group ad/buyer and seller reporting ID=] to [=report result=], subject to + [=k-anonymity=] checks. : <dfn>ad cost</dfn> :: Null or a {{double}}. Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Negative values will be ignored and not passed. Will be From 98fcf13b07f45fd1c13643245477df008a3542d7 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Wed, 4 Sep 2024 14:50:53 -0400 Subject: [PATCH 02/27] fixed some mistakes --- spec.bs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/spec.bs b/spec.bs index e8ed67db2..247a558d3 100644 --- a/spec.bs +++ b/spec.bs @@ -2720,11 +2720,11 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s [=interest group ad/buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=] and the result of [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - |igAd|'s [=interest group ad/selected buyer and seller reporting ID=]. + the |winner|'s [=generated bid/selected buyer and seller reporting id=]. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]'s [=environment settings object/origin=]. @@ -2790,9 +2790,9 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. TODO logic needs to be added here for reporting - 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: + 1. If |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=]: 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + |winner|'s [=generated bid/selected buyer and seller reporting id=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. @@ -5847,16 +5847,15 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dd>True if the interest group owner was the only bidder that made bids with the second highest score <dt>{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/selected buyer and seller reporting ID=] - set in its listing in the interest group, and that value was + <dd>Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with [=interest group ad/buyer and seller reporting ID=] (if present), [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/buyerAndSellerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] and a - [=interest group ad/selected buyer and seller reporting ID=] set in its listing in the interest group, and that value was + <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and the winning bid had a + [=generated bid/selected buyer and seller reporting id=], and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/selected buyer and seller reporting ID=], + [=generated bid/selected buyer and seller reporting id=], [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/buyerReportingId}} <dd>There are two scenerios in which this can be set: @@ -5864,10 +5863,10 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, and [=ad creative=] URL. - * Set if the winning ad had a [=interest group ad/selected buyer and seller reporting ID=] and + * Set if the wining bid had a [=generated bid/selected buyer and seller reporting id=] and the winning ad had a [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/selected buyer and seller reporting ID=], + [=generated bid/selected buyer and seller reporting id=], [=interest group ad/buyer and seller reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. From e34a49b124e512176cb086667d73c3735f6bf4db Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 5 Sep 2024 11:11:13 -0400 Subject: [PATCH 03/27] resolved some of my todos --- spec.bs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/spec.bs b/spec.bs index 247a558d3..a786c4e76 100644 --- a/spec.bs +++ b/spec.bs @@ -2789,7 +2789,6 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. TODO logic needs to be added here for reporting 1. If |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=]: 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting id=]. @@ -5789,12 +5788,22 @@ dictionary ReportingBrowserSignals { <dt>{{ReportingBrowserSignals/componentSeller}} <dd>Copied from [=leading bid info/component seller=] <dt>{{ReportingBrowserSignals/buyerAndSellerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its - listing in the interest group, and that value was - [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, - bidding script URL, and [=ad creative=] URL. + <dd>There are two scenerios in which this can be set: + * Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its + listing in the interest group, and that value was + [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, + bidding script URL, and [=ad creative=] URL. + * Set if the winning ad had a [=interest group ad/buyer and seller reporting id=] set in its + listing in the interest group and the winning bid had a [=generated bid/selected buyer and seller reporting id=] set, + and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + [=generated bid/selected buyer and seller reporting id=], interest group owner, bidding script URL, + and [=ad creative=] URL. <dt>{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} - <dd> SET IF TODO + <dd>A selected reporting id returned by "`generateBid()`". + Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] set, + and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + [=interest group ad/buyer and seller reporting ID=] (if present), interest group owner, + bidding script URL, and [=ad creative=] URL. </dl> <xmp class="idl"> From 4da9a89c61394f76beddda37f6bbb5a9826c250d Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 9 Sep 2024 13:47:04 -0400 Subject: [PATCH 04/27] added k anon + and other missing pieces --- spec.bs | 164 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 56 deletions(-) diff --git a/spec.bs b/spec.bs index a786c4e76..4e9ae0d3e 100644 --- a/spec.bs +++ b/spec.bs @@ -1876,13 +1876,25 @@ To <dfn>generate and score bids</dfn> given an [=auction config=] |auctionConfig 1. If |originalAds| is not null: 1. Set |ig|'s [=interest group/ads=] to a new [=list=] of [=interest group ad=]. 1. [=list/For each=] |ad| in |originalAds|: - 1. If [=query ad k-anonymity count=] given |ig| and |ad|'s - [=interest group ad/render url=] returns true, [=list/append=] |ad| to |ig|'s - [=interest group/ads=]. + 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting ids=] is not null: + 1. [=list/For each=] |reportingId| in |ad|'s [=interest group ad/selectable buyer and seller reporting ids=]: + 1. If [=query ad k-anonymity count=] given |ig|, |ad|'s + [=interest group ad/render url=], and |reportingId| returns true, [=list/append=] |ad| to |ig|'s + [=interest group/ads=]. + 1. Otherwise: + 1. If [=query ad k-anonymity count=] given |ig| and |ad|'s + [=interest group ad/render url=] returns true, [=list/append=] |ad| to |ig|'s + [=interest group/ads=]. 1. Let |originalAdComponents| be |ig|'s [=interest group/ad components=]. 1. If |originalAdComponents| is not null: 1. Set |ig|'s [=interest group/ad components=] to a new [=list=] of [=interest group ad=]. 1. [=list/For each=] |adComponent| in |originalAdComponents|: + 1. If |adComponent|'s [=interest group ad/selectable buyer and seller reporting ids=] is not null: + 1. [=list/For each=] |reportingId| in |adComponent|'s [=interest group ad/selectable buyer and seller reporting ids=]: + 1. If [=query ad k-anonymity count=] given |ig|, |adComponent|'s + [=interest group ad/render url=], and |reportingId| returns true, [=list/append=] |ad| to |ig|'s + [=interest group/ad components=]. + 1. Otherwise: 1. If [=query component ad k-anonymity count=] given |adComponent|'s [=interest group ad/render url=] returns true, [=list/append=] |adComponent| to |ig|'s [=interest group/ad components=]. @@ -2715,16 +2727,20 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. + 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting id=] + [=map/exists=] and the result of [=query reporting ID k-anonymity count=] + given |winner|'s [=generated bid/interest group=], |igAd|, and the + |winner|'s [=generated bid/selected buyer and seller reporting id=] is true: + 1. Set |selectedReportingId| to the |winner|'s [=generated bid/selected buyer and seller reporting id=]. + 1. [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to + |selectedReportingId|. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=] and the result of [=query reporting ID k-anonymity count=] - given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] + given |winner|'s [=generated bid/interest group=], |igAd|, and |selectedReportingId| is true, then [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s [=interest group ad/buyer and seller reporting ID=]. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting id=] - [=map/exists=] and the result of [=query reporting ID k-anonymity count=] - given |winner|'s [=generated bid/interest group=] and |igAd| is true, then [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - the |winner|'s [=generated bid/selected buyer and seller reporting id=]. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]'s [=environment settings object/origin=]. @@ -2789,7 +2805,8 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=]: + 1. If |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=] and [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting id=] is true: 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting id=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], @@ -2800,7 +2817,7 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] |igAd|'s [=interest group ad/buyer reporting ID=]. 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] does not [=map/exist=] and the result of [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=] and |igAd| is true: + |winner|'s [=generated bid/interest group=], |igAd|, and null is true: 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. @@ -3884,38 +3901,73 @@ threshold when responding to [=query k-anonymity count=]. </div> <div algorithm> - To <dfn>query ad k-anonymity count</dfn> given an [=interest group=] |ig| and a [=URL=] |ad|: - 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: - 1. "AdBid" - 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - 1. the [=URL serializer|serialization=] of |ad|. + To <dfn>query ad k-anonymity count</dfn> given an [=interest group=] |ig|, a [=URL=] |ad|, + and a [=string=]-or-null |selectedReportingId| : + 1. If |selectedReportingId| is not null: + 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: + 1. "AdBid" + 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + 1. the [=URL serializer|serialization=] of |ad|. + 1. the |selectedReportingId| + 1. Otherwise: + 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: + 1. "AdBid" + 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + 1. the [=URL serializer|serialization=] of |ad|. 1. Let |keyHash| be the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. 1. Return the result of [=query k-anonymity count|querying the k-anonymity count=] given |keyHash|. </div> <div algorithm> - To <dfn>compute the key hash of reporting ID</dfn> given an [=interest group=] |ig| and an - [=interest group ad=] |igAd|: - 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A (LF): + To <dfn>compute the key hash for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: + 1. If |reportingId| is null: + 1. Return the [=string/concatenation=] of the following: + 1. U+000A (LF) + 1. "\00\00\00\00\00" + 1. Otherwise: + 1. Return the [=string/concatenation=] of the following: + 1.1. U+000A (LF) + 1. "\01" + 1. The size of |reportingId| in bytes + 1. |reportingId| +</div> - 1. "NameReport" +<div algorithm> + To <dfn>compute the key hash of reporting ID</dfn> given an [=interest group=] |ig| and an + [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: + 1. Let |middle| be the [=string/concatenation=] of the following strings separated with U+000A (LF): 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] 1. the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] - 1. TODO add logic here - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] - [=map/exists=]: - 1. "BuyerAndSellerReportingId" - 1. |igAd|'s [=interest group ad/buyer and seller reporting ID=] - 1. Otherwise, if |igAd|'s [=interest group ad/buyer reporting ID=] - [=map/exists=]: - 1. "BuyerReportingId" - 1. |igAd|'s [=interest group ad/buyer reporting ID=] + 1. Let |keyString| be an empty [=string=]. + 1. If |selectedReportingId| is not null: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "SelectedBuyerAndSellerReportId" + 1. |middle| + 1. The result of [=compute the key hash for one of multiple reporting ids=] given |selectedReportingId| + 1. The result of [=compute the key hash for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer and seller reporting ID=] + 1. The result of [=compute the key hash for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer reporting ID=] + 1. Otherwise: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "BuyerAndSellerReportId" + 1. |middle| + 1. |igAd|'s [=interest group ad/buyer and seller reporting ID=] + 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=]: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "BuyerReportId" + 1. |middle| + 1. |igAd|'s [=interest group ad/buyer reporting ID=] 1. Otherwise: - 1. "IgName" - 1. |ig|'s [=interest group/name=]. + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "NameReport" + 1. |middle| + 1. |igAd|'s [=interest group/name=] 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> @@ -3931,8 +3983,11 @@ threshold when responding to [=query k-anonymity count=]. <div algorithm> To <dfn>query generated bid k-anonymity count</dfn> given a [=generated bid=] |bid|: + 1. Let |selectedReportingId| be a [=string=]-or-null set to null + 1. If |bid|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=], set + |selectedReportingId| to |bid|'s [=generated bid/selected buyer and seller reporting id=]. 1. If [=query ad k-anonymity count=] given |bid|'s [=generated bid/ad descriptor=]'s - [=ad descriptor/url=] returns false, return false. + [=ad descriptor/url=], and |selectedReportingId| returns false, return false. 1. If |bid|'s [=generated bid/ad component descriptors=] is not null: 1. [=set/For each=] |adComponentDescriptor| in |bid|'s [=generated bid/ad component descriptors=]: @@ -3944,8 +3999,8 @@ threshold when responding to [=query k-anonymity count=]. <div algorithm> To <dfn>query reporting ID k-anonymity count</dfn> given an [=interest group=] - |ig| and [=interest group ad=] |igAd|: - 1. Let |keyHash| be the result of [=computing the key hash of reporting ID=] given |ig| and |igAd|. + |ig|, a [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: + 1. Let |keyHash| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectedReportingId|. 1. Return the result of [=query k-anonymity count|querying the k-anonymity count=] given |keyHash|. </div> @@ -5788,21 +5843,16 @@ dictionary ReportingBrowserSignals { <dt>{{ReportingBrowserSignals/componentSeller}} <dd>Copied from [=leading bid info/component seller=] <dt>{{ReportingBrowserSignals/buyerAndSellerReportingId}} - <dd>There are two scenerios in which this can be set: - * Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its + <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, - bidding script URL, and [=ad creative=] URL. - * Set if the winning ad had a [=interest group ad/buyer and seller reporting id=] set in its - listing in the interest group and the winning bid had a [=generated bid/selected buyer and seller reporting id=] set, - and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=generated bid/selected buyer and seller reporting id=], interest group owner, bidding script URL, - and [=ad creative=] URL. + bidding script URL, [=ad creative=] URL, and + [=generated bid/selected buyer and seller reporting id=] if it [=map/exists=], otherwise null. <dt>{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} <dd>A selected reporting id returned by "`generateBid()`". Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] set, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/buyer and seller reporting ID=] (if present), interest group owner, + [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding script URL, and [=ad creative=] URL. </dl> @@ -5858,33 +5908,32 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dt>{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}} <dd>Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/buyer and seller reporting ID=] (if present), - [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. + [=interest group ad/buyer and seller reporting ID=], + [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/buyerAndSellerReportingId}} <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and the winning bid had a [=generated bid/selected buyer and seller reporting id=], and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=generated bid/selected buyer and seller reporting id=], - [=interest group ad/buyer reporting ID=] (if present), interest group owner, bidding script URL, and [=ad creative=] URL. + [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, [=ad creative=] URL, and + [=generated bid/selected buyer and seller reporting id=] if it [=map/exists=], otherwise null. <dt>{{ReportWinBrowserSignals/buyerReportingId}} <dd>There are two scenerios in which this can be set: * Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - interest group owner, bidding script URL, and [=ad creative=] URL. + interest group owner, bidding script URL, [=ad creative=] URL, and null. * Set if the wining bid had a [=generated bid/selected buyer and seller reporting id=] and the winning ad had a [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=generated bid/selected buyer and seller reporting id=], - [=interest group ad/buyer and seller reporting ID=] (if present), interest group owner, bidding - script URL, and [=ad creative=] URL. + [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding + script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting id=],. <dt>{{ReportWinBrowserSignals/interestGroupName}} - <dd>Only set if the tuple of interest group owner, name, bidding script URL and [=ad creative=] URL - + <dd>Only set if the tuple of interest group owner, name, bidding script URL, [=ad creative=] URL, and null were [=query reporting ID k-anonymity count|jointly k-anonymous=], and the winning ad had neither [=interest group ad/buyer and seller reporting ID=] - nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group. + nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group, + and the winning bid did not have [=generated bid/selected buyer and seller reporting id=] set. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>A 0-4095 integer (12-bits) passed to `reportWin()`, with noising <dt>{{ReportWinBrowserSignals/dataVersion}} @@ -6690,7 +6739,7 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by in the auction. Must be null if the interest group making this bid has a null [=interest group/ad components=] field. : <dfn>selected buyer and seller reporting id</dfn> - :: A [=string=]. Selected reporting id from the + :: Null or [=string=]. The selected reporting id from the [=interest group ad/selectable buyer and seller reporting IDs=] within the [=generated bid/interest group=]. If present, will be passed alongside with [=interest group ad/buyer reporting ID=], and @@ -6769,6 +6818,9 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| + 1. // TODO will need to fix below with new stuff + 1. // if (k anon is true and selected is not in generated bid) OR + 1. // K anon for reporting is true 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true: Issue: TODO: change to query k-anonymity cache instead. From e3ec18e121c45d5e71b51f8bfe0e7651876908f9 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 9 Sep 2024 14:49:46 -0400 Subject: [PATCH 05/27] feedback from orr changes --- spec.bs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index 4e9ae0d3e..6047bfb91 100644 --- a/spec.bs +++ b/spec.bs @@ -3922,7 +3922,7 @@ threshold when responding to [=query k-anonymity count=]. </div> <div algorithm> - To <dfn>compute the key hash for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: + To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: 1. If |reportingId| is null: 1. Return the [=string/concatenation=] of the following: 1. U+000A (LF) @@ -3947,10 +3947,10 @@ threshold when responding to [=query k-anonymity count=]. 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): 1. "SelectedBuyerAndSellerReportId" 1. |middle| - 1. The result of [=compute the key hash for one of multiple reporting ids=] given |selectedReportingId| - 1. The result of [=compute the key hash for one of multiple reporting ids=] given |igAd|'s + 1. The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| + 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s [=interest group ad/buyer and seller reporting ID=] - 1. The result of [=compute the key hash for one of multiple reporting ids=] given |igAd|'s + 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s [=interest group ad/buyer reporting ID=] 1. Otherwise: 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: @@ -6818,10 +6818,9 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| - 1. // TODO will need to fix below with new stuff - 1. // if (k anon is true and selected is not in generated bid) OR - 1. // K anon for reporting is true - 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true: + // TODO make this sound better + 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true + AND (selected is not in generated bid OR K anon for reporting is true): Issue: TODO: change to query k-anonymity cache instead. (<a href="https://github.com/WICG/turtledove/issues/1150">WICG/turtledove#1150</a>) From 5c31155b696806a24836e9c67ba33dc31b04ba38 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 9 Sep 2024 15:14:29 -0400 Subject: [PATCH 06/27] fixed formatting for todo --- spec.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index 6047bfb91..70ef9d8ed 100644 --- a/spec.bs +++ b/spec.bs @@ -6818,7 +6818,7 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| - // TODO make this sound better + 1. // TODO make this sound better 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true AND (selected is not in generated bid OR K anon for reporting is true): From 3b4a6a2e9f5331207304f43b3041a91e9e909cab Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 10 Sep 2024 11:39:12 -0400 Subject: [PATCH 07/27] added back stuff that was removed in rebase but with todos --- spec.bs | 92 ++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 27 deletions(-) diff --git a/spec.bs b/spec.bs index a7a319471..d8ad853dd 100644 --- a/spec.bs +++ b/spec.bs @@ -3857,6 +3857,20 @@ from querying the server during an auction. 1. Return true if it is above the threshold, otherwise return false. </div> +<div algorithm> + To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: + 1. If |reportingId| is null: + 1. Return the [=string/concatenation=] of the following: + 1. U+000A (LF) + 1. "\00\00\00\00\00" + 1. Otherwise: + 1. Return the [=string/concatenation=] of the following: + 1.1. U+000A (LF) + 1. "\01" + 1. The size of |reportingId| in bytes + 1. |reportingId| +</div> + // TODO remove this and fit into the one below <div algorithm> To <dfn>query ad k-anonymity count</dfn> given an [=interest group=] |ig|, a [=URL=] |ad|, @@ -3888,36 +3902,57 @@ from querying the server during an auction. </div> <div algorithm> - To <dfn>compute the key hash of ad</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|: - 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: - * "AdBid" - * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. - 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. + To <dfn>compute the key hash of ad</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedBuyerAndSellerReportingId|: + 1. If |selectedBuyerAndSellerReportingId| is not null: + 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: + * "AdBid" + * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. + * the |selectedBuyerAndSellerReportingId| + 1. Otherwise: + 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: + * "AdBid" + * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. + 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> <div algorithm> To <dfn>compute the key hash of reporting ID</dfn> given an [=interest group=] |ig| and an - [=interest group ad=] |igAd|: - 1. Let |keyString| be a [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A (LF): - - * "NameReport" - * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] - * If |igAd|'s [=interest group ad/buyer and seller reporting ID=] - [=map/exists=]: - * "BuyerAndSellerReportingId" - * |igAd|'s [=interest group ad/buyer and seller reporting ID=] - * Otherwise, if |igAd|'s [=interest group ad/buyer reporting ID=] - [=map/exists=]: - * "BuyerReportingId" - * |igAd|'s [=interest group ad/buyer reporting ID=] - * Otherwise: - * "IgName" - * |ig|'s [=interest group/name=]. - 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. + [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: + 1. Let |middle| be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + 1. the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] + 1. Let |keyString| be an empty [=string=]. + 1. If |selectedReportingId| is not null: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "SelectedBuyerAndSellerReportId" + 1. |middle| + 1. The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| + 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer and seller reporting ID=] + 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer reporting ID=] + 1. Otherwise: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "BuyerAndSellerReportId" + 1. |middle| + 1. |igAd|'s [=interest group ad/buyer and seller reporting ID=] + 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=]: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "BuyerReportId" + 1. |middle| + 1. |igAd|'s [=interest group ad/buyer reporting ID=] + 1. Otherwise: + 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + 1. "IgName" + 1. |middle| + 1. |igAd|'s [=interest group/name=] + 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> <div algorithm> @@ -3933,7 +3968,8 @@ from querying the server during an auction. 1. Let |selectedReportingId| be a [=string=]-or-null set to null 1. If |bid|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=], set |selectedReportingId| to |bid|'s [=generated bid/selected buyer and seller reporting id=]. - 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=] and |bid|'s [=generated bid/ad descriptor=]. + 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=], + |bid|'s [=generated bid/ad descriptor=], and |bid|'s [=generated bid/selected buyer and seller reporting id=]. 1. If [=query k-anonymity cache=] for |adHashCode|, and |selectedReportingId| returns false, return false. 1. If |bid|'s [=generated bid/ad component descriptors=] is not null: 1. [=set/For each=] |adComponentDescriptor| in |bid|'s @@ -3961,6 +3997,8 @@ from querying the server during an auction. <div algorithm> To <dfn>update k-anonymity cache for interest group</dfn> given an [=interest group=] |ig|: + 1. TODO figure out how we update with selectables, do we loop through? + This is needed for the compute key hash which takes a selected 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: 1. Compute the |adHashCode| following [=compute the key hash of ad=] for |ig| and |igAd|. 1. Run [=update k-anonymity cache for key=] on |adHashCode|. From 8484b7896f24747be6b93ca769b7a31ea59d2e9e Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 10 Sep 2024 15:14:46 -0400 Subject: [PATCH 08/27] redid k anon with Orr feedback, handled todos, and fixed some naming --- spec.bs | 154 +++++++++++++++++++++++++------------------------------- 1 file changed, 68 insertions(+), 86 deletions(-) diff --git a/spec.bs b/spec.bs index d8ad853dd..414dd494c 100644 --- a/spec.bs +++ b/spec.bs @@ -1881,29 +1881,13 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is true, set |foundKAnonBids| to true. 1. If |bidsToScore| [=list/is not empty=] but |foundKAnonBids| is false: - TODO probably need something here, like what happens when the bid is not k anon Note: [=generate potentially multiple bids=] is now rerun with only k-anonymous [=interest group/ads=] to give the buyer a chance to [=generate potentially multiple bids=] for k-anonymous [=interest group/ads=]. Allowing the buyer to first [=generate potentially multiple bids=] for non-k-anonymous [=interest group/ads=] provides a mechanism to bootstrap the k-anonymity count, otherwise no [=interest group/ads=] would ever trigger [=increment k-anonymity count=] and all ads would fail [=query k-anonymity count=]. - - 1. Let |originalAds| be |ig|'s [=interest group/ads=]. - 1. If |originalAds| is not null: - 1. Set |ig|'s [=interest group/ads=] to a new [=list=] of [=interest group ad=]. - 1. [=list/For each=] |ad| in |originalAds|: - 1. TODO loop through the selectables - 1. Compute |adHashCode| by getting the result of [=compute the key hash of ad=] given |ig| and |ad|. - 1. If [=query k-anonymity cache=] given |adHashCode| returns true, - [=list/append=] |ad| to |ig|'s [=interest group/ads=]. - 1. Let |originalAdComponents| be |ig|'s [=interest group/ad components=]. - 1. If |originalAdComponents| is not null: - 1. Set |ig|'s [=interest group/ad components=] to a new [=list=] of [=interest group ad=]. - 1. [=list/For each=] |adComponent| in |originalAdComponents|: - 1. Compute |componentAdHashCode| by getting the result of [=compute the key hash of component ad=] given |adComponent|. - 1. If [=query k-anonymity cache=] given |componentAdHashCode| returns true, - [=list/append=] |adComponent| to |ig|'s [=interest group/ad components=]. + 1. Let |kAnonRestrictedIG| be the result of [=create a k-anon restricted deep copy of the interest group=] given |ig|. 1. If |perBuyerCumulativeTimeout| is not null and is &lt; |perBuyerTimeout|, then set |perBuyerTimeout| to |perBuyerCumulativeTimeout|. 1. Let |generateBidStartTime| be |settings|'s @@ -1912,12 +1896,12 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: of running [=generate potentially multiple bids=] with |allTrustedBiddingSignals|, |crossOriginTrustedBiddingSignalsOrigin|, |auctionSignals|, a [=map/clone=] of |browserSignals|, |perBuyerSignals|, |directFromSellerSignalsForBuyer|, |perBuyerTimeout|, |expectedCurrency|, - 1 (for multiBidLimit), |ig|, |auctionStartTime|, and |settings|. + 1 (for multiBidLimit), |kAnonRestrictedIG|, |auctionStartTime|, and |settings|. Note: passing 1 for multiBidLimit limits the rerun to producing at most a single bid. - 1. Set |ig|'s [=interest group/ads=] to |originalAds|. - 1. Set |ig|'s [=interest group/ad components=] to |originalAdComponents|. + 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to |ig|'s [=interest group/ads=]. + 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to |ig|'s [=interest group/ad components=]. 1. Let |generateBidDuration| be the [=duration from=] |generateBidStartTime| to |settings|'s [=environment settings object/current monotonic time=], in milliseconds. 1. If |perBuyerCumulativeTimeout| is not null, then decrement |perBuyerCumulativeTimeout| @@ -2019,9 +2003,9 @@ To <dfn>convert to an AuctionAd sequence</dfn> given a [=list=]-or-null |ads|: 1. Let |adIDL| be a new {{AuctionAd}}. 1. [=map/Set=] |adIDL|["{{AuctionAd/renderURL}}"] to the [=URL serializer|serialization=] of |ad|'s [=interest group ad/render url=]. - 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting ids=] is not null: + 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: 1.[=map/set=] |adIDL|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] to - |ad|'s [=interest group ad/selectable buyer and seller reporting ids=]. + |ad|'s [=interest group ad/selectable buyer and seller reporting IDs=]. 1. If |ad|'s [=interest group ad/buyer and seller reporting id=] is not null then [=map/set=] |adIDL|["{{AuctionAd/buyerAndSellerReportingId}}"] to |ad|'s [=interest group ad/buyer and seller reporting id=]. @@ -2677,11 +2661,11 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting id=] + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=] and the result of [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=], |igAd|, and the - |winner|'s [=generated bid/selected buyer and seller reporting id=] is true: - 1. Set |selectedReportingId| to the |winner|'s [=generated bid/selected buyer and seller reporting id=]. + |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: + 1. Set |selectedReportingId| to the |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. [=map/set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |selectedReportingId|. @@ -2753,10 +2737,10 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If |winner|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=] and [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting id=] is true: + 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=] and [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - |winner|'s [=generated bid/selected buyer and seller reporting id=]. + |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. @@ -3849,6 +3833,31 @@ in the [=user agent=]'s [=interest group set=] and whose [=map/values=] are [=k- This allows the browser to rerun portions of an auction without incurring the delay (and added side channels) from querying the server during an auction. +<div algorithm> + To <dfn>create a k-anon restricted deep copy of the interest group</dfn> given a [=interest group=] |ig|: + 1. Let |kAnonRestrictedIG| be a deep copy of |ig| + 1. If |ig|'s [=interest group/ads=] is not null: + 1. Let |kAnonRestrictedIG|'s [=interest group/ads=] be an be an empty [=list=] of [=interest group ad=] + 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: + 1. Compute the |adHashCode| by getting the result of [=compute the key hash of ad=] given |ig| and |igAd|. + 1. If [=query k-anonymity cache=] for |adHashCode| returns true: + 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: + 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. + 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: + 1. Compute |reportingHashCode| by getting the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: + 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. + 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to |kAnonRestrictedSelectableReportingIds|. + 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. + 1. If |ig|'s [=interest group/ad components=] is not null: + 1. Let |kAnonRestrictedIG|'s [=interest group/ad components=] be an be an empty [=list=] of [=interest group ad=]. + 1. [=list/For each=] |igAdComponent| of |ig|'s [=interest group/ad components=]: + 1. Compute the |adComponentHashCode| by getting the result of [=compute the key hash of ad=] given |ig| and |igAdComponent|. + 1. If [=query k-anonymity cache=] for |adComponentHashCode| returns true: + 1. [=list/Append=] |igAdComponent| to |kAnonRestrictedIG|'s [=interest group/ad components=]. + 1. return |kAnonRestrictedIG|. +</div> + <div algorithm> To <dfn>query k-anonymity count</dfn> given a [=SHA-256=] |hashCode|: 1. If the [=k-anonymity server=] has recorded at least [=k-anonymity threshold=] users @@ -3871,28 +3880,6 @@ from querying the server during an auction. 1. |reportingId| </div> -// TODO remove this and fit into the one below -<div algorithm> - To <dfn>query ad k-anonymity count</dfn> given an [=interest group=] |ig|, a [=URL=] |ad|, - and a [=string=]-or-null |selectedReportingId| : - 1. If |selectedReportingId| is not null: - 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: - 1. "AdBid" - 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - 1. the [=URL serializer|serialization=] of |ad|. - 1. the |selectedReportingId| - 1. Otherwise: - 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: - 1. "AdBid" - 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - 1. the [=URL serializer|serialization=] of |ad|. - 1. Let |keyHash| be the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. - - 1. Return the result of [=query k-anonymity count|querying the k-anonymity count=] given |keyHash|. -</div> - <div algorithm> To <dfn>query k-anonymity cache</dfn> given a [=SHA-256=] |hashCode|: 1. If the [=user agent=]'s [=k-anonymity cache=] does not [=map/contain=] |hashCode|, then return false. @@ -3902,20 +3889,12 @@ from querying the server during an auction. </div> <div algorithm> - To <dfn>compute the key hash of ad</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedBuyerAndSellerReportingId|: - 1. If |selectedBuyerAndSellerReportingId| is not null: - 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: - * "AdBid" - * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. - * the |selectedBuyerAndSellerReportingId| - 1. Otherwise: - 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: - * "AdBid" - * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. + To <dfn>compute the key hash of ad</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|: + 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: + * "AdBid" + * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=]. 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> @@ -3966,11 +3945,11 @@ from querying the server during an auction. <div algorithm> To <dfn>query generated bid k-anonymity count</dfn> given a [=generated bid=] |bid|: 1. Let |selectedReportingId| be a [=string=]-or-null set to null - 1. If |bid|'s [=generated bid/selected buyer and seller reporting id=] [=map/exists=], set - |selectedReportingId| to |bid|'s [=generated bid/selected buyer and seller reporting id=]. + 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set + |selectedReportingId| to |bid|'s [=generated bid/selected buyer and seller reporting ID=]. 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=], - |bid|'s [=generated bid/ad descriptor=], and |bid|'s [=generated bid/selected buyer and seller reporting id=]. - 1. If [=query k-anonymity cache=] for |adHashCode|, and |selectedReportingId| returns false, return false. + |bid|'s [=generated bid/ad descriptor=]. + 1. If [=query k-anonymity cache=] for |adHashCode| returns false, return false. 1. If |bid|'s [=generated bid/ad component descriptors=] is not null: 1. [=set/For each=] |adComponentDescriptor| in |bid|'s [=generated bid/ad component descriptors=]: @@ -3997,13 +3976,16 @@ from querying the server during an auction. <div algorithm> To <dfn>update k-anonymity cache for interest group</dfn> given an [=interest group=] |ig|: - 1. TODO figure out how we update with selectables, do we loop through? - This is needed for the compute key hash which takes a selected 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: 1. Compute the |adHashCode| following [=compute the key hash of ad=] for |ig| and |igAd|. 1. Run [=update k-anonymity cache for key=] on |adHashCode|. - 1. Compute the |adReportingHashCode| following [=compute the key hash of reporting ID=]. - 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. + 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: + 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: + 1. Compute |adReportingHashCode| by getting the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. + 1. Otherwise: + 1. Compute the |adReportingHashCode| following [=compute the key hash of reporting ID=]. + 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. [=list/For each=] |componentAd| of |ig|'s [=interest group/ad components=]: 1. Compute the |componentAdHashCode| following [=compute the key hash of component ad=] for |componentAd|. 1. Run [=update k-anonymity cache for key=] on |componentAdHashCode|. @@ -4626,7 +4608,7 @@ To <dfn>convert GenerateBidOutput to generated bid</dfn> given a {{GenerateBidOu 1. Set |bid|'s [=generated bid/ad descriptor=] to |adDescriptor|. 1. Set |bid|'s [=generated bid/bid ad=] to |bidAd|. 1. If |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"] is specified: - 1. Set |bid|'s [=generated bid/selected buyer and seller reporting id=] to + 1. Set |bid|'s [=generated bid/selected buyer and seller reporting ID=] to |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"]. 1. If |generateBidOutput|["{{GenerateBidOutput/adComponents}}"] [=map/exists=]: 1. Let |adComponents| be |generateBidOutput|["{{GenerateBidOutput/adComponents}}"]. @@ -5160,7 +5142,7 @@ navigating to another page. Some implementations, such as Chromium, have chosen 1. If |ad|["{{AuctionAd/buyerAndSellerReportingId}}"] [=map/exists=] then set |igAd|'s [=interest group ad/buyer and seller reporting ID=] to it. 1. If |ad|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] [=map/exists=] - then set |igAd|'s [=interest group ad/selectable buyer and seller reporting ID=] to it. + then set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to it. 1. [=list/Append=] |igAd| to |igAds|. 1. If |igAds| is not [=list/is empty=]: 1. Set |ig|'s |interestGroupField| to |igAds|. @@ -5857,10 +5839,10 @@ dictionary ReportingBrowserSignals { listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, [=ad creative=] URL, and - [=generated bid/selected buyer and seller reporting id=] if it [=map/exists=], otherwise null. + [=generated bid/selected buyer and seller reporting ID=] if it [=map/exists=], otherwise null. <dt>{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} <dd>A selected reporting id returned by "`generateBid()`". - Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] set, + Set if the winning bid had a [=generated bid/selected buyer and seller reporting ID=] set, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding script URL, and [=ad creative=] URL. @@ -5916,34 +5898,34 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dd>True if the interest group owner was the only bidder that made bids with the second highest score <dt>{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}} - <dd>Set if the winning bid had a [=generated bid/selected buyer and seller reporting id=] and that value was + <dd>Set if the winning bid had a [=generated bid/selected buyer and seller reporting ID=] and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with [=interest group ad/buyer and seller reporting ID=], [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, and [=ad creative=] URL. <dt>{{ReportWinBrowserSignals/buyerAndSellerReportingId}} <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and the winning bid had a - [=generated bid/selected buyer and seller reporting id=], and that value was + [=generated bid/selected buyer and seller reporting ID=], and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, [=ad creative=] URL, and - [=generated bid/selected buyer and seller reporting id=] if it [=map/exists=], otherwise null. + [=generated bid/selected buyer and seller reporting ID=] if it [=map/exists=], otherwise null. <dt>{{ReportWinBrowserSignals/buyerReportingId}} <dd>There are two scenerios in which this can be set: * Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, [=ad creative=] URL, and null. - * Set if the wining bid had a [=generated bid/selected buyer and seller reporting id=] and the winning ad had a + * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the winning ad had a [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding - script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting id=],. + script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting ID=],. <dt>{{ReportWinBrowserSignals/interestGroupName}} <dd>Only set if the tuple of interest group owner, name, bidding script URL, [=ad creative=] URL, and null were [=query reporting ID k-anonymity count|jointly k-anonymous=], and the winning ad had neither [=interest group ad/buyer and seller reporting ID=] nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group, - and the winning bid did not have [=generated bid/selected buyer and seller reporting id=] set. + and the winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>A 0-4095 integer (12-bits) passed to `reportWin()`, with noising <dt>{{ReportWinBrowserSignals/dataVersion}} @@ -6113,18 +6095,18 @@ An <dfn>interest group ad</dfn> is a [=struct=] with the following [=struct/item :: Null or a [=string=]. Extra arbitary information about this ad, passed to `generateBid()`. : <dfn>buyer reporting ID</dfn> :: Null or a [=string=]. Will be passed in place of interest group name to [=report win=], - or alongside the [=generated bid/selected buyer and seller reporting id=], subject + or alongside the [=generated bid/selected buyer and seller reporting ID=], subject to [=k-anonymity=] checks. Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>buyer and seller reporting ID</dfn> :: Null or a [=string=]. Will be passed in place of interest group name or [=interest group ad/buyer reporting ID=], or alongside the - [=generated bid/selected buyer and seller reporting id=], to [=report win=] and + [=generated bid/selected buyer and seller reporting ID=], to [=report win=] and [=report result=], subject to [=k-anonymity=] checks. Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>selectable buyer and seller reporting IDs</dfn> :: Null or a [=list=] of [=strings=]. A list of reporting ids which will be sent to `generateBid()`, - in order to get a [=generated bid/selected buyer and seller reporting id=]. Only meaningful in + in order to get a [=generated bid/selected buyer and seller reporting ID=]. Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>allowed reporting origins</dfn> :: Null or a [=list=] of [=origins=]. A list of up to 10 reporting origins that can receive reports @@ -7011,7 +6993,7 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by was specified, it will have exactly that many [=list/items=]) by the time the bid participates in the auction. Must be null if the interest group making this bid has a null [=interest group/ad components=] field. - : <dfn>selected buyer and seller reporting id</dfn> + : <dfn>selected buyer and seller reporting ID</dfn> :: Null or [=string=]. The selected reporting id from the [=interest group ad/selectable buyer and seller reporting IDs=] within the [=generated bid/interest group=]. If present, will be passed alongside with From c453699aa0455a032f30783db5b4798ffdf23689 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Wed, 11 Sep 2024 10:57:07 -0400 Subject: [PATCH 09/27] did a missed todo --- spec.bs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spec.bs b/spec.bs index 414dd494c..11c17519a 100644 --- a/spec.bs +++ b/spec.bs @@ -7071,9 +7071,15 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Set |bidCopy|'s [=generated bid/for k-anon auction=] to false. 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| - 1. // TODO make this sound better - 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true - AND (selected is not in generated bid OR K anon for reporting is true): + 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. + 1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set |selectedReportingId| to it. + 1. Let |igAd| be the [=interest group ad=] from |generatedBid|'s [=generated bid/interest group=]'s + [=interest group/ads=] whose [=interest group ad/render url=] is |generatedBid|'s + [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. + 1. If both of the following return true: + 1. [=query generated bid k-anonymity count=] given |generatedBid| + 1. [=query reporting ID k-anonymity count=] given |generatedBid|'s [=generated bid/interest group=], |igAd|, and the |selectedReportingId| + 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true and (selected is not in generated bid OR K anon for reporting is true): Issue: TODO: change to query k-anonymity cache instead. (<a href="https://github.com/WICG/turtledove/issues/1150">WICG/turtledove#1150</a>) From e003aeca5b444328e3d56f6ed11afca33e5da274 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Wed, 11 Sep 2024 15:32:14 -0400 Subject: [PATCH 10/27] Some feedback changes not all --- spec.bs | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/spec.bs b/spec.bs index 11c17519a..a17595d92 100644 --- a/spec.bs +++ b/spec.bs @@ -197,7 +197,7 @@ dictionary AuctionAd { USVString buyerReportingId; USVString buyerAndSellerReportingId; - USVString selectableBuyerAndSellerReportingIds; + sequence<USVString> selectableBuyerAndSellerReportingIds; sequence<USVString> allowedReportingOrigins; DOMString adRenderId; }; @@ -1900,8 +1900,6 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: Note: passing 1 for multiBidLimit limits the rerun to producing at most a single bid. - 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to |ig|'s [=interest group/ads=]. - 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to |ig|'s [=interest group/ad components=]. 1. Let |generateBidDuration| be the [=duration from=] |generateBidStartTime| to |settings|'s [=environment settings object/current monotonic time=], in milliseconds. 1. If |perBuyerCumulativeTimeout| is not null, then decrement |perBuyerCumulativeTimeout| @@ -2737,8 +2735,9 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=] and [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: + 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: + 1. If [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], @@ -2747,9 +2746,9 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] - does not [=map/exist=] and the result of [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and null is true: + 1. Otherwise: + 1. If result of [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and null is true: 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. @@ -3837,22 +3836,22 @@ from querying the server during an auction. To <dfn>create a k-anon restricted deep copy of the interest group</dfn> given a [=interest group=] |ig|: 1. Let |kAnonRestrictedIG| be a deep copy of |ig| 1. If |ig|'s [=interest group/ads=] is not null: - 1. Let |kAnonRestrictedIG|'s [=interest group/ads=] be an be an empty [=list=] of [=interest group ad=] + 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: - 1. Compute the |adHashCode| by getting the result of [=compute the key hash of ad=] given |ig| and |igAd|. + 1. Let |adHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAd|. 1. If [=query k-anonymity cache=] for |adHashCode| returns true: 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Compute |reportingHashCode| by getting the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to |kAnonRestrictedSelectableReportingIds|. 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. 1. If |ig|'s [=interest group/ad components=] is not null: - 1. Let |kAnonRestrictedIG|'s [=interest group/ad components=] be an be an empty [=list=] of [=interest group ad=]. + 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAdComponent| of |ig|'s [=interest group/ad components=]: - 1. Compute the |adComponentHashCode| by getting the result of [=compute the key hash of ad=] given |ig| and |igAdComponent|. + 1. Let |adComponentHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAdComponent|. 1. If [=query k-anonymity cache=] for |adComponentHashCode| returns true: 1. [=list/Append=] |igAdComponent| to |kAnonRestrictedIG|'s [=interest group/ad components=]. 1. return |kAnonRestrictedIG|. @@ -3871,12 +3870,15 @@ from querying the server during an auction. 1. If |reportingId| is null: 1. Return the [=string/concatenation=] of the following: 1. U+000A (LF) - 1. "\00\00\00\00\00" + 1. U+0000 (NUL) + 1. U+0000 (NUL) + 1. U+0000 (NUL) + 1. U+0000 (NUL) 1. Otherwise: 1. Return the [=string/concatenation=] of the following: - 1.1. U+000A (LF) + 1. U+000A (LF) 1. "\01" - 1. The size of |reportingId| in bytes + 1. The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. 1. |reportingId| </div> From ce65e8ab14b09d67d9ea7cc72626ace3391a6f80 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 12 Sep 2024 10:35:10 -0400 Subject: [PATCH 11/27] some more feedback changes --- spec.bs | 76 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/spec.bs b/spec.bs index a17595d92..2dae4fe99 100644 --- a/spec.bs +++ b/spec.bs @@ -2658,20 +2658,21 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. + 1. Let |isKAnonForReporting| be a [=boolean=]. 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] - [=map/exists=] and the result of [=query reporting ID k-anonymity count=] - given |winner|'s [=generated bid/interest group=], |igAd|, and the - |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: - 1. Set |selectedReportingId| to the |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - |selectedReportingId|. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] - [=map/exists=] and the result of [=query reporting ID k-anonymity count=] - given |winner|'s [=generated bid/interest group=], |igAd|, and |selectedReportingId| is true, then [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to |igAd|'s - [=interest group ad/buyer and seller reporting ID=]. + [=map/exists=], then set |isKAnonForReporting| to the result of + [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and + |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. Otherwise, set |isKAnonForReporting| to the result of + [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and + null. + 1. If |isKAnonForReporting| is true: + 1. [=map/set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] + to |igAd|'s [=interest group ad/buyer and seller reporting ID=]. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]. 1. Let |sellerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -3865,23 +3866,6 @@ from querying the server during an auction. 1. Return true if it is above the threshold, otherwise return false. </div> -<div algorithm> - To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: - 1. If |reportingId| is null: - 1. Return the [=string/concatenation=] of the following: - 1. U+000A (LF) - 1. U+0000 (NUL) - 1. U+0000 (NUL) - 1. U+0000 (NUL) - 1. U+0000 (NUL) - 1. Otherwise: - 1. Return the [=string/concatenation=] of the following: - 1. U+000A (LF) - 1. "\01" - 1. The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. - 1. |reportingId| -</div> - <div algorithm> To <dfn>query k-anonymity cache</dfn> given a [=SHA-256=] |hashCode|: 1. If the [=user agent=]'s [=k-anonymity cache=] does not [=map/contain=] |hashCode|, then return false. @@ -3900,6 +3884,21 @@ from querying the server during an auction. 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> +<div algorithm> + To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: + 1. If |reportingId| is null: + 1. Return the [=string/concatenation=] of the following: + 1. U+0000 (NUL) + 1. U+0000 (NUL) + 1. U+0000 (NUL) + 1. U+0000 (NUL) + 1. Otherwise: + 1. Return the [=string/concatenation=] of the following: + 1. U+0001 (SOH) + 1. The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. + 1. |reportingId| +</div> + <div algorithm> To <dfn>compute the key hash of reporting ID</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: @@ -3946,9 +3945,6 @@ from querying the server during an auction. <div algorithm> To <dfn>query generated bid k-anonymity count</dfn> given a [=generated bid=] |bid|: - 1. Let |selectedReportingId| be a [=string=]-or-null set to null - 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set - |selectedReportingId| to |bid|'s [=generated bid/selected buyer and seller reporting ID=]. 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=], |bid|'s [=generated bid/ad descriptor=]. 1. If [=query k-anonymity cache=] for |adHashCode| returns false, return false. @@ -3958,12 +3954,16 @@ from querying the server during an auction. 1. Compute the |componentAdHashCode| by getting the result of [=compute the key hash of component ad=] with |adComponentDescriptor|'s [=ad descriptor/url=]. 1. If [=query k-anonymity cache=] for |componentAdHashCode| returns false, return false. + 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: + 1. Let |reportingHashCode| be the result of [=compute the key hash of reporting ID=] with the |bid|'s [=generated bid/interest group=], + the |bid|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns false, return false. 1. Return true. </div> <div algorithm> To <dfn>query reporting ID k-anonymity count</dfn> given an [=interest group=] - |ig|, a [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: + |ig|, an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: 1. Let |keyHash| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectedReportingId|. 1. Return the result of [=query k-anonymity count|querying the k-anonymity count=] given |keyHash|. </div> @@ -3979,17 +3979,17 @@ from querying the server during an auction. <div algorithm> To <dfn>update k-anonymity cache for interest group</dfn> given an [=interest group=] |ig|: 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: - 1. Compute the |adHashCode| following [=compute the key hash of ad=] for |ig| and |igAd|. + 1. Let |adHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAd|. 1. Run [=update k-anonymity cache for key=] on |adHashCode|. 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Compute |adReportingHashCode| by getting the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. Otherwise: - 1. Compute the |adReportingHashCode| following [=compute the key hash of reporting ID=]. + 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and null. 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. [=list/For each=] |componentAd| of |ig|'s [=interest group/ad components=]: - 1. Compute the |componentAdHashCode| following [=compute the key hash of component ad=] for |componentAd|. + 1. Let |componentAdHashCode| be the result of [=compute the key hash of component ad=] given |componentAd|. 1. Run [=update k-anonymity cache for key=] on |componentAdHashCode|. </div> From 6fa419a81bbc25c28fc9113620cd55bd892f45e3 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 12 Sep 2024 10:45:10 -0400 Subject: [PATCH 12/27] some more feedback changes --- spec.bs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spec.bs b/spec.bs index 2dae4fe99..c3fd46006 100644 --- a/spec.bs +++ b/spec.bs @@ -3834,7 +3834,7 @@ This allows the browser to rerun portions of an auction without incurring the de from querying the server during an auction. <div algorithm> - To <dfn>create a k-anon restricted deep copy of the interest group</dfn> given a [=interest group=] |ig|: + To <dfn>create a k-anon restricted deep copy of the interest group</dfn> given an [=interest group=] |ig|: 1. Let |kAnonRestrictedIG| be a deep copy of |ig| 1. If |ig|'s [=interest group/ads=] is not null: 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to an empty [=list=] of [=interest group ad=]. @@ -3981,13 +3981,12 @@ from querying the server during an auction. 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: 1. Let |adHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAd|. 1. Run [=update k-anonymity cache for key=] on |adHashCode|. + 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and null. + 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. Set |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. - 1. Otherwise: - 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and null. - 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. [=list/For each=] |componentAd| of |ig|'s [=interest group/ad components=]: 1. Let |componentAdHashCode| be the result of [=compute the key hash of component ad=] given |componentAd|. 1. Run [=update k-anonymity cache for key=] on |componentAdHashCode|. From 83e4c4113b290c7d45d703a28709ca2d90089829 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 12 Sep 2024 10:58:14 -0400 Subject: [PATCH 13/27] Rest of feedback changes from Orr. --- spec.bs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/spec.bs b/spec.bs index c3fd46006..908f00102 100644 --- a/spec.bs +++ b/spec.bs @@ -2747,14 +2747,16 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise: - 1. If result of [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and null is true: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + 1. Otherwise if the result of [=query reporting ID k-anonymity count=] given + |winner|'s [=generated bid/interest group=], |igAd|, and null is true: + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] - to |winner|'s [=generated bid/interest group=] [=interest group/name=]. + 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to + |igAd|'s [=interest group ad/buyer reporting ID=]. + 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] + to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Let |buyerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=] and |settings|. 1. Let |buyerReportingScript| be the result of [=waiting for script body from a fetcher=] given From ff2021a3e05aee18b953f32da7cb888f33f08c20 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 12 Sep 2024 14:40:12 -0400 Subject: [PATCH 14/27] more feecdback changes --- spec.bs | 44 ++++++++++++++------------------------------ 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/spec.bs b/spec.bs index 908f00102..f2103ad92 100644 --- a/spec.bs +++ b/spec.bs @@ -2739,11 +2739,6 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: 1. If [=query reporting ID k-anonymity count=] given |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: - 1. [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}}"] to - |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerAndSellerReportingId}}"] to - |igAd|'s [=interest group ad/buyer reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. @@ -5882,8 +5877,6 @@ dictionary ReportWinBrowserSignals : ReportingBrowserSignals { boolean madeHighestScoringOtherBid; DOMString interestGroupName; DOMString buyerReportingId; - DOMString buyerAndSellerReportingId; - DOMString selectedBuyerAndSellerReportingId; unsigned short modelingSignals; unsigned long dataVersion; KAnonStatus kAnonStatus; @@ -5900,21 +5893,11 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dt>{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} <dd>True if the interest group owner was the only bidder that made bids with the second highest score - <dt>{{ReportWinBrowserSignals/selectedBuyerAndSellerReportingId}} - <dd>Set if the winning bid had a [=generated bid/selected buyer and seller reporting ID=] and that value was - [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/buyer and seller reporting ID=], - [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, and [=ad creative=] URL. - <dt>{{ReportWinBrowserSignals/buyerAndSellerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, and the winning bid had a - [=generated bid/selected buyer and seller reporting ID=], and that value was - [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/buyer reporting ID=], interest group owner, bidding script URL, [=ad creative=] URL, and - [=generated bid/selected buyer and seller reporting ID=] if it [=map/exists=], otherwise null. <dt>{{ReportWinBrowserSignals/buyerReportingId}} <dd>There are two scenerios in which this can be set: * Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a [=interest group ad/buyer and seller reporting ID=] set in its listing in the interest group, + and the winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, [=ad creative=] URL, and null. * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the winning ad had a @@ -6109,8 +6092,8 @@ An <dfn>interest group ad</dfn> is a [=struct=] with the following [=struct/item [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>selectable buyer and seller reporting IDs</dfn> :: Null or a [=list=] of [=strings=]. A list of reporting ids which will be sent to `generateBid()`, - in order to get a [=generated bid/selected buyer and seller reporting ID=]. Only meaningful in - [=interest group/ads=], but ignored in [=interest group/ad components=]. + in order to allow `generateBid()` to return a [=generated bid/selected buyer and seller reporting ID=]. + Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>allowed reporting origins</dfn> :: Null or a [=list=] of [=origins=]. A list of up to 10 reporting origins that can receive reports with registered macros. Each origin's [=origin/scheme=] must be "`https`" and each origin must be @@ -6999,11 +6982,14 @@ result of [=evaluating a bidding script=], or an [=additional bid=] provided by : <dfn>selected buyer and seller reporting ID</dfn> :: Null or [=string=]. The selected reporting id from the [=interest group ad/selectable buyer and seller reporting IDs=] within the - [=generated bid/interest group=]. If present, will be passed alongside with - [=interest group ad/buyer reporting ID=], and - [=interest group ad/buyer and seller reporting ID=] to [=report win=] and with only the - [=interest group ad/buyer and seller reporting ID=] to [=report result=], subject to - [=k-anonymity=] checks. + [=generated bid/interest group=]. If present, this will be: + * Passed alongside [=interest group ad/buyer reporting ID=] and + [=interest group ad/buyer and seller reporting ID=] to [=report win=] + subject to [=k-anonymity=] checks. + * Passed alongside [=interest group ad/buyer and seller reporting ID=] + to [=report result=] subject to [=k-anonymity=] checks. + * Passed alongside [=interest group ad/buyer and seller reporting ID=] + to `scoreAd()`. : <dfn>ad cost</dfn> :: Null or a {{double}}. Advertiser click or conversion cost passed from `generateBid()` to `reportWin()`. Negative values will be ignored and not passed. Will be @@ -7079,11 +7065,9 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Let |igAd| be the [=interest group ad=] from |generatedBid|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If both of the following return true: - 1. [=query generated bid k-anonymity count=] given |generatedBid| - 1. [=query reporting ID k-anonymity count=] given |generatedBid|'s [=generated bid/interest group=], |igAd|, and the |selectedReportingId| - 1. If [=query generated bid k-anonymity count=] given |generatedBid| returns true and (selected is not in generated bid OR K anon for reporting is true): - + 1. Let |isBidKAnon| be the result of [=query generated bid k-anonymity count=] given |generatedBid|. + 1. If |isBidKAnon| is true and [=query reporting ID k-anonymity count=] given |generatedBid|'s [=generated bid/interest group=], |igAd|, + |selectedReportingId| is true: Issue: TODO: change to query k-anonymity cache instead. (<a href="https://github.com/WICG/turtledove/issues/1150">WICG/turtledove#1150</a>) 1. [=list/Append=] |generatedBid| to |bidsToScore|. From 3a1e6c6ae1b0f46e75a97e69375bd4b5289a7d02 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 17 Sep 2024 10:47:22 -0400 Subject: [PATCH 15/27] Feedback from Qingxin and clarity changes --- spec.bs | 111 +++++++++++++++++++++++++++----------------------------- 1 file changed, 53 insertions(+), 58 deletions(-) diff --git a/spec.bs b/spec.bs index 892632cc9..909b89a95 100644 --- a/spec.bs +++ b/spec.bs @@ -1881,6 +1881,7 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: 1. If |generatedBid|'s [=generated bid/for k-anon auction=] is true, set |foundKAnonBids| to true. 1. If |bidsToScore| [=list/is not empty=] but |foundKAnonBids| is false: + Note: [=generate potentially multiple bids=] is now rerun with only k-anonymous [=interest group/ads=] to give the buyer a chance to [=generate potentially multiple bids=] for k-anonymous [=interest group/ads=]. Allowing the buyer to first [=generate potentially multiple bids=] for non-k-anonymous [=interest group/ads=] provides a @@ -2001,8 +2002,8 @@ To <dfn>convert to an AuctionAd sequence</dfn> given a [=list=]-or-null |ads|: 1. Let |adIDL| be a new {{AuctionAd}}. 1. [=map/Set=] |adIDL|["{{AuctionAd/renderURL}}"] to the [=URL serializer|serialization=] of |ad|'s [=interest group ad/render url=]. - 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: - 1.[=map/set=] |adIDL|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] to + 1. If |ad|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: + 1.[=map/Set=] |adIDL|["{{AuctionAd/selectableBuyerAndSellerReportingIds}}"] to |ad|'s [=interest group ad/selectable buyer and seller reporting IDs=]. 1. If |ad|'s [=interest group ad/buyer and seller reporting id=] is not null then [=map/set=] |adIDL|["{{AuctionAd/buyerAndSellerReportingId}}"] to @@ -2658,21 +2659,18 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. Let |isKAnonForReporting| be a [=boolean=]. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] - [=map/exists=], then set |isKAnonForReporting| to the result of - [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and - |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. Otherwise, set |isKAnonForReporting| to the result of - [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and - null. - 1. If |isKAnonForReporting| is true: - 1. [=map/set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null and the + result of running [=query reporting ID k-anonymity count=] with |winner|'s + [=generated bid/interest group=], |igAd|, and |winner|'s + [=generated bid/selected buyer and seller reporting ID=] is true: + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] - to |igAd|'s [=interest group ad/buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=],[=map/Set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s + [=generated bid/interest group=], |igAd|, and null is true: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=],[=map/Set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]. 1. Let |sellerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -2736,22 +2734,17 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: - 1. If [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to - |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise if the result of [=query reporting ID k-anonymity count=] given - |winner|'s [=generated bid/interest group=], |igAd|, and null is true: + 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to it. + 1. Otherwise if the result of running [=query reporting ID k-anonymity count=] with + |winner|'s [=generated bid/interest group=], |igAd|, and null is true: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] does not [=map/exist=]: + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to - |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] - to |winner|'s [=generated bid/interest group=] [=interest group/name=]. + 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] + to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Let |buyerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=] and |settings|. 1. Let |buyerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -4055,58 +4048,58 @@ from querying the server during an auction. To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: 1. If |reportingId| is null: 1. Return the [=string/concatenation=] of the following: - 1. U+0000 (NUL) - 1. U+0000 (NUL) - 1. U+0000 (NUL) - 1. U+0000 (NUL) + * U+0000 (NUL) + * U+0000 (NUL) + * U+0000 (NUL) + * U+0000 (NUL) 1. Otherwise: 1. Return the [=string/concatenation=] of the following: - 1. U+0001 (SOH) - 1. The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. - 1. |reportingId| + * U+0001 (SOH) + * The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. + * |reportingId| </div> <div algorithm> To <dfn>compute the key hash of reporting ID</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: 1. Let |middle| be the [=string/concatenation=] of the following strings separated with U+000A (LF): - 1. the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] - 1. the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] - 1. the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] + * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] + * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] + * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] 1. Let |keyString| be an empty [=string=]. 1. If |selectedReportingId| is not null: 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - 1. "SelectedBuyerAndSellerReportId" - 1. |middle| - 1. The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| - 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + * "SelectedBuyerAndSellerReportId" + * |middle| + * The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| + * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s [=interest group ad/buyer and seller reporting ID=] - 1. The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s [=interest group ad/buyer reporting ID=] 1. Otherwise: 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - 1. "BuyerAndSellerReportId" - 1. |middle| - 1. |igAd|'s [=interest group ad/buyer and seller reporting ID=] + * "BuyerAndSellerReportId" + * |middle| + * |igAd|'s [=interest group ad/buyer and seller reporting ID=] 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=]: 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - 1. "BuyerReportId" - 1. |middle| - 1. |igAd|'s [=interest group ad/buyer reporting ID=] + * "BuyerReportId" + * |middle| + * |igAd|'s [=interest group ad/buyer reporting ID=] 1. Otherwise: 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - 1. "IgName" - 1. |middle| - 1. |igAd|'s [=interest group/name=] + * "IgName" + * |middle| + * |igAd|'s [=interest group/name=] 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> <div algorithm> To <dfn>compute the key hash of component ad</dfn> given an [=interest group ad=] |igAd|: 1. Let |keyString| be the [=string/concatenation=] of the following strings separated with U+000A LF: - 1. "ComponentBid" - 1. the [=URL serializer|serialization=] of |igAd|. + * "ComponentBid" + * the [=URL serializer|serialization=] of |igAd|. 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> @@ -7231,13 +7224,15 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. - 1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set |selectedReportingId| to it. + 1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set + |selectedReportingId| to it. 1. Let |igAd| be the [=interest group ad=] from |generatedBid|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |generatedBid|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. Let |isBidKAnon| be the result of [=query generated bid k-anonymity count=] given |generatedBid|. - 1. If |isBidKAnon| is true and [=query reporting ID k-anonymity count=] given |generatedBid|'s [=generated bid/interest group=], |igAd|, - |selectedReportingId| is true: + 1. If |isBidKAnon| is true and running [=query reporting ID k-anonymity count=] with |generatedBid|'s + [=generated bid/interest group=], |igAd|, |selectedReportingId| is true: + Issue: TODO: change to query k-anonymity cache instead. (<a href="https://github.com/WICG/turtledove/issues/1150">WICG/turtledove#1150</a>) 1. [=list/Append=] |generatedBid| to |bidsToScore|. From 35978b1c558dc4fbb6762eba62746edd49402f0a Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 17 Sep 2024 10:53:19 -0400 Subject: [PATCH 16/27] fixed some lines that were very over 100 characters --- spec.bs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/spec.bs b/spec.bs index 909b89a95..d296ea87d 100644 --- a/spec.bs +++ b/spec.bs @@ -4003,16 +4003,21 @@ from querying the server during an auction. 1. If [=query k-anonymity cache=] for |adHashCode| returns true: 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. - 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. + 1. [=list/For each=] |selectableReportingId| in |igAd|'s + [=interest group ad/selectable buyer and seller reporting IDs=]: + 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] + given |ig|, |igAd|, and |selectableReportingId|. 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. - 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to |kAnonRestrictedSelectableReportingIds|. + 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to + |kAnonRestrictedSelectableReportingIds|. 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. 1. If |ig|'s [=interest group/ad components=] is not null: - 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to an empty [=list=] of [=interest group ad=]. + 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to an empty [=list=] of + [=interest group ad=]. 1. [=list/For each=] |igAdComponent| of |ig|'s [=interest group/ad components=]: - 1. Let |adComponentHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAdComponent|. + 1. Let |adComponentHashCode| be the result of [=compute the key hash of ad=] given |ig| and + |igAdComponent|. 1. If [=query k-anonymity cache=] for |adComponentHashCode| returns true: 1. [=list/Append=] |igAdComponent| to |kAnonRestrictedIG|'s [=interest group/ad components=]. 1. return |kAnonRestrictedIG|. @@ -4036,7 +4041,8 @@ from querying the server during an auction. <div algorithm> To <dfn>compute the key hash of ad</dfn> given an [=interest group=] |ig| and an [=interest group ad=] |igAd|: - 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the following strings separated with U+000A LF: + 1. Let |keyString| be the [=k-anonymity key=] formed from the [=string/concatenation=] of the + following strings separated with U+000A LF: * "AdBid" * the [=serialization of an origin|serialization=] of |ig|'s [=interest group/owner=] * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] @@ -6063,11 +6069,11 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " and the winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, [=ad creative=] URL, and null. - * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the winning ad had a - [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was - [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with - [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding - script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting ID=],. + * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the + winning ad had a [=interest group ad/buyer reporting ID=] set in its listing in the + interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] + combined with [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding + script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting ID=]. <dt>{{ReportWinBrowserSignals/interestGroupName}} <dd>Only set if the tuple of interest group owner, name, bidding script URL, [=ad creative=] URL, and null From cca891940ee4c618aa074ef566f1d036803b5ed0 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 17 Sep 2024 13:44:22 -0400 Subject: [PATCH 17/27] more feedback changes --- spec.bs | 73 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/spec.bs b/spec.bs index d296ea87d..e9d6b3ce6 100644 --- a/spec.bs +++ b/spec.bs @@ -4052,14 +4052,12 @@ from querying the server during an auction. <div algorithm> To <dfn>compute the key part for one of multiple reporting ids</dfn> given [=string=]-or-null |reportingId|: - 1. If |reportingId| is null: - 1. Return the [=string/concatenation=] of the following: - * U+0000 (NUL) - * U+0000 (NUL) - * U+0000 (NUL) - * U+0000 (NUL) - 1. Otherwise: - 1. Return the [=string/concatenation=] of the following: + 1. If |reportingId| is null, then return the [=string/concatenation=] of the following: + * U+0000 (NUL) + * U+0000 (NUL) + * U+0000 (NUL) + * U+0000 (NUL) + 1. Otherwise, return the [=string/concatenation=] of the following: * U+0001 (SOH) * The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. * |reportingId| @@ -4073,31 +4071,31 @@ from querying the server during an auction. * the [=URL serializer|serialization=] of |ig|'s [=interest group/bidding url=] * the [=URL serializer|serialization=] of |igAd|'s [=interest group ad/render url=] 1. Let |keyString| be an empty [=string=]. - 1. If |selectedReportingId| is not null: - 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - * "SelectedBuyerAndSellerReportId" - * |middle| - * The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| - * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s - [=interest group ad/buyer and seller reporting ID=] - * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s - [=interest group ad/buyer reporting ID=] + 1. If |selectedReportingId| is not null, then set the |keyString| to be the [=string/concatenation=] + of the following strings separated with U+000A (LF): + * "SelectedBuyerAndSellerReportId" + * |middle| + * The result of [=compute the key part for one of multiple reporting ids=] given |selectedReportingId| + * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer and seller reporting ID=] + * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s + [=interest group ad/buyer reporting ID=] 1. Otherwise: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=]: - 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - * "BuyerAndSellerReportId" - * |middle| - * |igAd|'s [=interest group ad/buyer and seller reporting ID=] - 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=]: - 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - * "BuyerReportId" - * |middle| - * |igAd|'s [=interest group ad/buyer reporting ID=] - 1. Otherwise: - 1. Set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): - * "IgName" - * |middle| - * |igAd|'s [=interest group/name=] + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], set |keyString| + to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + * "BuyerAndSellerReportId" + * |middle| + * |igAd|'s [=interest group ad/buyer and seller reporting ID=] + 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], set |keyString| + to be the [=string/concatenation=] of the following strings separated with U+000A (LF): + * "BuyerReportId" + * |middle| + * |igAd|'s [=interest group ad/buyer reporting ID=] + 1. Otherwise set |keyString| to be the [=string/concatenation=] of the following strings separated + with U+000A (LF): + * "NameReport" + * |middle| + * |igAd|'s [=interest group/name=] 1. Return the [=SHA-256=] hash of the [=ASCII encoding=] of |keyString|. </div> @@ -6076,11 +6074,12 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting ID=]. <dt>{{ReportWinBrowserSignals/interestGroupName}} - <dd>Only set if the tuple of interest group owner, name, bidding script URL, [=ad creative=] URL, and null - were [=query reporting ID k-anonymity count|jointly k-anonymous=], and the - winning ad had neither [=interest group ad/buyer and seller reporting ID=] - nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group, - and the winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set. + <dd>Only set if all of the following are true: + * The combination of the interest group owner, name, bidding script URL, [=ad creative=] URL, + and null are [=query reporting ID k-anonymity count|jointly k-anonymous=] + * The winning ad had neither [=interest group ad/buyer and seller reporting ID=] + nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group. + * The winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>A 0-4095 integer (12-bits) passed to `reportWin()`, with noising <dt>{{ReportWinBrowserSignals/dataVersion}} From 2445071481c39ab809f5125bacc15de3285db32b Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Fri, 20 Sep 2024 10:17:23 -0400 Subject: [PATCH 18/27] feedback changes --- spec.bs | 65 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/spec.bs b/spec.bs index e9d6b3ce6..fd02582c4 100644 --- a/spec.bs +++ b/spec.bs @@ -1888,7 +1888,8 @@ and a [=real time reporting contributions map=] |realTimeContributionsMap|: mechanism to bootstrap the k-anonymity count, otherwise no [=interest group/ads=] would ever trigger [=increment k-anonymity count=] and all ads would fail [=query k-anonymity count=]. - 1. Let |kAnonRestrictedIG| be the result of [=create a k-anon restricted deep copy of the interest group=] given |ig|. + 1. Let |kAnonRestrictedIG| be the result of running [=create a k-anon restricted deep copy of the interest group=] + given |ig|. 1. If |perBuyerCumulativeTimeout| is not null and is &lt; |perBuyerTimeout|, then set |perBuyerTimeout| to |perBuyerCumulativeTimeout|. 1. Let |generateBidStartTime| be |settings|'s @@ -2665,11 +2666,11 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a [=generated bid/selected buyer and seller reporting ID=] is true: 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=],[=map/Set=] + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=],[=map/Set=] + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]. @@ -2735,12 +2736,12 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to it. 1. Otherwise if the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] does not [=map/exist=]: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is null: + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] @@ -3999,28 +4000,28 @@ from querying the server during an auction. 1. If |ig|'s [=interest group/ads=] is not null: 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: - 1. Let |adHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAd|. + 1. Let |adHashCode| be the result of running [=compute the key hash of ad=] given |ig| and |igAd|. 1. If [=query k-anonymity cache=] for |adHashCode| returns true: 1. If |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] is not null: - 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. - 1. [=list/For each=] |selectableReportingId| in |igAd|'s - [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] - given |ig|, |igAd|, and |selectableReportingId|. - 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: - 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. - 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to - |kAnonRestrictedSelectableReportingIds|. - 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. + 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. + 1. [=list/For each=] |selectableReportingId| in |igAd|'s + [=interest group ad/selectable buyer and seller reporting IDs=]: + 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] + given |ig|, |igAd|, and |selectableReportingId|. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: + 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. + 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to + |kAnonRestrictedSelectableReportingIds|. + 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. 1. If |ig|'s [=interest group/ad components=] is not null: 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAdComponent| of |ig|'s [=interest group/ad components=]: - 1. Let |adComponentHashCode| be the result of [=compute the key hash of ad=] given |ig| and + 1. Let |adComponentHashCode| be the result of running [=compute the key hash of ad=] given |ig| and |igAdComponent|. 1. If [=query k-anonymity cache=] for |adComponentHashCode| returns true: 1. [=list/Append=] |igAdComponent| to |kAnonRestrictedIG|'s [=interest group/ad components=]. - 1. return |kAnonRestrictedIG|. + 1. Return |kAnonRestrictedIG|. </div> <div algorithm> @@ -4081,12 +4082,12 @@ from querying the server during an auction. * The result of [=compute the key part for one of multiple reporting ids=] given |igAd|'s [=interest group ad/buyer reporting ID=] 1. Otherwise: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] [=map/exists=], set |keyString| + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): * "BuyerAndSellerReportId" * |middle| * |igAd|'s [=interest group ad/buyer and seller reporting ID=] - 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] [=map/exists=], set |keyString| + 1. Otherwise if |igAd|'s [=interest group ad/buyer reporting ID=] is not null, set |keyString| to be the [=string/concatenation=] of the following strings separated with U+000A (LF): * "BuyerReportId" * |middle| @@ -4118,7 +4119,7 @@ from querying the server during an auction. 1. Compute the |componentAdHashCode| by getting the result of [=compute the key hash of component ad=] with |adComponentDescriptor|'s [=ad descriptor/url=]. 1. If [=query k-anonymity cache=] for |componentAdHashCode| returns false, return false. - 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=]: + 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] is not null: 1. Let |reportingHashCode| be the result of [=compute the key hash of reporting ID=] with the |bid|'s [=generated bid/interest group=], the |bid|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If [=query k-anonymity cache=] for |reportingHashCode| returns false, return false. @@ -4143,7 +4144,7 @@ from querying the server during an auction. <div algorithm> To <dfn>update k-anonymity cache for interest group</dfn> given an [=interest group=] |ig|: 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: - 1. Let |adHashCode| be the result of [=compute the key hash of ad=] given |ig| and |igAd|. + 1. Let |adHashCode| be the result of running [=compute the key hash of ad=] given |ig| and |igAd|. 1. Run [=update k-anonymity cache for key=] on |adHashCode|. 1. Let |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and null. 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. @@ -4152,7 +4153,7 @@ from querying the server during an auction. 1. Set |adReportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. 1. Run [=update k-anonymity cache for key=] on |adReportingHashCode|. 1. [=list/For each=] |componentAd| of |ig|'s [=interest group/ad components=]: - 1. Let |componentAdHashCode| be the result of [=compute the key hash of component ad=] given |componentAd|. + 1. Let |componentAdHashCode| be the result of running [=compute the key hash of component ad=] given |componentAd|. 1. Run [=update k-anonymity cache for key=] on |componentAdHashCode|. </div> @@ -4772,7 +4773,7 @@ To <dfn>convert GenerateBidOutput to generated bid</dfn> given a {{GenerateBidOu 1. If |bidAd| is null, return failure. 1. Set |bid|'s [=generated bid/ad descriptor=] to |adDescriptor|. 1. Set |bid|'s [=generated bid/bid ad=] to |bidAd|. - 1. If |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"] is specified: + 1. If |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"] [=map/exists=]: 1. Set |bid|'s [=generated bid/selected buyer and seller reporting ID=] to |generateBidOutput|["{{GenerateBidOutput/selectedBuyerAndSellerReportingId}}"]. 1. If |generateBidOutput|["{{GenerateBidOutput/adComponents}}"] [=map/exists=]: @@ -6004,7 +6005,7 @@ dictionary ReportingBrowserSignals { listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, bidding script URL, [=ad creative=] URL, and - [=generated bid/selected buyer and seller reporting ID=] if it [=map/exists=], otherwise null. + [=generated bid/selected buyer and seller reporting ID=]. <dt>{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} <dd>A selected reporting id returned by "`generateBid()`". Set if the winning bid had a [=generated bid/selected buyer and seller reporting ID=] set, @@ -6075,11 +6076,11 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dt>{{ReportWinBrowserSignals/interestGroupName}} <dd>Only set if all of the following are true: - * The combination of the interest group owner, name, bidding script URL, [=ad creative=] URL, - and null are [=query reporting ID k-anonymity count|jointly k-anonymous=] - * The winning ad had neither [=interest group ad/buyer and seller reporting ID=] - nor [=interest group ad/buyer reporting ID=] set in its listing in the interest group. - * The winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set. + * The combination of the [=interest group/owner=], [=interest group/name=], [=interest group/bidding url=], + [=ad creative=] URL, and null are [=query reporting ID k-anonymity count|jointly k-anonymous=]. + * The winning ad's [=interest group ad/buyer and seller reporting ID=] and + [=interest group ad/buyer reporting ID=] are null. + * The winning bid's [=generated bid/selected buyer and seller reporting ID=] is null. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>A 0-4095 integer (12-bits) passed to `reportWin()`, with noising <dt>{{ReportWinBrowserSignals/dataVersion}} @@ -7229,7 +7230,7 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. [=Apply any component ads target to a bid=] given |bidCopy|. 1. [=list/Append=] |bidCopy| to |bidsToScore| 1. Let |selectedReportingId| be a [=string=]-or-null that is set to null. - 1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] [=map/exists=], set + 1. If |generatedBid|'s [=generated bid/selected buyer and seller reporting ID=] is not null, set |selectedReportingId| to it. 1. Let |igAd| be the [=interest group ad=] from |generatedBid|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |generatedBid|'s From 91286ba636aabc743531008c3db235ca8617f196 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 23 Sep 2024 11:25:56 -0400 Subject: [PATCH 19/27] nit feedback changes --- spec.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.bs b/spec.bs index fd02582c4..db1c4c342 100644 --- a/spec.bs +++ b/spec.bs @@ -2744,7 +2744,7 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise, [=map/Set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] + 1. Otherwise, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Let |buyerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=] and |settings|. @@ -3996,7 +3996,7 @@ from querying the server during an auction. <div algorithm> To <dfn>create a k-anon restricted deep copy of the interest group</dfn> given an [=interest group=] |ig|: - 1. Let |kAnonRestrictedIG| be a deep copy of |ig| + 1. Let |kAnonRestrictedIG| be a deep copy of |ig|. 1. If |ig|'s [=interest group/ads=] is not null: 1. Set |kAnonRestrictedIG|'s [=interest group/ads=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAd| of |ig|'s [=interest group/ads=]: @@ -4008,8 +4008,8 @@ from querying the server during an auction. [=interest group ad/selectable buyer and seller reporting IDs=]: 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectableReportingId|. - 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: - 1. [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true, then + [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. 1. Set |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=] to |kAnonRestrictedSelectableReportingIds|. 1. [=list/Append=] |igAd| to |kAnonRestrictedIG|'s [=interest group/ads=]. From ece8fe1932e033ced0b520635e4033f8bce8fa20 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 23 Sep 2024 13:41:41 -0400 Subject: [PATCH 20/27] fix k anon cache part --- spec.bs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/spec.bs b/spec.bs index db1c4c342..be3bbd7dc 100644 --- a/spec.bs +++ b/spec.bs @@ -2660,18 +2660,20 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null and the - result of running [=query reporting ID k-anonymity count=] with |winner|'s - [=generated bid/interest group=], |igAd|, and |winner|'s - [=generated bid/selected buyer and seller reporting ID=] is true: - 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] - to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. - 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s - [=generated bid/interest group=], |igAd|, and null is true: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: + 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] with |winner|'s + [=generated bid/interest group=], |igAd|, and |winner|'s + [=generated bid/selected buyer and seller reporting ID=]. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. Otherwise, let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] + with |winner|'s [=generated bid/interest group=], |igAd|, and null. + 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]. 1. Let |sellerReportingScript| be the result of [=waiting for script body from a fetcher=] given From c720387c526626a305461564aa29ba9218f1594f Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Mon, 23 Sep 2024 15:15:34 -0400 Subject: [PATCH 21/27] redid k anon stuff --- spec.bs | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/spec.bs b/spec.bs index be3bbd7dc..8cf749b0e 100644 --- a/spec.bs +++ b/spec.bs @@ -2660,20 +2660,18 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] with |winner|'s - [=generated bid/interest group=], |igAd|, and |winner|'s - [=generated bid/selected buyer and seller reporting ID=]. - 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: - 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] - to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. - 1. Otherwise, let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] - with |winner|'s [=generated bid/interest group=], |igAd|, and null. - 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null and the + result of running [=query reporting ID k-anonymity count=] with |winner|'s + [=generated bid/interest group=], |igAd|, and |winner|'s + [=generated bid/selected buyer and seller reporting ID=] is true: + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s + [=generated bid/interest group=], |igAd|, and null is true: + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Let |sellerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |config|'s [=auction config/decision logic url=] and |global|'s [=relevant settings object=]. 1. Let |sellerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -4132,7 +4130,7 @@ from querying the server during an auction. To <dfn>query reporting ID k-anonymity count</dfn> given an [=interest group=] |ig|, an [=interest group ad=] |igAd|, and a [=string=]-or-null |selectedReportingId|: 1. Let |keyHash| be the result of [=computing the key hash of reporting ID=] given |ig|, |igAd|, and |selectedReportingId|. - 1. Return the result of [=query k-anonymity count|querying the k-anonymity count=] given |keyHash|. + 1. Return the result of [=query k-anonymity cache=] given |keyHash|. </div> <div algorithm> @@ -7240,9 +7238,6 @@ To <dfn>adjust bid list based on k-anonymity</dfn> given a [=list=] of [=generat 1. Let |isBidKAnon| be the result of [=query generated bid k-anonymity count=] given |generatedBid|. 1. If |isBidKAnon| is true and running [=query reporting ID k-anonymity count=] with |generatedBid|'s [=generated bid/interest group=], |igAd|, |selectedReportingId| is true: - - Issue: TODO: change to query k-anonymity cache instead. - (<a href="https://github.com/WICG/turtledove/issues/1150">WICG/turtledove#1150</a>) 1. [=list/Append=] |generatedBid| to |bidsToScore|. Note: Conceptually, a bid that's already k-anonymous is considered for both the k-anonymous and From cbdafcd73acb8c2bdee0f3ea6f2ef7ab5d314a5c Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 3 Oct 2024 15:11:48 -0400 Subject: [PATCH 22/27] feedback change --- spec.bs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec.bs b/spec.bs index 8cf749b0e..7460e2fab 100644 --- a/spec.bs +++ b/spec.bs @@ -2660,14 +2660,14 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. Let |igAd| be the [=interest group ad=] from |winner|'s [=generated bid/interest group=]'s [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. - 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null and the - result of running [=query reporting ID k-anonymity count=] with |winner|'s + 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: + 1. If the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true: - 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] - to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true: 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] From c6a9d94941bbfb70d1d9871f336cc476dd6005a4 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Thu, 3 Oct 2024 15:13:02 -0400 Subject: [PATCH 23/27] fixed indent --- spec.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index 7460e2fab..c7a9162b1 100644 --- a/spec.bs +++ b/spec.bs @@ -2662,8 +2662,8 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: 1. If the result of running [=query reporting ID k-anonymity count=] with |winner|'s - [=generated bid/interest group=], |igAd|, and |winner|'s - [=generated bid/selected buyer and seller reporting ID=] is true: + [=generated bid/interest group=], |igAd|, and |winner|'s + [=generated bid/selected buyer and seller reporting ID=] is true: 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] From e4b56655af75f039d64e9e2e1e0e35090bbc35d0 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 8 Oct 2024 11:24:05 -0400 Subject: [PATCH 24/27] more feedback changes --- spec.bs | 75 +++++++++++++++++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/spec.bs b/spec.bs index c7a9162b1..b56dcef8b 100644 --- a/spec.bs +++ b/spec.bs @@ -2661,9 +2661,9 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a [=interest group/ads=] whose [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If the |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. If the result of running [=query reporting ID k-anonymity count=] with |winner|'s + 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s - [=generated bid/selected buyer and seller reporting ID=] is true: + [=generated bid/selected buyer and seller reporting ID=] is true. 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] @@ -2736,16 +2736,21 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to it. + 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] is not null. + 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with + |winner|'s [=generated bid/interest group=], |igAd|, and + [=generated bid/selected buyer and seller reporting ID=] is true. + 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null: + 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] is not null. + 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with + |winner|'s [=generated bid/interest group=], |igAd|, and null is true. 1. Otherwise if the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true: - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is null: - 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, - [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to - |igAd|'s [=interest group ad/buyer reporting ID=]. - 1. Otherwise, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] - to |winner|'s [=generated bid/interest group=] [=interest group/name=]. + 1. If |igAd|'s [=interest group ad/buyer reporting ID=] is not null, + [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/buyerReportingId}}"] to + |igAd|'s [=interest group ad/buyer reporting ID=]. + 1. Otherwise, [=map/set=] |reportWinBrowserSignals|["{{ReportWinBrowserSignals/interestGroupName}}"] + to |winner|'s [=generated bid/interest group=] [=interest group/name=]. 1. Let |buyerReportingScriptFetcher| be the result of [=creating a new script fetcher=] with |winner|'s [=generated bid/interest group=]'s [=interest group/bidding url=] and |settings|. 1. Let |buyerReportingScript| be the result of [=waiting for script body from a fetcher=] given @@ -4006,7 +4011,7 @@ from querying the server during an auction. 1. Let |kAnonRestrictedSelectableReportingIds| be a new empty [=list=] of [=string=]s. 1. [=list/For each=] |selectableReportingId| in |igAd|'s [=interest group ad/selectable buyer and seller reporting IDs=]: - 1. Let |reportingHashCode| be the result of [=computing the key hash of reporting ID=] + 1. Let |reportingHashCode| be the result of [=query reporting ID k-anonymity count=] given |ig|, |igAd|, and |selectableReportingId|. 1. If [=query k-anonymity cache=] for |reportingHashCode| returns true, then [=list/Append=] |selectableReportingId| to |kAnonRestrictedSelectableReportingIds|. @@ -4017,7 +4022,7 @@ from querying the server during an auction. 1. Set |kAnonRestrictedIG|'s [=interest group/ad components=] to an empty [=list=] of [=interest group ad=]. 1. [=list/For each=] |igAdComponent| of |ig|'s [=interest group/ad components=]: - 1. Let |adComponentHashCode| be the result of running [=compute the key hash of ad=] given |ig| and + 1. Let |adComponentHashCode| be the result of running [=compute the key hash of component ad=] given |ig| and |igAdComponent|. 1. If [=query k-anonymity cache=] for |adComponentHashCode| returns true: 1. [=list/Append=] |igAdComponent| to |kAnonRestrictedIG|'s [=interest group/ad components=]. @@ -4058,6 +4063,7 @@ from querying the server during an auction. * U+0000 (NUL) * U+0000 (NUL) * U+0000 (NUL) + * U+0000 (NUL) 1. Otherwise, return the [=string/concatenation=] of the following: * U+0001 (SOH) * The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. @@ -4110,8 +4116,8 @@ from querying the server during an auction. <div algorithm> To <dfn>query generated bid k-anonymity count</dfn> given a [=generated bid=] |bid|: - 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=], - |bid|'s [=generated bid/ad descriptor=]. + 1. Compute the |adHashCode| following [=compute the key hash of ad=] with the |bid|'s [=generated bid/interest group=] + and |bid|'s [=generated bid/ad descriptor=]. 1. If [=query k-anonymity cache=] for |adHashCode| returns false, return false. 1. If |bid|'s [=generated bid/ad component descriptors=] is not null: 1. [=set/For each=] |adComponentDescriptor| in |bid|'s @@ -4120,8 +4126,8 @@ from querying the server during an auction. [=ad descriptor/url=]. 1. If [=query k-anonymity cache=] for |componentAdHashCode| returns false, return false. 1. If |bid|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. Let |reportingHashCode| be the result of [=compute the key hash of reporting ID=] with the |bid|'s [=generated bid/interest group=], - the |bid|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. Let |reportingHashCode| be the result of [=query reporting ID k-anonymity count=] with the |bid|'s [=generated bid/interest group=], + the |bid|'s [=generated bid/ad=], and the |bid|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If [=query k-anonymity cache=] for |reportingHashCode| returns false, return false. 1. Return true. </div> @@ -6001,10 +6007,15 @@ dictionary ReportingBrowserSignals { <dt>{{ReportingBrowserSignals/componentSeller}} <dd>Copied from [=leading bid info/component seller=] <dt>{{ReportingBrowserSignals/buyerAndSellerReportingId}} - <dd>Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its - listing in the interest group, and that value was - [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with interest group owner, - bidding script URL, [=ad creative=] URL, and + <dd>There are two scenerios in which this can be set: + * Set if the winning ad had a [=interest group ad/buyer and seller reporting ID=] and + the winning bid did not have [=generated bid/selected buyer and seller reporting ID=] set, + and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] combined with + interest group owner, bidding script URL, [=ad creative=] URL, and null. + * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the + winning ad had a [=interest group ad/buyer and seller reporting ID=] set in its listing in the + interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] + combined with interest group owner, bidding script URL, [=ad creative=] URL, the and winning bid's [=generated bid/selected buyer and seller reporting ID=]. <dt>{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}} <dd>A selected reporting id returned by "`generateBid()`". @@ -6061,6 +6072,13 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " <dt>{{ReportWinBrowserSignals/madeHighestScoringOtherBid}} <dd>True if the interest group owner was the only bidder that made bids with the second highest score + <dt>{{ReportWinBrowserSignals/interestGroupName}} + <dd>Only set if all of the following are true: + * The combination of the [=interest group/owner=], [=interest group/name=], [=interest group/bidding url=], + [=ad creative=] URL, and null are [=query reporting ID k-anonymity count|jointly k-anonymous=]. + * The winning ad's [=interest group ad/buyer and seller reporting ID=] and + [=interest group ad/buyer reporting ID=] are null. + * The winning bid's [=generated bid/selected buyer and seller reporting ID=] is null. <dt>{{ReportWinBrowserSignals/buyerReportingId}} <dd>There are two scenerios in which this can be set: * Set if the winning ad had a [=interest group ad/buyer reporting ID=] but not a @@ -6071,16 +6089,9 @@ enum KAnonStatus { "passedAndEnforced", "passedNotEnforced", "belowThreshold", " * Set if the wining bid had a [=generated bid/selected buyer and seller reporting ID=] and the winning ad had a [=interest group ad/buyer reporting ID=] set in its listing in the interest group, and that value was [=query reporting ID k-anonymity count|jointly k-anonymous=] - combined with [=interest group ad/buyer and seller reporting ID=], interest group owner, bidding - script URL, [=ad creative=] URL, and [=generated bid/selected buyer and seller reporting ID=]. - - <dt>{{ReportWinBrowserSignals/interestGroupName}} - <dd>Only set if all of the following are true: - * The combination of the [=interest group/owner=], [=interest group/name=], [=interest group/bidding url=], - [=ad creative=] URL, and null are [=query reporting ID k-anonymity count|jointly k-anonymous=]. - * The winning ad's [=interest group ad/buyer and seller reporting ID=] and - [=interest group ad/buyer reporting ID=] are null. - * The winning bid's [=generated bid/selected buyer and seller reporting ID=] is null. + combined with interest group owner, bidding script URL, [=ad creative=] URL, + [=interest group ad/buyer and seller reporting ID=], and + [=generated bid/selected buyer and seller reporting ID=]. <dt>{{ReportWinBrowserSignals/modelingSignals}} <dd>A 0-4095 integer (12-bits) passed to `reportWin()`, with noising <dt>{{ReportWinBrowserSignals/dataVersion}} @@ -6257,7 +6268,9 @@ An <dfn>interest group ad</dfn> is a [=struct=] with the following [=struct/item :: Null or a [=string=]. Will be passed in place of interest group name or [=interest group ad/buyer reporting ID=], or alongside the [=generated bid/selected buyer and seller reporting ID=], to [=report win=] and - [=report result=], subject to [=k-anonymity=] checks. Only meaningful in + [=report result=], subject to [=k-anonymity=] checks. Also passed alongside + [=generated bid/selected buyer and seller reporting ID=] to `scoreAd()` if + [=generated bid/selected buyer and seller reporting ID=] is present. Only meaningful in [=interest group/ads=], but ignored in [=interest group/ad components=]. : <dfn>selectable buyer and seller reporting IDs</dfn> :: Null or a [=list=] of [=strings=]. A list of reporting ids which will be sent to `generateBid()`, From 0b51bb80b96b03a43e46eb93f43d800d993be3b0 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Fri, 11 Oct 2024 10:13:31 -0400 Subject: [PATCH 25/27] fixed indentation --- spec.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.bs b/spec.bs index b56dcef8b..d9bb93cde 100644 --- a/spec.bs +++ b/spec.bs @@ -2664,10 +2664,10 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true. - 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] - to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. - 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] - |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. + 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] + |browserSignals|["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] to it. 1. Otherwise, if the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true: 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] From c4fa25a3434e44f9c84e615a1f2f66ed422741ca Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 15 Oct 2024 14:59:48 -0400 Subject: [PATCH 26/27] added notes and some feedback changes --- spec.bs | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/spec.bs b/spec.bs index d9bb93cde..b6179d2ea 100644 --- a/spec.bs +++ b/spec.bs @@ -2664,6 +2664,12 @@ To <dfn>report result</dfn> given a [=leading bid info=] |leadingBidInfo|, a 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and |winner|'s [=generated bid/selected buyer and seller reporting ID=] is true. + + Note: The winning [=interest group ad=] is expected to be k-anonymous for reporting because any + [=generated bid/bid=] that included a [=generated bid/selected buyer and seller reporting ID=] + wouldn't be considered k-anonymous, and thus couldn't win the auction and wouldn't be reported, + unless that bid was k-anonymous for reporting with that [=generated bid/selected buyer and seller reporting ID=]. + 1. [=map/Set=] |browserSignals|["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. If |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null, [=map/set=] @@ -2736,12 +2742,24 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] [=interest group ad/render url=] is |winner|'s [=generated bid/ad descriptor=]'s [=ad descriptor/url=]. 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: - 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] is not null. + + Note: If the winning [=generated bid/bid=] has a [=generated bid/selected buyer and seller reporting ID=], + it would have already been set by the preceding call to `reportResult()`, and provided to this algorithm in the + {{ReportingBrowserSignals}} returned by that algorithm and provided to this one. + + 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] + is equal to |winner|'s [=generated bid/selected buyer and seller reporting ID=]. 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and [=generated bid/selected buyer and seller reporting ID=] is true. 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null: - 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] is not null. + + Note: If the winning [=interest group ad=] has a [=interest group ad/buyer and seller reporting ID=], + it would have already been set by the preceding call to `reportResult()`, and provided to this algorithm in the + {{ReportingBrowserSignals}} returned by that algorithm and provided to this one. + + 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] is equal to + |igAd|'s [=interest group ad/buyer and seller reporting ID=]. 1. [=Assert=] that the result of running [=query reporting ID k-anonymity count=] with |winner|'s [=generated bid/interest group=], |igAd|, and null is true. 1. Otherwise if the result of running [=query reporting ID k-anonymity count=] with @@ -4065,9 +4083,9 @@ from querying the server during an auction. * U+0000 (NUL) * U+0000 (NUL) 1. Otherwise, return the [=string/concatenation=] of the following: - * U+0001 (SOH) - * The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. - * |reportingId| + * U+0001 (SOH) + * The size of |reportingId|, interpreted as four 8-bit big-endian numbers, appended as bytes. + * |reportingId| </div> <div algorithm> From 2ba1c481f1dcad43e2ad546df937a5adf4a9d593 Mon Sep 17 00:00:00 2001 From: Youssef <youbou.dev@gmail.com> Date: Tue, 15 Oct 2024 16:49:21 -0400 Subject: [PATCH 27/27] fixed report result link --- spec.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.bs b/spec.bs index b6179d2ea..5b4fae76c 100644 --- a/spec.bs +++ b/spec.bs @@ -2744,7 +2744,7 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. If |winner|'s [=generated bid/selected buyer and seller reporting ID=] is not null: Note: If the winning [=generated bid/bid=] has a [=generated bid/selected buyer and seller reporting ID=], - it would have already been set by the preceding call to `reportResult()`, and provided to this algorithm in the + it would have already been set by the preceding call to [=report result=], and provided to this algorithm in the {{ReportingBrowserSignals}} returned by that algorithm and provided to this one. 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/selectedBuyerAndSellerReportingId}}"] @@ -2755,7 +2755,7 @@ a {{ReportingBrowserSignals}} |browserSignals|, a [=direct from seller signals=] 1. Otherwise if |igAd|'s [=interest group ad/buyer and seller reporting ID=] is not null: Note: If the winning [=interest group ad=] has a [=interest group ad/buyer and seller reporting ID=], - it would have already been set by the preceding call to `reportResult()`, and provided to this algorithm in the + it would have already been set by the preceding call to [=report result=], and provided to this algorithm in the {{ReportingBrowserSignals}} returned by that algorithm and provided to this one. 1. [=Assert=] that |reportWinBrowserSignals|'s ["{{ReportingBrowserSignals/buyerAndSellerReportingId}}"] is equal to