Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec: Define per-calling-API limit on contributions per report #150

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ controls which [=origins=] are valid [=aggregation coordinators=]. Every
<dfn>Default aggregation coordinator</dfn> is an [=aggregation coordinator=]
that controls which is used for a report if none is explicitly selected.

<dfn>Maximum report contributions</dfn> is a positive integer that controls how
many contributions can be present in a single report.
<dfn>Maximum report contributions</dfn> is a [=map=] from [=context type=] to
alexmturner marked this conversation as resolved.
Show resolved Hide resolved
positive integers. Semantically, it defines the maximum number of contributions
that can be present in a single report for every kind of calling context, e.g.
Shared Storage.

<dfn>Minimum report delay</dfn> is a non-negative [=duration=] that controls the
minimum delay to deliver an [=aggregatable report=].
Expand Down Expand Up @@ -690,9 +692,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|.
Expand Down Expand Up @@ -1014,10 +1016,12 @@ To <dfn>obtain the plaintext payload</dfn> 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}}
Expand Down
Loading