Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disallow empty credential selection #250

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -951,31 +951,30 @@ spec:css-syntax-3;
1. Assert: |settings| is a [=secure context=].

1. If |settings|'s [=relevant global object=]'s [=associated Document=] is not [=Document/fully active=],
then return [=a promise rejected with=] "{{NotAllowedError}}" {{DOMException}}.
then return [=a promise rejected with=] a "{{NotAllowedError}}" {{DOMException}}.

1. If <code>|options|.{{CredentialRequestOptions/signal}}</code> is [=AbortSignal/aborted=],
then return [=a promise rejected with=]
<code>|options|.{{CredentialRequestOptions/signal}}</code>'s [=AbortSignal/abort reason=].

1. If <code>|options|.{{CredentialRequestOptions/mediation}}</code> is
"{{CredentialMediationRequirement/conditional}}":

1. For each |interface| in |options|' [=relevant credential interface objects=]:

1. If |interface| does not support {{CredentialMediationRequirement/conditional}}
[=user mediation=], return [=a promise rejected with=] a "{{TypeError}}" {{DOMException}}.
1. Let |interfaces| be |options|'s [=relevant credential interface objects=].

1. Let |p| be [=a new promise=].
1. If |interfaces| is [=set/empty=], then return[=a promise rejected with=]
a "{{NotSupportedError}}" {{DOMException}}.

1. For each |interface| in |options|' <a>relevant credential interface objects</a>:
1. [=set/For each=] |interface| of |interfaces|:

1. If |settings|' [=active credential types=] [=set/contains=] |interface|'s
{{Credential/[[type]]}}, return [=a promise rejected with=] a "{{NotAllowedError}}"
{{DOMException}}.
1. If |options|.{{CredentialRequestOptions/mediation}} is
{{CredentialMediationRequirement/conditional}} and |interface| does
not support {{CredentialMediationRequirement/conditional}}
[=user mediation=], return [=a promise rejected with=]
a "{{TypeError}}" {{DOMException}}.

1. For each |interface| in |options|' <a>relevant credential interface objects</a>:
1. If |settings|' [=active credential types=] [=set/contains=] |interface|'s
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
{{Credential/[[type]]}}, return [=a promise rejected with=]
a "{{NotAllowedError}}" {{DOMException}}.

1. [=set/Append=] |interface|'s {{Credential/[[type]]}} to |settings|'
1. [=set/Append=] |interface|'s {{Credential/[[type]]}} to |settings|'
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
[=active credential types=].

1. Let |origin| be |settings|' [=environment settings object/origin=].
Expand All @@ -999,6 +998,8 @@ spec:css-syntax-3;
[=credential type registry/credential types=] are not presently treated as
[=policy-controlled features=], although this may change in the future.

1. Let |p| be [=a new promise=].

1. Run the following steps [=in parallel=]:

1. Let |credentials| be the result of <a abstract-op lt="collect local">collecting
Expand Down Expand Up @@ -1063,10 +1064,10 @@ spec:css-syntax-3;

1. [=React=] to |p|:

1. For each |interface| in |options|' <a>relevant credential interface objects</a>:
1. For each |interface| in |interfaces|:

1. [=set/Remove=] |interface|'s {{Credential/[[type]]}} from |settings|'
[=active credential types=].
[=active credential types=].

1. Return |p|.
</ol>
Expand Down
Loading