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

{
  "description": "Aggregatable report with trigger context ID",
  "input": {
    "registrations": [
      {
        "timestamp": "0",
        "registration_request": {
          "context_origin": "https://source.test",
          "Attribution-Reporting-Eligible": "navigation-source"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-source",
            "response": {
              "Attribution-Reporting-Register-Source": {
                "destination": "https://destination.test",
                "source_event_id": "123",
                "aggregation_keys": {
                  "a": "0x159"
                }
              }
            }
          }
        ]
      },
      {
        "timestamp": "1",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Info": "report-header-errors",
              "Attribution-Reporting-Register-Trigger": {
                "trigger_context_id": 456 // wrong type
              }
            }
          }
        ]
      },
      {
        "timestamp": "2",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Info": "report-header-errors",
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_values": {
                  "a": 321
                },
                "trigger_context_id": ""
              }
            }
          }
        ]
      },
      {
        "timestamp": "3",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Info": "report-header-errors",
              "Attribution-Reporting-Register-Trigger": {
                "trigger_context_id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" // too long
              }
            }
          }
        ]
      },
      {
        "timestamp": "4",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Info": "report-header-errors",
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_source_registration_time": "include",
                "trigger_context_id": "123" // not allowed
              }
            }
          }
        ]
      },
      {
        "timestamp": "5",
        "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": 123
                },
                "trigger_context_id": "456"
              }
            }
          }
        ]
      },
      {
        "timestamp": "6",
        "registration_request": {
          "context_origin": "https://destination.test"
        },
        "responses": [
          {
            "url": "https://reporter.test/register-trigger",
            "response": {
              "Attribution-Reporting-Register-Trigger": {
                "aggregatable_values": {
                  "b": 123
                },
                "trigger_context_id": "654"
              }
            }
          }
        ]
      }
    ]
  },
  "output": {
    "reports": [
      {
        "payload": [{
           "body": {
              "context_site": "https://destination.test",
              "header": "Attribution-Reporting-Register-Trigger",
              "value": "{\"trigger_context_id\":456}"
           },
           "type": "header-parsing-error"
        }],
        "report_time": "1",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [ {
            "id": "0",
            "key": "0x159",
            "value": 321
          } ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "0",
            "version": "1.0"
          },
          "trigger_context_id": ""
        },
        "report_time": "2",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution"
      },
      {
        "payload": [{
           "body": {
              "context_site": "https://destination.test",
              "header": "Attribution-Reporting-Register-Trigger",
              "value": "{\"trigger_context_id\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"}"
           },
           "type": "header-parsing-error"
        }],
        "report_time": "3",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": [{
           "body": {
              "context_site": "https://destination.test",
              "header": "Attribution-Reporting-Register-Trigger",
              "value": "{\"aggregatable_source_registration_time\":\"include\",\"trigger_context_id\":\"123\"}"
           },
           "type": "header-parsing-error"
        }],
        "report_time": "4",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [
            {
              "id": "0",
              "key": "0x559",
              "value": 123
            }
          ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "0",
            "version": "1.0"
          },
          "trigger_context_id": "456"
        },
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
        "report_time": "5"
      },
      {
        "payload": {
          "aggregation_coordinator_origin": "https://coordinator.test",
          "histograms": [ {
            "id": "0",
            "key": "0x0",
            "value": 0
          } ],
          "shared_info": {
            "api": "attribution-reporting",
            "attribution_destination": "https://destination.test",
            "reporting_origin": "https://reporter.test",
            "scheduled_report_time": "0",
            "version": "1.0"
          },
          "trigger_context_id": "654"
        },
        "report_time": "6",
        "report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution"
      }
    ]
  }
}