Aggregation service

This directory contains the implementation of the client-side logic for the Aggregation service proposed for the Attribution Reporting API.

Currently, this library's consumers are:

Processing pipeline

In broad strokes, this library exposes functions built from a few basic operations:

  • Scheduling a report means assembling and sending the report at a randomly selected time. This library schedules reports by configuring a timer that will run the assemble-and-send procedure when it fires. Because the browser may be killed at any time, it must also save the reporting time to persistent storage.
  • Assembly takes a report request (AggregatableReportRequest) and serializes and encrypts its cleartext payload with the aggregation service‘s public key to produce an aggregatable report (AggregatableReport). This library automatically fetches the aggregation service server’s public key if a valid key is not already stored on disk. For more information on payload encryption, see payload_encryption.md.
  • Sending an aggregatable report means serializing it and delivering the bytes to the associated reporting origin via HTTP. This library implements retry logic in order to tolerate transient network interruptions. (From there, the reporting origin batches and forwards the aggregatable reports to the aggregation service server, but we are now well outside the scope of the client-side logic implemented by this library. For more info, see this section of the Attribution Reporting documentation.)

Consumers can use the following methods of the public interface, defined in aggregation_service.h.

  1. AggregationService::ScheduleReport() schedules a report to be assembled and sent after a randomized delay. This is used for standard Private Aggregation reports.
  2. AggregationService::AssembleAndSendReport() assembles and sends a report immediately. This is used for Private Aggregation duplicate debug reports.
  3. AggregationService::AssembleReport() just assembles a report. This is used for Attribution Reporting aggregatable reports. Note that this consumer implements their own scheduling and sending logic.

Histogram naming

  • PrivacySandbox.AggregationService.ScheduledRequests contains histograms that pertain to requests created by ScheduleReport().
  • PrivacySandbox.AggregationService.UnscheduledRequests contains histograms that pertain to requests created by AssembleAndSendReport().

Command-line tool

A command-line tool that generates aggregatable reports for testing is available. Please see //tools/aggregation_service's README for more detail


TODO: Expand this README.