Re: [w3c/push-api] Define and use the p256dh/auth internal slots (PR #414)

@annevk approved this pull request.

Nice cleanup! Looks good modulo a number of nits.

> @@ -735,9 +735,8 @@ <h2>
           SHOULD attempt to <a>refresh</a> the push subscription before the subscription expires.
         </p>
         <p>
-          A <a>push subscription</a> has internal slots for a P-256 <a>ECDH</a> key pair and an
-          authentication secret in accordance with [[RFC8291]]. These slots MUST be populated when
-          creating the <a>push subscription</a>.
+          A [=push subscription=] has an associated <dfn>P-256 ECDH key pair</dfn> and an
+          <dfn>authentication secret</dfn> in accordance with [[RFC8291]].

Would be nice to (eventually) define their types as well.

>          </li>
-        <li>If the internal slot contains an asymmetric key pair, set the contents of |key| to the
-        serialized value of the public key from the key pair. This uses the serialization format
-        described in the specification that defines the name. For example, [[RFC8291]] specifies
-        that the {{PushEncryptionKeyName/"p256dh"}} public key is encoded using the uncompressed
-        format defined in [[ANSI-X9-62]] Annex A (that is, a 65 octet sequence that starts with a
-        0x04 octet).
+        <li>If |name| is {{PushEncryptionKeyName/"p256dh"}}:
+          <ol>
+            <li>Set the contents of |key| to the serialized value of the public key from
+            [=P-256 ECDH key pair=], using the uncompressed format defined in [[ANSI-X9-62]] Annex

this's P-256 ...*

>          </li>
-        <li>Otherwise, if the internal slot contains a symmetric key, set the contents of |key| to
-        a copy of the value from the internal slot. For example, the `auth` parameter contains an
-        octet sequence used by the <a>user agent</a> to authenticate messages sent by an
-        <a>application server</a>.
+        <li>Otherwise:
+          <ol>
+            <li>[=/Assert=]: |name| is {{PushEncryptionKeyName/"auth"}}</li>
+            <li>Set the contents of |key| to a copy of the value from [=authentication secret=].

this's authentication ...*

> -        {{PushSubscription}}, ordered by the name of the key:
-          <ol>
-            <li>If the internal slot corresponds to an asymmetric key pair, let |b| be the encoded
-            value of the public key corresponding to the key name |i|, using the encoding defined
-            for the key name (see {{PushSubscription/getKey()}}).
-            </li>
-            <li>Otherwise, let |b| be the value as returned by {{PushSubscription/getKey}}.
-            </li>
-            <li>Let |s| be the URL-safe base64 encoding without padding [[RFC4648]] of |b| as a
-            {{USVString}}. The <a>user agent</a> MUST use a serialization method that does not
-            branch based on the value of |b|.
-            </li>
-            <li>Set |keys|[|i|] to |s|.
-            </li>
-          </ol>
+        <li>Set |keys|["p256dh"] be the URL-safe base64 encoding without padding [[RFC4648]] of

Set ... to*

> -            value of the public key corresponding to the key name |i|, using the encoding defined
-            for the key name (see {{PushSubscription/getKey()}}).
-            </li>
-            <li>Otherwise, let |b| be the value as returned by {{PushSubscription/getKey}}.
-            </li>
-            <li>Let |s| be the URL-safe base64 encoding without padding [[RFC4648]] of |b| as a
-            {{USVString}}. The <a>user agent</a> MUST use a serialization method that does not
-            branch based on the value of |b|.
-            </li>
-            <li>Set |keys|[|i|] to |s|.
-            </li>
-          </ol>
+        <li>Set |keys|["p256dh"] be the URL-safe base64 encoding without padding [[RFC4648]] of
+        the value as returned by {{PushSubscription/getKey("p256dh")}}, as a {{USVString}}.
+        </li>
+        <li>Set |keys|["auth"] be the URL-safe base64 encoding without padding [[RFC4648]] of

Ditto

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/pull/414#pullrequestreview-3503535092
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/push-api/pull/414/review/3503535092@github.com>

Received on Tuesday, 25 November 2025 07:10:01 UTC