chromium/content/test/data/attribution_reporting/interop/aggregatable_budget.json

{
  "description": "Max aggregatable budget per source",
  "input": {
    "registrations": [
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "123",
                "aggregation_keys": {
                  "a": "0x159",
                  "b": "0x5"
                },
                "debug_key": "12345"
              }
            }
          }
        ]
      },
      // Should be dropped due to insufficient aggregatable budget.
      {
        "timestamp": "1000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["a"],
                    "key_piece": "0x400"
                  },
                  {
                    "source_keys": ["b"],
                    "key_piece": "0xA80"
                  }
                ],
                "aggregatable_values": {
                  "a": 65530,
                  "b": 7
                },
                "debug_key": "6789",
                "debug_reporting": true
              }
            }
          }
        ]
      },
      // Should result in an aggregatable report because there's sufficient
      // aggregatable budget.
      {
        "timestamp": "2000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["a"],
                    "key_piece": "0x400"
                  }
                ],
                "aggregatable_values": {
                  "a": 65535
                }
              }
            }
          }
        ]
      },
      // Should be dropped due to insufficient aggregatable budget and verbose
      // debug report is not created as debug_permission is not set.
      {
        "timestamp": "3000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["b"],
                    "key_piece": "0xa80"
                  }
                ],
                "aggregatable_values": {
                  "a": 2
                },
                "debug_reporting": true
              }
            }
          }
        ]
      },
      // Should result in an aggregatable report because there's sufficient
      // aggregatable budget.
      {
        "timestamp": "4000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["b"],
                    "key_piece": "0xa80"
                  }
                ],
                "aggregatable_values": {
                  "b": 1
                }
              }
            }
          }
        ]
      },
      // Should deactivate the first source.
      {
        "timestamp": "10000",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "456",
                "aggregation_keys": {
                  "a": "0x159",
                  "b": "0x5"
                },
                "debug_key": "54321"
              }
            }
          }
        ]
      },
      // Should result in an aggregatable report because the aggregatable
      // budget is separate for the second source.
      {
        "timestamp": "11000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["b"],
                    "key_piece": "0xa80"
                  }
                ],
                "aggregatable_values": {
                  "b": 65536
                }
              }
            }
          }
        ]
      },
      // Should not result in an aggregatable report due to insufficient
      // aggregatable budget.
      {
        "timestamp": "12000",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_trigger_data": [
                  {
                    "source_keys": ["b"],
                    "key_piece": "0xa81"
                  }
                ],
                "aggregatable_values": {
                  "b": 1
                },
                "debug_reporting": true
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination.test",
              "limit": "65536",
              "source_event_id": "123",
              "source_site": "https://source.test",
              "source_debug_key": "12345",
              "trigger_debug_key": "6789"
            },
            "type": "trigger-aggregate-insufficient-budget"
          }
        ],
        "report_time": "1000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination.test",
              "limit": "65536",
              "source_debug_key": "54321",
              "source_event_id": "456",
              "source_site": "https://source.test"
            },
            "type": "trigger-aggregate-insufficient-budget"
          }
        ],
        "report_time": "12000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [ {
            "id": "0",
            "key": "0x559",
            "value": 65535
          } ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "3602",
            "version": "1.0"
          }
        },
        "report_time": "3602000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [ {
            "id": "0",
            "key": "0xa85",
            "value": 1
          } ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "3604",
            "version": "1.0"
          }
        },
        "report_time": "3604000",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [
            {
              "id": "0",
              "key": "0xa85",
              "value": 65536
            }
          ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "3611",
            "version": "1.0"
          }
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
        "report_time": "3611000"
      }
    ]
  }
}