|
| 1 | +[Exposed=Window, SecureContext] |
| 2 | +interface Credential { |
| 3 | + readonly attribute USVString id; |
| 4 | + readonly attribute DOMString type; |
| 5 | +}; |
| 6 | + |
| 7 | +[SecureContext] |
| 8 | +interface mixin CredentialUserData { |
| 9 | + readonly attribute USVString name; |
| 10 | + readonly attribute USVString iconURL; |
| 11 | +}; |
| 12 | + |
| 13 | +partial interface Navigator { |
| 14 | + [SecureContext, SameObject] readonly attribute CredentialsContainer credentials; |
| 15 | +}; |
| 16 | + |
| 17 | +[Exposed=Window, SecureContext] |
| 18 | +interface CredentialsContainer { |
| 19 | + Promise<Credential?> get(optional CredentialRequestOptions options); |
| 20 | + Promise<Credential> store(Credential credential); |
| 21 | + Promise<Credential?> create(optional CredentialCreationOptions options); |
| 22 | + Promise<void> preventSilentAccess(); |
| 23 | +}; |
| 24 | + |
| 25 | +dictionary CredentialData { |
| 26 | + required USVString id; |
| 27 | +}; |
| 28 | + |
| 29 | +dictionary CredentialRequestOptions { |
| 30 | + CredentialMediationRequirement mediation = "optional"; |
| 31 | + AbortSignal signal; |
| 32 | +}; |
| 33 | + |
| 34 | +enum CredentialMediationRequirement { |
| 35 | + "silent", |
| 36 | + "optional", |
| 37 | + "required" |
| 38 | +}; |
| 39 | + |
| 40 | +dictionary CredentialCreationOptions { |
| 41 | + AbortSignal signal; |
| 42 | +}; |
| 43 | + |
| 44 | +[Constructor(HTMLFormElement form), |
| 45 | + Constructor(PasswordCredentialData data), |
| 46 | + Exposed=Window, |
| 47 | + SecureContext] |
| 48 | +interface PasswordCredential : Credential { |
| 49 | + readonly attribute USVString password; |
| 50 | +}; |
| 51 | +PasswordCredential includes CredentialUserData; |
| 52 | + |
| 53 | +partial dictionary CredentialRequestOptions { |
| 54 | + boolean password = false; |
| 55 | +}; |
| 56 | + |
| 57 | +dictionary PasswordCredentialData : CredentialData { |
| 58 | + USVString name; |
| 59 | + USVString iconURL; |
| 60 | + required USVString origin; |
| 61 | + required USVString password; |
| 62 | +}; |
| 63 | + |
| 64 | +typedef (PasswordCredentialData or HTMLFormElement) PasswordCredentialInit; |
| 65 | + |
| 66 | +partial dictionary CredentialCreationOptions { |
| 67 | + PasswordCredentialInit password; |
| 68 | +}; |
| 69 | + |
| 70 | +[Constructor(FederatedCredentialInit data), |
| 71 | + Exposed=Window, |
| 72 | + SecureContext] |
| 73 | +interface FederatedCredential : Credential { |
| 74 | + readonly attribute USVString provider; |
| 75 | + readonly attribute DOMString? protocol; |
| 76 | +}; |
| 77 | +FederatedCredential includes CredentialUserData; |
| 78 | + |
| 79 | +dictionary FederatedCredentialRequestOptions { |
| 80 | + sequence<USVString> providers; |
| 81 | + sequence<DOMString> protocols; |
| 82 | +}; |
| 83 | + |
| 84 | +partial dictionary CredentialRequestOptions { |
| 85 | + FederatedCredentialRequestOptions federated; |
| 86 | +}; |
| 87 | + |
| 88 | +dictionary FederatedCredentialInit : CredentialData { |
| 89 | + USVString name; |
| 90 | + USVString iconURL; |
| 91 | + required USVString origin; |
| 92 | + required USVString provider; |
| 93 | + DOMString protocol; |
| 94 | +}; |
| 95 | + |
| 96 | +partial dictionary CredentialCreationOptions { |
| 97 | + FederatedCredentialInit federated; |
| 98 | +}; |
0 commit comments