Skip to content

Commit f9308aa

Browse files
authored
Remove incomplete Full Flexible Event integration from spec and header validator (#1520)
1 parent 67fba3a commit f9308aa

File tree

14 files changed

+78
-1008
lines changed

14 files changed

+78
-1008
lines changed

index.bs

Lines changed: 13 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -691,38 +691,6 @@ a [=report window=] [=struct=] with the following fields:
691691
[=report windows=], because there are no gaps in time between any of the
692692
[=report windows|windows=].
693693

694-
<h3 id="summary-operator-header">Summary operator</h3>
695-
696-
A <dfn>summary operator</dfn> summarizes the triggers attributed to an
697-
[=attribution source=]. Its value is one of the following:
698-
699-
<dl dfn-for="summary operator">
700-
: "<dfn><code>count</code></dfn>"
701-
:: Number of triggers attributed.
702-
: "<dfn><code>value_sum</code></dfn>"
703-
:: Sum of the value of triggers.
704-
705-
</dl>
706-
707-
<h3 id="summary-bucket-header">Summary bucket</h3>
708-
709-
A <dfn>summary bucket</dfn> is a [=struct=] with the following items:
710-
711-
<dl dfn-for="summary bucket">
712-
: <dfn>start</dfn>
713-
:: An unsigned 32-bit integer.
714-
: <dfn>end</dfn>
715-
:: An unsigned 32-bit integer.
716-
717-
</dl>
718-
719-
A <dfn>summary bucket list</dfn> is a [=list=] of [=summary buckets=].
720-
It has the following constraints:
721-
722-
* Elements are strictly in ascending order based on their [=summary bucket/start=].
723-
* Every element's [=summary bucket/end=] is equal to the next element's [=summary bucket/start=] - 1, if it exists.
724-
* There is at least one element in the list.
725-
726694
<h3 id="trigger-data-matching-mode-header">Trigger-data matching mode</h3>
727695

728696
A <dfn>trigger-data matching mode</dfn> is one of the following:
@@ -969,8 +937,6 @@ An event-level trigger configuration is a [=struct=] with the following items:
969937
:: A [=list=] of [=filter configs=].
970938
: <dfn>negated filters</dfn>
971939
:: A [=list=] of [=filter configs=].
972-
: <dfn>value</dfn>
973-
:: A positive unsigned 32-bit integer.
974940

975941
</dl>
976942

@@ -2437,11 +2403,8 @@ A <dfn>source-registration JSON key</dfn> is one of the following:
24372403
<li>"<dfn><code>priority</code></dfn>"
24382404
<li>"<dfn><code>source_event_id</code></dfn>"
24392405
<li>"<dfn><code>start_time</code></dfn>"
2440-
<li>"<dfn><code>summary_buckets</code></dfn>"
2441-
<li>"<dfn><code>summary_operator</code></dfn>"
24422406
<li>"<dfn><code>trigger_data</code></dfn>"
24432407
<li>"<dfn><code>trigger_data_matching</code></dfn>"
2444-
<li>"<dfn><code>trigger_specs</code></dfn>"
24452408
<li>"<dfn><code>values</code></dfn>"
24462409
</ul>
24472410

@@ -2594,56 +2557,12 @@ To <dfn>parse report windows</dfn> given a |value|, a
25942557
1. Set |startDuration| to |endDuration|.
25952558
1. Return |windows|.
25962559

2597-
The user-agent has an associated boolean
2598-
<dfn>experimental Flexible Event support</dfn> (default false) that exposes
2599-
non-normative behavior described in the
2600-
<a href="https://github.com/WICG/attribution-reporting-api/blob/main/flexible_event_config.md">Flexible event-level configurations</a>
2601-
proposal.
2602-
2603-
To <dfn>parse summary operator</dfn> given a [=map=] |map|:
2604-
2605-
1. Let |value| be "<code>[=summary operator/count=]</code>".
2606-
1. If |map|["<code>[=source-registration JSON key/summary_operator=]</code>"] [=map/exists=]:
2607-
1. If |map|["<code>[=source-registration JSON key/summary_operator=]</code>"] is not a [=string=], return an
2608-
error.
2609-
1. If |map|["<code>[=source-registration JSON key/summary_operator=]</code>"] is not a
2610-
[=summary operator=], return an error.
2611-
1. Set |value| to |map|["<code>[=source-registration JSON key/summary_operator=]</code>"].
2612-
1. Return |value|.
2613-
2614-
To <dfn>parse summary buckets</dfn> given a [=map=] |map| and an integer |maxEventLevelReports|:
2615-
2616-
1. Let |values| be [=the inclusive range|the range=] 1 to
2617-
|maxEventLevelReports|, inclusive.
2618-
1. If |map|["<code>[=source-registration JSON key/summary_buckets=]</code>"] [=map/exists=]:
2619-
1. If |map|["<code>[=source-registration JSON key/summary_buckets=]</code>"] is not a [=list=], [=list/is empty=], or
2620-
its [=list/size=] is greater than |maxEventLevelReports|, return an
2621-
error.
2622-
1. Set |values| to |map|["<code>[=source-registration JSON key/summary_buckets=]</code>"].
2623-
1. Let |prev| be 0.
2624-
1. Let |summaryBuckets| be a new [=list=].
2625-
1. [=list/iterate|For each=] |item| of |values|:
2626-
1. If |item| is not an integer or cannot be represented by an unsigned
2627-
32-bit integer, or is less than or equal to |prev|, return an error.
2628-
1. Let |summaryBucket| be a new [=summary bucket=] whose items are
2629-
2630-
: [=summary bucket/start=]
2631-
:: |prev|
2632-
: [=summary bucket/end=]
2633-
:: |item| - 1
2634-
2635-
1. [=list/Append=] |summaryBucket| to |summaryBuckets|.
2636-
1. Set |prev| to |item|.
2637-
1. Return |summaryBuckets|.
2638-
26392560
To <dfn>parse trigger data into a trigger spec map</dfn> given a
2640-
|triggerDataList|, a [=trigger spec=] |spec|, a [=trigger spec map=]
2641-
|specs|, and a [=boolean=] |allowEmpty|:
2561+
|triggerDataList|, a [=trigger spec=] |spec|, and a [=trigger spec map=]
2562+
|specs|:
26422563

26432564
1. If |triggerDataList| is not a [=list=] or its [=list/size=] is greater than
26442565
[=max distinct trigger data per source=], return false.
2645-
1. If |allowEmpty| is false and |triggerDataList| [=list/is empty=], return
2646-
false.
26472566
1. [=list/iterate|For each=] |triggerData| of |triggerDataList|:
26482567
1. If |triggerData| is not an integer or cannot be represented by an
26492568
unsigned 32-bit integer, or |specs|[|triggerData|] [=map/exists=],
@@ -2662,55 +2581,26 @@ To <dfn>parse trigger specs</dfn> given a [=map=] |map|, a [=moment=]
26622581
and |expiry|.
26632582
1. If |defaultReportWindows| is an error, return an error.
26642583
1. Let |specs| be a new [=trigger spec map=].
2665-
1. If [=experimental Flexible Event support=] is true and
2666-
|map|["<code>[=source-registration JSON key/trigger_specs=]</code>"] [=map/exists=]:
2667-
1. If |map|["<code>[=source-registration JSON key/trigger_data=]</code>"] [=map/exists=], return an error.
2668-
1. If |map|["<code>[=source-registration JSON key/trigger_specs=]</code>"] is not a [=list=] or its
2669-
[=list/size=] is greater than [=max distinct trigger data per source=],
2584+
1. Let |spec| be a new [=trigger spec=] with the following items:
2585+
: [=trigger spec/event-level report windows=]
2586+
:: |defaultReportWindows|
2587+
1. If |map|["<code>[=source-registration JSON key/trigger_data=]</code>"] [=map/exists=]:
2588+
1. If the result of running
2589+
[=parse trigger data into a trigger spec map=] with
2590+
|map|["<code>[=source-registration JSON key/trigger_data=]</code>"], |spec|, and |specs| is false,
26702591
return an error.
2671-
1. [=list/iterate|For each=] |item| of |map|["<code>[=source-registration JSON key/trigger_specs=]</code>"]:
2672-
1. If |item| is not a [=map=], return an error.
2673-
1. Let |spec| be a new [=trigger spec=] with the following items:
2674-
: [=trigger spec/event-level report windows=]
2675-
:: |defaultReportWindows|
2676-
1. If |item|["<code>[=source-registration JSON key/event_report_windows=]</code>"] [=map/exists=]:
2677-
1. Let |reportWindows| be the result of
2678-
[=parsing report windows=] with |item|["<code>[=source-registration JSON key/event_report_windows=]</code>"],
2679-
|sourceTime|, and |expiry|.
2680-
1. If |reportWindows| is an error, return it.
2681-
1. Set |spec|'s [=trigger spec/event-level report windows=] to
2682-
|reportWindows|.
2683-
1. If |item|["<code>[=source-registration JSON key/trigger_data=]</code>"] does not [=map/exist=], return an error.
2684-
1. Let |allowEmpty| be false.
2685-
1. If the result of running
2686-
[=parse trigger data into a trigger spec map=] with
2687-
|item|["<code>[=source-registration JSON key/trigger_data=]</code>"], |spec|, |specs|, and |allowEmpty| is
2688-
false, return an error.
26892592
1. Otherwise:
2690-
1. Let |spec| be a new [=trigger spec=] with the following items:
2691-
: [=trigger spec/event-level report windows=]
2692-
:: |defaultReportWindows|
2693-
1. If |map|["<code>[=source-registration JSON key/trigger_data=]</code>"] [=map/exists=]:
2694-
1. Let |allowEmpty| be true.
2695-
1. If the result of running
2696-
[=parse trigger data into a trigger spec map=] with
2697-
|map|["<code>[=source-registration JSON key/trigger_data=]</code>"], |spec|, |specs|, and |allowEmpty| is false,
2698-
return an error.
2699-
1. Otherwise:
2700-
1. [=set/iterate|For each=] integer |triggerData| of
2701-
[=the exclusive range|the range=] 0 to
2702-
[=default trigger data cardinality=][|sourceType|], exclusive:
2703-
1. [=map/Set=] |specs|[|triggerData|] to |spec|.
2593+
1. [=set/iterate|For each=] integer |triggerData| of
2594+
[=the exclusive range|the range=] 0 to
2595+
[=default trigger data cardinality=][|sourceType|], exclusive:
2596+
1. [=map/Set=] |specs|[|triggerData|] to |spec|.
27042597
1. If |matchingMode| is "<code>[=trigger-data matching mode/modulus=]</code>":
27052598
1. Let |i| be 0.
27062599
1. [=map/iterate|For each=] |triggerData| of |specs|'s [=map/get the keys|keys=]:
27072600
1. If |triggerData| does not equal |i|, return an error.
27082601
1. Set |i| to |i| + 1.
27092602
1. Return |specs|.
27102603

2711-
Issue: Invoke [=parse summary buckets=] and [=parse summary operator=]
2712-
from this algorithm.
2713-
27142604
To <dfn>parse a source aggregatable debug reporting config</dfn> given |value|, a
27152605
non-negative integer |defaultBudget|, and an [=aggregatable debug reporting config=]
27162606
|defaultConfig|:
@@ -3471,15 +3361,6 @@ A <dfn>trigger-registration JSON key</dfn> is one of the following:
34713361

34723362
<h3 algorithm id="attribution-trigger-creation">Creating an attribution trigger</h3>
34733363

3474-
To <dfn>parse an event-trigger value</dfn> given a [=map=] |map|:
3475-
3476-
1. If [=experimental Flexible Event support=] is false or |map|["<code>[=trigger-registration JSON key/value=]</code>"] does
3477-
not [=map/exists|exist=], return 1.
3478-
1. Let |value| be |map|["<code>[=trigger-registration JSON key/value=]</code>"].
3479-
1. If |value| is not an integer, cannot be represented by an unsigned 32-bit
3480-
integer, or is less than or equal to zero, return an error.
3481-
1. Return |value|.
3482-
34833364
To <dfn>parse event triggers</dfn> given a [=map=] |map|:
34843365

34853366
1. Let |eventTriggers| be a new [=set=].
@@ -3504,9 +3385,6 @@ To <dfn>parse event triggers</dfn> given a [=map=] |map|:
35043385
1. Let |filterPair| be the result of running [=parse a filter pair=] with
35053386
|value|.
35063387
1. If |filterPair| is an error, return it.
3507-
1. Let |triggerValue| be the result of running
3508-
[=parse an event-trigger value=] with |value|.
3509-
1. If |triggerValue| is an error, return it.
35103388
1. Let |eventTrigger| be a new [=event-level trigger configuration=] with
35113389
the items:
35123390
: [=event-level trigger configuration/trigger data=]
@@ -3519,8 +3397,6 @@ To <dfn>parse event triggers</dfn> given a [=map=] |map|:
35193397
:: |filterPair|[0]
35203398
: [=event-level trigger configuration/negated filters=]
35213399
:: |filterPair|[1]
3522-
: [=event-level trigger configuration/value=]
3523-
:: |triggerValue|
35243400
1. [=set/Append=] |eventTrigger| to |eventTriggers|.
35253401
1. Return |eventTriggers|.
35263402

@@ -4107,10 +3983,6 @@ To <dfn>maybe replace event-level report</dfn> given an [=attribution source=]
41073983
1. [=set/Remove=] |rateLimitRecord| from the [=attribution rate-limit cache=].
41083984
1. Return "<code>[=event-level-report-replacement result/add-new-report=]</code>".
41093985

4110-
Issue: This algorithm is not compatible with the behavior proposed for
4111-
[=experimental Flexible Event support=] with differing
4112-
[=trigger spec/event-level report windows=] for a given source.
4113-
41143986
To <dfn>trigger event-level attribution</dfn> given an [=attribution trigger=] |trigger| and an
41153987
[=attribution source=] |sourceToAttribute|, run the following steps:
41163988

ts/src/flexible-event/main.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ if (options.json_file !== undefined) {
101101
const [{ errors, warnings }, source] = validateSource(json, {
102102
vsv: vsv.Chromium,
103103
sourceType: options.source_type,
104-
fullFlex: true,
105104
})
106105
warnings.forEach((i) => logIssue('W', i))
107106
if (errors.length > 0) {
@@ -114,12 +113,10 @@ if (options.json_file !== undefined) {
114113
new Config(
115114
source.maxEventLevelReports,
116115
source.attributionScopes,
117-
source.triggerSpecs.flatMap((spec) =>
118-
new Array<PerTriggerDataConfig>(spec.triggerData.size).fill(
119-
new PerTriggerDataConfig(
120-
spec.eventReportWindows.endTimes.length,
121-
spec.summaryBuckets.length
122-
)
116+
new Array<PerTriggerDataConfig>(source.triggerData.size).fill(
117+
new PerTriggerDataConfig(
118+
source.eventReportWindows.endTimes.length,
119+
source.maxEventLevelReports
123120
)
124121
)
125122
)

ts/src/header-validator/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ <h1>Attribution Reporting Header Validation</h1>
8484
<p><label><input type=radio name=header value=eligible><code>Attribution-Reporting-Eligible</code></label>
8585
<p><label><input type=radio name=header value=info><code>Attribution-Reporting-Info</code></label>
8686
<p><label><input type=checkbox checked disabled>Use Chromium's vendor-specific values</label> <a href="https://github.com/WICG/attribution-reporting-api/blob/main/params/chromium-params.md" target=_blank>(details)</a>
87-
<p><label><input type=checkbox name=flex>Enable experimental Flexible Event fields</label> <a href="https://github.com/WICG/attribution-reporting-api/blob/main/flexible_event_config.md" target=_blank>(details)</a>
8887
</fieldset>
8988
<fieldset id=output>
9089
<legend>Validation Result</legend>

ts/src/header-validator/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,27 @@ const sourceTypeFieldset =
2222
document.querySelector<HTMLFieldSetElement>('#source-type')!
2323
const effective = document.querySelector('#effective')!
2424

25-
const flexCheckbox = form.elements.namedItem('flex') as HTMLInputElement
26-
2725
function sourceType(): SourceType {
2826
return parseSourceType(sourceTypeRadios.value)
2927
}
3028

3129
function validate(): void {
3230
sourceTypeFieldset.disabled = true
33-
flexCheckbox.disabled = true
3431

3532
let v: validator.Validator<unknown>
3633

3734
switch (headerRadios.value) {
3835
case 'source':
3936
sourceTypeFieldset.disabled = false
40-
flexCheckbox.disabled = false
4137
v = source.validator({
4238
vsv: vsv.Chromium,
4339
sourceType: sourceType(),
44-
fullFlex: flexCheckbox.checked,
4540
noteInfoGain: true,
4641
})
4742
break
4843
case 'trigger':
49-
flexCheckbox.disabled = false
5044
v = trigger.validator({
5145
vsv: vsv.Chromium,
52-
fullFlex: flexCheckbox.checked,
5346
})
5447
break
5548
case 'os-source':
@@ -99,8 +92,6 @@ document.querySelector('#linkify')!.addEventListener('click', () => {
9992
url.searchParams.set('source-type', sourceType())
10093
}
10194

102-
url.searchParams.set('flex', flexCheckbox.checked.toString())
103-
10495
void navigator.clipboard.writeText(url.toString())
10596
})
10697

@@ -136,6 +127,4 @@ if (st !== null && st in SourceType) {
136127
}
137128
sourceTypeRadios.value = st
138129

139-
flexCheckbox.checked = params.get('flex') === 'true'
140-
141130
validate()

ts/src/header-validator/main.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface Arguments {
1111
input?: string
1212
file?: string
1313

14-
fullFlex: boolean
1514
sourceType?: SourceType
1615

1716
silent: boolean
@@ -43,11 +42,6 @@ const options = parse<Arguments>(
4342
'If present, parse input as a source. Otherwise, parse as a trigger.',
4443
},
4544

46-
fullFlex: {
47-
type: Boolean,
48-
description: 'If true, parse experimental Full Flexible Event fields.',
49-
},
50-
5145
silent: {
5246
type: Boolean,
5347
description: 'If true, suppress output.',
@@ -94,11 +88,9 @@ const out = validate<unknown>(
9488
options.sourceType === undefined
9589
? trigger.validator({
9690
vsv: vsv.Chromium,
97-
fullFlex: options.fullFlex,
9891
})
9992
: source.validator({
10093
vsv: vsv.Chromium,
101-
fullFlex: options.fullFlex,
10294
sourceType: options.sourceType,
10395
})
10496
)

0 commit comments

Comments
 (0)