From ee9f46dbf635e2f7f492b3535a495d052de5907c Mon Sep 17 00:00:00 2001 From: Dan McArdle Date: Thu, 25 Jul 2024 16:41:57 -0400 Subject: [PATCH] Spec: Define per-API limit on contributions per report --- spec.bs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index 599c71c..5bee339 100644 --- a/spec.bs +++ b/spec.bs @@ -451,8 +451,10 @@ controls which [=origins=] are valid [=aggregation coordinators=]. Every Default aggregation coordinator is an [=aggregation coordinator=] that controls which is used for a report if none is explicitly selected. -Maximum report contributions is a positive integer that controls how -many contributions can be present in a single report. +Maximum report contributions is a [=map=] from [=context type=] to +positive {{unsigned long}} values. Semantically, it defines the maximum number +of contributions that can be present a single report for every kind of calling +context, e.g. Shared Storage. Minimum report delay is a non-negative [=duration=] that controls the minimum delay to deliver an [=aggregatable report=]. @@ -666,9 +668,9 @@ null |timeout|: |mergedContributions|. 1. Let |truncatedContributions| be a new [=list=]. 1. If |mergedContributions| has a [=list/size=] greater than [=maximum report - contributions=]: + contributions=][|api|]: 1. [=set/For each=] |n| of [=the exclusive range|the range=] 0 to [=maximum - report contributions=], exclusive: + report contributions=][|api|], exclusive: 1. [=set/Append=] |mergedContributions|[|n|] to |truncatedContributions|. 1. Otherwise, set |truncatedContributions| to |mergedContributions|. @@ -958,10 +960,12 @@ To obtain the plaintext payload given an [=aggregatable report=] |report|, perform the following steps. They return a [=byte sequence=]. 1. Let |payloadData| be a new [=list=]. 1. Let |contributions| be |report|'s [=aggregatable report/contributions=]. -1. [=Assert=]: |contributions|' [=list/size=] is not greater than [=maximum - report contributions=]. -1. [=iteration/While=] |contributions|' [=list/size=] is less than [=maximum - report contributions=]: +1. Let |maxContributions| be + [=maximum report contributions=][[=aggregatable report/api=]]. +1. [=Assert=]: |contributions|' [=list/size=] is not greater than + |maxContributions|. +1. [=iteration/While=] |contributions|' [=list/size=] is less than + |maxContributions|: 1. Let |nullContribution| be a new {{PAHistogramContribution}} with the items: : {{PAHistogramContribution/bucket}}