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

@annevk commented on this pull request.



> -          <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"] to the URL-safe base64 encoding without padding [[RFC4648]] of
+        the value as returned by {{PushSubscription/getKey("p256dh")}}, as a {{USVString}}.

I guess this isn't entirely a regression, but using the public API is not great. We should have an internal "get key" for this.

> @@ -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]].

Yeah, probably best as a follow-up. It could better explain getKey and such.

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

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

Received on Tuesday, 25 November 2025 15:07:45 UTC