Skip to content

Commit 2b6558d

Browse files
committed
Update RPID validation
1 parent 134c4c2 commit 2b6558d

File tree

1 file changed

+50
-45
lines changed

1 file changed

+50
-45
lines changed

index.bs

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,7 @@ value and terminate the operation.
29532953

29542954
</div>
29552955

2956-
### Signal Credential Changes to the Authenticator - PublicKeyCredential's [=signal methods=] ### {#sctn-signalMethods}
2956+
### Signal Credential Changes to the Authenticator - PublicKeyCredential's [=signal methods=] ### {#sctn-signal-methods}
29572957

29582958
<xmp class="idl">
29592959
partial interface PublicKeyCredential {
@@ -2963,18 +2963,18 @@ value and terminate the operation.
29632963
};
29642964

29652965
dictionary UnknownCredentialIdOptions {
2966-
required USVString rpId;
2966+
required DOMString rpId;
29672967
required Base64URLString credentialId;
29682968
};
29692969

29702970
dictionary AllAcceptedCredentialIdsOptions {
2971-
required USVString rpId;
2971+
required DOMString rpId;
29722972
required Base64URLString userId;
29732973
required sequence<Base64URLString> allAcceptedCredentialIds;
29742974
};
29752975

29762976
dictionary CurrentUserDetailsOptions {
2977-
required USVString rpId;
2977+
required DOMString rpId;
29782978
required Base64URLString userId;
29792979
required DOMString name;
29802980
required DOMString displayName;
@@ -3008,6 +3008,28 @@ finish executing the [=signal method/authenticator actions=] to protect users
30083008
from [=[WRPS]=] gaining information about availability of their credentials
30093009
without [=user consent=] from the timing of the request.
30103010

3011+
#### <dfn abstract-op>Asynchronous RP ID validation algorithm</dfn> #### {#sctn-signal-methods-async-rp-id-validation}
3012+
3013+
The [$Asynchronous RP ID validation algorithm$] lets [=signal methods=] validate
3014+
[=RP IDs=] [=in parallel=]. The algorithm takes a {{DOMString}} |rpId| as input
3015+
and returns a promise that rejects if the validation fails. The steps are:
3016+
3017+
1. Let |effectiveDomain| be the |callerOrigin|'s [=effective domain=]. If
3018+
[=effective domain=] is not a [=valid domain=], then return [=a promise
3019+
rejected with=] "{{SecurityError}}" {{DOMException}}.
3020+
1. If |rpId| [=is a registrable domain suffix of or is equal to=]
3021+
|effectiveDomain|, return [=a promise resolved with=] undefined.
3022+
1. If the client does not support [[#sctn-related-origins|related origin
3023+
requests]], return [=a promise rejected with=] a "{{SecurityError}}"
3024+
{{DOMException}}.
3025+
1. Let |p| be [=a new promise=].
3026+
1. Execute the following steps [=in parallel=]:
3027+
1. If the result of running the [$related origins validation procedure$]
3028+
with arguments |callerOrigin| and |rpId| is [TRUE], then [=resolve=]
3029+
|p|.
3030+
1. Otherwise, [=reject=] |p| with a "{{SecurityError}}" {{DOMException}}.
3031+
1. Return |p|.
3032+
30113033
#### {{PublicKeyCredential/signalUnknownCredentialId(options)}} #### {#sctn-signalUnknownCredentialId}
30123034

30133035
Signals that a [=credential id=] was not recognized by the [=[WRP]=], e.g.
@@ -3020,26 +3042,18 @@ and the [=userHandle=], avoiding a privacy leak to an unauthenticated caller
30203042
Upon execution of {{PublicKeyCredential/signalUnknownCredentialId(options)}},
30213043
the [=client=] executes these steps:
30223044

3023-
1. Let |effectiveDomain| be the |callerOrigin|'s [=effective domain=]. If
3024-
[=effective domain=] is not a [=valid domain=], then throw a
3025-
"{{SecurityError}}" {{DOMException}}.
3026-
1. If <code>|options|.{{UnknownCredentialIdOptions/rpId}}</code> [=is not a
3027-
registrable domain suffix of and is not equal to=] |effectiveDomain|, then
3028-
throw a "{{SecurityError}}" {{DOMException}}.
3029-
3030-
TODO: this may require updating once #2040 lands.
30313045
1. If the result of [=base64url encoding | base64url decoding=]
30323046
<code>|options|.{{UnknownCredentialIdOptions/credentialId}}</code> is an
3033-
error, then throw a {{TypeError}}.
3047+
error, then return [=a promise rejected with=] a {{TypeError}}.
3048+
1. Let |p| be the result of executing the [$Asynchronous RP ID validation
3049+
algorithm$] with <code>|options|.{{UnknownCredentialIdOptions/rpId}}</code>.
3050+
1. [=Upon fulfillment=] of |p|, run the following steps [=in parallel=]:
3051+
1. For every [=authenticator=] presently available on this [=client
3052+
platform=], invoke the [=signal method/authenticator
3053+
action/unknownCredentialId=] [=authenticator action=] with |options| as
3054+
input.
3055+
1. Return |p|.
30343056

3035-
1. Run the following steps [=in parallel=]:
3036-
1. For every [=authenticator=] presently available on this [=client
3037-
platform=], invoke the [=signal method/authenticator
3038-
action/unknownCredentialId=] [=authenticator action=] with |options|
3039-
as input.
3040-
3041-
1. Return [=a promise resolved with=] `undefined`.
3042-
30433057
The <dfn for="signal method/authenticator action">unknownCredentialId</dfn>
30443058
[=signal method/authenticator action=] takes an {{UnknownCredentialIdOptions}}
30453059
|options| and is as follows:
@@ -3082,27 +3096,23 @@ Upon execution of
30823096
{{PublicKeyCredential/signalAllAcceptedCredentialIds(options)}}, the [=client=]
30833097
executes these steps:
30843098

3085-
1. Let |effectiveDomain| be the |callerOrigin|'s [=effective domain=]. If
3086-
[=effective domain=] is not a [=valid domain=], then throw a
3087-
"{{SecurityError}}" {{DOMException}}.
3088-
1. If <code>|options|.{{AllAcceptedCredentialIdsOptions/rpId}}</code> [=is not a
3089-
registrable domain suffix of and is not equal to=] |effectiveDomain|, then
3090-
throw a "{{SecurityError}}" {{DOMException}}.
3091-
3092-
TODO: this may require updating once #2040 lands.
30933099
1. If the result of [=base64url encoding | base64url decoding=]
30943100
<code>|options|.{{AllAcceptedCredentialIdsOptions/userId}}</code> is an
3095-
error, then throw a {{TypeError}}.
3101+
error, then return [=a promise rejected with=] a {{TypeError}}.
30963102
1. [=list/For each=] |credentialId| in
30973103
<code>|options|.{{AllAcceptedCredentialIdsOptions/allAcceptedCredentialIds}}</code>:
30983104
1. If the result of [=base64url encoding | base64url decoding=]
3099-
|credentialId| is an error, then throw a {{TypeError}}.
3100-
3101-
1. Run the following steps [=in parallel=]:
3105+
|credentialId| is an error, then return [=a promise rejected with=] a
3106+
{{TypeError}}.
3107+
1. Let |p| be the result of executing the [$Asynchronous RP ID validation
3108+
algorithm$] with
3109+
<code>|options|.{{AllAcceptedCredentialIdsOptions/rpId}}</code>.
3110+
1. [=Upon fulfillment=] of |p|, run the following steps [=in parallel=]:
31023111
1. For every [=authenticator=] presently available on this [=client
31033112
platform=], invoke the [=signal method/authenticator
31043113
actions/allAcceptedCredentialIds=] [=authenticator action=] with
31053114
|options| as input.
3115+
1. Return |p|.
31063116

31073117
The <dfn for="signal method/authenticator
31083118
actions">allAcceptedCredentialIds</dfn> [=signal method/authenticator
@@ -3169,23 +3179,18 @@ Signals the user's current {{PublicKeyCredentialEntity/name}} and
31693179
Upon execution of {{PublicKeyCredential/signalCurrentUserDetails(options)}}, the
31703180
[=client=] executes these steps:
31713181

3172-
1. Let |effectiveDomain| be the |callerOrigin|'s [=effective domain=]. If
3173-
[=effective domain=] is not a [=valid domain=], then throw a
3174-
"{{SecurityError}}" {{DOMException}}.
3175-
1. If <code>|options|.{{CurrentUserDetailsOptions/rpId}}</code> [=is not a
3176-
registrable domain suffix of and is not equal to=] |effectiveDomain|, then
3177-
throw a "{{SecurityError}}" {{DOMException}}.
3178-
3179-
TODO: this may require updating once #2040 lands.
31803182
1. If the result of [=base64url encoding | base64url decoding=]
3181-
<code>|options|.{{CurrentUserDetailsOptions/userId}}</code> is an error, then
3182-
throw a {{TypeError}}.
3183-
3184-
1. Run the following steps [=in parallel=]:
3183+
<code>|options|.{{CurrentUserDetailsOptions/userId}}</code> is an error,
3184+
then return [=a promise rejected with=] a {{TypeError}}.
3185+
1. Let |p| be the result of executing the [$Asynchronous RP ID validation
3186+
algorithm$] with
3187+
<code>|options|.{{CurrentUserDetailsOptions/rpId}}</code>.
3188+
1. [=Upon fulfillment=] of |p|, run the following steps [=in parallel=]:
31853189
1. For every [=authenticator=] presently available on this [=client
31863190
platform=], invoke the [=signal method/authenticator
31873191
actions/currentUserDetails=] [=authenticator action=] with |options|
31883192
as input.
3193+
1. Return |p|.
31893194

31903195
The <dfn for="signal method/authenticator actions">currentUserDetails</dfn>
31913196
[=signal method/authenticator action=] takes a {{CurrentUserDetailsOptions}}

0 commit comments

Comments
 (0)