Skip to content

Commit

Permalink
Reorganize cross app web algorithms (WICG#1174)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Paseltiner <[email protected]>
  • Loading branch information
linnan-github and apasel422 committed Feb 28, 2024
1 parent fdf5691 commit 770da47
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3878,6 +3878,8 @@ A user agent MAY retry this algorithm in the event that there was an error.

# Cross App and Web Algorithms # {#cross-app-and-web}

<h3 id="get-os-registrations">Get OS registrations</h3>

An <dfn>OS registration</dfn> is a [=struct=] with the following items:

<dl dfn-for="OS registration">
Expand Down Expand Up @@ -3913,6 +3915,8 @@ To <dfn noexport>get [=OS registrations=] from a header value</dfn> given a
1. If |registrations| [=list/is empty=], return null.
1. Return |registrations|.

<h3 id="set-os-support-headers">Set OS-support header</h3>

To <dfn export>get supported registrars</dfn>:

1. Let |supportedRegistrars| be an [=list/is empty|empty=] [=list=].
Expand All @@ -3937,6 +3941,31 @@ To <dfn noexport>set an OS-support header</dfn> given a [=header list=]
1. [=header list/Set a structured field value=] given
("<code>[=Attribution-Reporting-Support=]</code>", |dict|) in |headers|.

<h3 id="deliver-os-registrations-debug-reports">Deliver OS registration debug reports</h3>

To <dfn>obtain and deliver debug reports on OS registrations</dfn> given an
[=OS debug data type=] |dataType|, a [=list=] of [=OS registrations=] |registrations|,
and an [=origin=] |contextOrigin|:

1. If |registrations| [=list/is empty=], return.
1. Let |contextSite| be the result of [=obtaining a site=] from |contextOrigin|.
1. [=list/iterate|For each=] |registration| of |registrations|:
1. If |registration|'s [=OS registration/debug reporting enabled=] is false, [=iteration/continue=].
1. Let |origin| be |registration|'s [=OS registration/URL=]'s [=url/origin=].
1. If |origin| is not [=check if an origin is suitable|suitable=], [=iteration/continue=].
1. Let |body| be a new [=map=] with the following key/value pairs:
: "`context_site`"
:: |contextSite|, <a href="https://html.spec.whatwg.org/multipage/origin.html#serialization-of-a-site">serialized</a>.
: "`registration_url`"
:: |registration|'s [=OS registration/URL=], [=url serializer|serialized=].

1. Let |data| be a new [=attribution debug data=] with the items:
: [=attribution debug data/data type=]
:: |dataType|
: [=attribution debug data/body=]
:: |body|
1. Run [=obtain and deliver a debug report=] with « |data| » and |origin|.


# Report Verification Algorithms # {#report-verification}

Expand Down Expand Up @@ -4018,29 +4047,6 @@ To <dfn noexport>receive trigger verification tokens</dfn> given an

Issue: Specify the cryptographic redemption procedure.

To <dfn>obtain and deliver debug reports on OS registrations</dfn> given an
[=OS debug data type=] |dataType|, a [=list=] of [=OS registrations=] |registrations|,
and an [=origin=] |contextOrigin|:

1. If |registrations| [=list/is empty=], return.
1. Let |contextSite| be the result of [=obtaining a site=] from |contextOrigin|.
1. [=list/iterate|For each=] |registration| of |registrations|:
1. If |registration|'s [=OS registration/debug reporting enabled=] is false, [=iteration/continue=].
1. Let |origin| be |registration|'s [=OS registration/URL=]'s [=url/origin=].
1. If |origin| is not [=check if an origin is suitable|suitable=], [=iteration/continue=].
1. Let |body| be a new [=map=] with the following key/value pairs:
: "`context_site`"
:: |contextSite|, <a href="https://html.spec.whatwg.org/multipage/origin.html#serialization-of-a-site">serialized</a>.
: "`registration_url`"
:: |registration|'s [=OS registration/URL=], [=url serializer|serialized=].

1. Let |data| be a new [=attribution debug data=] with the items:
: [=attribution debug data/data type=]
:: |dataType|
: [=attribution debug data/body=]
:: |body|
1. Run [=obtain and deliver a debug report=] with « |data| » and |origin|.

# User-Agent Automation # {#automation}

The user-agent has an associated boolean <dfn>automation local testing mode</dfn> (default false).
Expand Down

0 comments on commit 770da47

Please sign in to comment.