blob: 5504fd2e7b10cfa2505e978ed6a19af84e6b18dc [file] [log] [blame]
{
"description": "Max aggregatable budget per source",
"input": {
"sources": [
{
"timestamp": "1643235573000",
"registration_request": {
"source_origin": "https://source.test",
"attribution_src_url": "https://reporter.test/register-source",
"source_type": "navigation"
},
"responses": [{
"url": "https://reporter.test/register-source",
"response": {
"Attribution-Reporting-Register-Source": {
"destination": "https://destination.test",
"source_event_id": "123",
"aggregation_keys": {
"a": "0x159",
"b": "0x5"
},
// Will be cleared as debug_permission is not set.
"source_debug_key": "12345"
}
}
}]
},
// Should deactivate the first source.
{
"timestamp": "1643235583000",
"registration_request": {
"source_origin": "https://source.test",
"attribution_src_url": "https://reporter.test/register-source",
"source_type": "navigation"
},
"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"
}
}
}]
}
],
"triggers": [
// Should be dropped due to insufficient aggregatable budget.
{
"timestamp": "1643235574000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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": "1643235575000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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": "1643235576000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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": "1643235577000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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 result in an aggregatable report because the aggregatable
// budget is separate for the second source.
{
"timestamp": "1643235584000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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": "1643235585000",
"registration_request": {
"attribution_src_url": "https://reporter.test/register-trigger",
"destination_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": {
"aggregatable_results": [
{
"payload": {
"attribution_destination": "https://destination.test",
"histograms": [
{
"key": "0x559",
"value": 65535
}
]
},
"report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
"report_time": "1643239175000"
},
{
"payload": {
"attribution_destination": "https://destination.test",
"histograms": [
{
"key": "0xa85",
"value": 1
}
]
},
"report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
"report_time": "1643239177000"
},
{
"payload": {
"attribution_destination": "https://destination.test",
"histograms": [
{
"key": "0xa85",
"value": 65536
}
],
"source_debug_key": "54321"
},
"report_url": "https://reporter.test/.well-known/attribution-reporting/report-aggregate-attribution",
"report_time": "1643239184000"
}
],
"verbose_debug_reports": [
{
"payload": [ {
"body": {
"attribution_destination": "https://destination.test",
"limit": "65536",
"source_event_id": "123",
"source_site": "https://source.test",
"trigger_debug_key": "6789"
},
"type": "trigger-aggregate-insufficient-budget"
} ],
"report_time": "1643235574000",
"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": "1643235585000",
"report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose"
}
]
}
}