From e98524bdc168b4d2f4e3c62675da7225164c0dde Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Thu, 9 Jan 2025 16:59:48 -0500 Subject: [PATCH] [spec] Enable per-context contribution limits for Private Aggregation The goal is to enable Shared Storage embedders to override the default number of contributions per Private Aggregation report. To that end, this change adds the `maxContributions` field to the web-visible Private Aggregation config dictionary and plumbs its value into Private Aggregation's "pre-specified report parameters". Context: * Explainer: patcg-individual-drafts/private-aggregation-api#146 * Spec change: patcg-individual-drafts/private-aggregation-api#164 --- spec.bs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec.bs b/spec.bs index 3958e4c..a60c3a3 100644 --- a/spec.bs +++ b/spec.bs @@ -133,6 +133,7 @@ spec: private-aggregation-api; urlPrefix: https://patcg-individual-drafts.github for: pre-specified report parameters text: context ID text: filtering ID max bytes + text: max contributions text: batching scope text: debug scope text: process contributions for a batching scope @@ -579,11 +580,20 @@ Moreover, each {{SharedStorageWorklet}}'s [=global scopes|list of global scopes= 1. If |filteringIdMaxBytes| is not the [=default filtering ID max bytes=] or |contextId| is not null, return a new {{DOMException}} with name "`DataError`". + 1. Let |maxContributions| be null. + 1. If + |privateAggregationConfig|["{{SharedStoragePrivateAggregationConfig/maxContributions}}"] + [=map/exists=], set |maxContributions| to + |privateAggregationConfig|["{{SharedStoragePrivateAggregationConfig/maxContributions}}"]. + 1. If |maxContributions| is zero, return a new {{DOMException}} with name + "`DataError`". 1. Return a new [=pre-specified report parameters=] with the items: : context ID :: |contextId| : [=pre-specified report parameters/filtering ID max bytes=] :: |filteringIdMaxBytes| + : [=pre-specified report parameters/max contributions=] + :: |maxContributions|
@@ -1604,6 +1614,7 @@ On the other hand, methods for getting data from the [=shared storage database=] USVString aggregationCoordinatorOrigin; USVString contextId; [EnforceRange] unsigned long long filteringIdMaxBytes; + [EnforceRange] unsigned long long maxContributions; }; dictionary SharedStorageRunOperationMethodOptions {