forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registration.mojom
214 lines (170 loc) · 7.18 KB
/
registration.mojom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module attribution_reporting.mojom;
import "components/attribution_reporting/source_registration_time_config.mojom";
import "components/attribution_reporting/trigger_data_matching.mojom";
import "mojo/public/mojom/base/int128.mojom";
import "mojo/public/mojom/base/time.mojom";
import "services/network/public/mojom/schemeful_site.mojom";
import "url/mojom/origin.mojom";
import "url/mojom/url.mojom";
// Encapsulates a potentially trustworthy origin. Equivalent to
// attribution_reporting::SuitableOrigin.
struct SuitableOrigin {
url.mojom.Origin origin;
};
// Filter data for selectively matching attribution sources and triggers.
// See https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#optional-attribution-filters
// for details.
struct FilterData {
// Map of filter name to a possibly empty set of values. Must not contain
// `source_type` or `_lookback_window` keys.
map<string, array<string>> filter_values;
};
// Internal structure to support the lookback window implementation.
struct FilterConfig {
mojo_base.mojom.TimeDelta? lookback_window;
map<string, array<string>> filter_values;
};
// Filters for selectively matching attribution sources and triggers.
// See https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#optional-attribution-filters
// for details.
struct FilterPair {
// If non-empty, this trigger will be ignored unless the attributed source's
// filter data matches.
array<FilterConfig> positive;
// If non-empty, this trigger will be ignored unless the attributed source's
// filter data does *NOT* match.
array<FilterConfig> negative;
};
// See https://github.com/WICG/attribution-reporting-api/blob/main/AGGREGATE.md#attribution-source-registration
// for details.
struct AggregationKeys {
map<string, mojo_base.mojom.Uint128> keys;
};
// Struct containing the trigger-side aggregatable data.
struct AggregatableTriggerData {
mojo_base.mojom.Uint128 key_piece;
array<string> source_keys;
FilterPair filters;
};
// Target site(s) where a source can be attributed.
struct DestinationSet {
array<network.mojom.SchemefulSite> destinations;
};
// Reporting configuration that controls the early reporting time windows for a
// source.
struct EventReportWindows {
mojo_base.mojom.TimeDelta start_time;
array<mojo_base.mojom.TimeDelta> end_times;
};
struct TriggerSpec {
EventReportWindows event_report_windows;
};
// https://wicg.github.io/attribution-reporting-api/#trigger-specs-header
//
// The index-list representation here goes against Mojo guidelines, but mirrors
// the representation of the C++ type of the same name, which was chosen for
// efficiency and utility as both an in-memory type and an on-disk structure.
// See https://crrev.com/c/4994870/comment/5071077b_37dae2d1/ for details.
struct TriggerSpecs {
array<TriggerSpec> specs;
// Keys are trigger data. Values are indices into `specs`.
map<uint32, uint8> trigger_data_indices;
};
// Configures a source's output space.
// https://github.com/WICG/attribution-reporting-api/blob/main/flexible_event_config.md
struct TriggerConfig {
TriggerDataMatching trigger_data_matching;
};
struct SourceRegistration {
DestinationSet destinations;
// Data that will be sent in attribution reports to identify this source.
uint64 source_event_id = 0;
// Specifies how long this source is eligible for attribution.
mojo_base.mojom.TimeDelta expiry;
// Specifies a custom set of report windows determining the time
// bounds of a report being generated with this source.
EventReportWindows event_report_windows;
// Specifies how long after source registration an aggregatable
// report can be generated with this source.
mojo_base.mojom.TimeDelta aggregatable_report_window;
// Specifies how many event-level reports can be generated with this source.
int32 max_event_level_reports;
// Priority for this source.
int64 priority = 0;
// A key that is propagated through the Attribution Reporting API for
// debugging purposes.
uint64? debug_key;
FilterData filter_data;
AggregationKeys aggregation_keys;
// Specifies whether to enable verbose debug reporting.
bool debug_reporting = false;
TriggerConfig trigger_config;
};
// Mojo representation of the trigger configuration provided by a reporting
// origin. This data is provided arbitrarily by certain subresources on a
// page which invoke Attribution Reporting.
struct EventTriggerData {
// Value which identifies this trigger in attribution reports, determined by
// reporting origin.
uint64 data = 0;
// Priority of this trigger relative to other attributed triggers for a
// source. Reports created with high priority triggers will be reported over
// lower priority ones.
int64 priority = 0;
// Key which allows deduplication against existing attributions for the same
// source.
uint64? dedup_key;
FilterPair filters;
};
struct AggregatableDedupKey {
// Key which allows deduplication against existing attributions for the same
// source.
uint64? dedup_key;
FilterPair filters;
};
// Represents a request from a reporting origin to trigger attribution on a
// given site. See:
// https://github.com/WICG/attribution-reporting-api/blob/main/EVENT.md#triggering-attribution
struct TriggerRegistration {
// List of all event trigger data objects declared by the event trigger
// header. This data is arbitrarily set by the reporting origin.
array<EventTriggerData> event_triggers;
FilterPair filters;
// List of all aggregatable trigger data objects declared by the trigger
// header.
array<AggregatableTriggerData> aggregatable_trigger_data;
// A map of aggregation key identifier and the corresponding value.
map<string, uint32> aggregatable_values;
// A key that is propagated through the Attribution Reporting API for
// debugging purposes.
uint64? debug_key;
// List of all aggregatable dedup keys for deduplication against existing
// aggregatable reports for the same source.
array<AggregatableDedupKey> aggregatable_dedup_keys;
// Specifies whether to enable verbose debug reporting.
bool debug_reporting = false;
// Specifies the deployment option for the aggregation service. The default
// deployment will be used if not set.
SuitableOrigin? aggregation_coordinator_origin;
// Specifies whether to include source registration time in aggregatable
// reports.
SourceRegistrationTimeConfig source_registration_time_config;
};
// Represents a source or trigger registration item that will be passed to the OS, if supported.
struct OsRegistrationItem {
// The URL to which the OS will make a request in order to retrieve the actual
// source or trigger registration.
url.mojom.Url url;
// Specifies whether to enable verbose debug reporting.
bool debug_reporting;
};
// Represents a source or trigger registration that will be passed to the OS, if supported.
// A registration may contain multiple registration items.
struct OsRegistration {
// The registrations to which the OS will make a request in order to retrieve the actual
// source or trigger registration.
array<OsRegistrationItem> items;
};