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

{
  "description": "Unique destination rate limit within rate limit window",
  "api_config": {
    "max_destinations_per_rate_limit_window": "2",
    "max_destinations_per_rate_limit_window_reporting_site": "1",
    "rate_limit_max_reporting_origins_per_source_reporting_site": "2"
  },
  "input": {
    "registrations": [
      // Should be dropped due to destination reporting site rate limit, but no
      // verbose debug report is created as debug_permission is not set.
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": [
                  "https://example.destination1.test",
                  "https://destination2.test"
                ],
                "source_event_id": "987"
              }
            }
          }
        ]
      },
      {
        "timestamp": "1000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": "https://example.destination3.test",
                "source_event_id": "111"
              }
            }
          }
        ]
      },
      // Should be dropped due to destination reporting site rate limit.
      {
        "timestamp": "2000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://a.reporter1.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": "https://destination4.test",
                "source_event_id": "222"
              }
            }
          }
        ]
      },
      {
        "timestamp": "3000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": "https://destination5.test",
                "source_event_id": "123"
              }
            }
          }
        ]
      },
      // Should be dropped due to max destination limit.
      {
        "timestamp": "4000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter3.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": "https://destination6.test",
                "source_event_id": "567"
              }
            }
          }
        ]
      },
      // Should be dropped due to both max destination and reporting site
      // limit.
      {
        "timestamp": "5000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter3.test/register-source",
            "debug_permission": true,
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": [
                  "https://destination7.test",
                  "https://destination8.test"
                ],
                "source_event_id": "765"
              }
            }
          }
        ]
      },
      // Should be processed as the rate limit window is 1 minute.
      {
        "timestamp": "62000",
        "registration_request": {
          "context_origin": "https://source1.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "debug_reporting": true,
                "destination": "https://destination8.test",
                "source_event_id": "444"
              }
            }
          }
        ]
      },
      // Should be dropped as there is no matching source.
      {
        "timestamp": "62001",
        "registration_request": {
          "context_origin": "https://destination1.test"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "1"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should result in an event-level report.
      {
        "timestamp": "63000",
        "registration_request": {
          "context_origin": "https://destination3.test"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "2"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should be dropped as there is no matching source.
      {
        "timestamp": "64000",
        "registration_request": {
          "context_origin": "https://destination4.test"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "3"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should result in an event-level report.
      {
        "timestamp": "65000",
        "registration_request": {
          "context_origin": "https://destination5.test"
        },
        "responses": [
          {
            "url": "https://reporter2.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "4"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should be dropped as there is no matching source.
      {
        "timestamp": "66000",
        "registration_request": {
          "context_origin": "https://destination6.test"
        },
        "responses": [
          {
            "url": "https://reporter3.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "5"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should be dropped as there is no matching source.
      {
        "timestamp": "67000",
        "registration_request": {
          "context_origin": "https://destination7.test"
        },
        "responses": [
          {
            "url": "https://reporter3.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "5"
                  }
                ]
              }
            }
          }
        ]
      },
      // Should result in an event-level report.
      {
        "timestamp": "68000",
        "registration_request": {
          "context_origin": "https://destination8.test"
        },
        "responses": [
          {
            "url": "https://reporter1.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "event_trigger_data": [
                  {
                    "trigger_data": "6"
                  }
                ]
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination4.test",
              "limit": "1",
              "source_event_id": "222",
              "source_site": "https://source1.test"
            },
            "type": "source-destination-rate-limit"
          }
        ],
        "report_time": "2000",
        "report_url": "https://a.reporter1.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": [
          {
            "body": {
              "attribution_destination": "https://destination6.test",
              "source_event_id": "567",
              "source_site": "https://source1.test"
            },
            "type": "source-success"
          }
        ],
        "report_time": "4000",
        "report_url": "https://reporter3.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": [
          {
            "body": {
              "attribution_destination": [
                "https://destination7.test",
                "https://destination8.test"
              ],
              "limit": "1",
              "source_event_id": "765",
              "source_site": "https://source1.test"
            },
            "type": "source-destination-rate-limit"
          }
        ],
        "report_time": "5000",
        "report_url": "https://reporter3.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "attribution_destination": "https://destination3.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172801",
          "source_event_id": "111",
          "source_type": "navigation",
          "trigger_data": "2"
        },
        "report_url": "https://reporter1.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172801000"
      },
      {
        "payload": {
          "attribution_destination": "https://destination5.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172803",
          "source_event_id": "123",
          "source_type": "navigation",
          "trigger_data": "4"
        },
        "report_url": "https://reporter2.test/.well-known/attribution-reporting/report-event-attribution",
        "report_time": "172803000"
      },
      {
        "payload": {
          "attribution_destination": "https://destination8.test",
          "randomized_trigger_rate": 0.0024263,
          "scheduled_report_time": "172862",
          "source_event_id": "444",
          "source_type": "navigation",
          "trigger_data": "6"
        },
        "report_time": "172862000",
        "report_url": "https://reporter1.test/.well-known/attribution-reporting/report-event-attribution"
      }
    ]
  }
}