OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 [JavaPackage="org.chromium.webauth.mojom"] | 5 [JavaPackage="org.chromium.webauth.mojom"] |
6 module webauth.mojom; | 6 module webauth.mojom; |
7 | 7 |
| 8 enum AuthenticatorStatus { |
| 9 SUCCESS, |
| 10 CANCELLED, |
| 11 UNKNOWN_ERROR, |
| 12 NOT_ALLOWED_ERROR, |
| 13 NOT_SUPPORTED_ERROR, |
| 14 SECURITY_ERROR, |
| 15 }; |
| 16 |
8 struct ScopedCredentialInfo { | 17 struct ScopedCredentialInfo { |
9 array<uint8> client_data; | 18 array<uint8> client_data; |
10 array<uint8> attestation; | 19 array<uint8> attestation; |
11 }; | 20 }; |
12 | 21 |
| 22 /* The rpDisplayName member contains the friendly name of the Relying Party, suc
h as "Acme Corporation", "Widgets Inc" or "Awesome Site". |
| 23 |
| 24 The displayName member contains the friendly name associated with the user accou
nt by the Relying Party, such as "John P. Smith". |
| 25 |
| 26 The id member contains an identifier for the account, specified by the Relying P
arty. This is not meant to be displayed to the user. It is used by the Relying P
arty to control the number of credentials - an authenticator will never contain
more than one credential for a given Relying Party under the same id. |
| 27 |
| 28 The name member contains a detailed name for the account, such as "john.p.smith@
example.com".*/ |
| 29 |
13 struct RelyingPartyAccount { | 30 struct RelyingPartyAccount { |
| 31 // Friendly name of the Relying Party, e.g. "Acme Corporation" |
14 string rp_display_name; | 32 string rp_display_name; |
| 33 // Friendly name associated with the user account, e.g. "John P. Smith" |
15 string display_name; | 34 string display_name; |
16 string id; | 35 // Identifier for the account, corresponding to no more than one credential |
17 string name; | 36 // per authenticator and Relying Party. |
| 37 string id; |
| 38 // Detailed name for the account, e.g. john.p.smith@example.com |
| 39 string? name; |
18 // TODO(kpaulhamus): Make this url.mojom.Url in followup CL | 40 // TODO(kpaulhamus): Make this url.mojom.Url in followup CL |
19 string image_url; | 41 string? image_url; |
20 }; | 42 }; |
21 | 43 |
22 struct ScopedCredentialParameters { | 44 struct ScopedCredentialParameters { |
23 ScopedCredentialType type; | 45 ScopedCredentialType type; |
24 // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; | 46 // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; |
25 }; | 47 }; |
26 | 48 |
27 struct ScopedCredentialOptions { | 49 struct ScopedCredentialOptions { |
28 // TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL | 50 //TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL |
29 uint32 timeout_seconds; | 51 double adjusted_timeout; |
30 string rp_id; | 52 string? rp_id; |
31 array<ScopedCredentialDescriptor> exclude_list; | 53 array<ScopedCredentialDescriptor> exclude_list; |
32 // TODO(kpaulhamus): add Extensions | 54 // TODO(kpaulhamus): add Extensions |
33 }; | 55 }; |
34 | 56 |
35 enum ScopedCredentialType { | 57 enum ScopedCredentialType { |
36 SCOPEDCRED, | 58 SCOPEDCRED, |
37 }; | 59 }; |
38 | 60 |
39 struct ScopedCredentialDescriptor { | 61 struct ScopedCredentialDescriptor { |
40 ScopedCredentialType type; | 62 ScopedCredentialType type; |
41 array<uint8> id; | 63 array<uint8> id; |
42 array<Transport> transports; | 64 array<Transport> transports; |
43 }; | 65 }; |
44 | 66 |
45 enum Transport { | 67 enum Transport { |
46 USB, | 68 USB, |
47 NFC, | 69 NFC, |
48 BLE, | 70 BLE, |
49 }; | 71 }; |
50 | 72 |
| 73 // TODO add comments everywhere |
| 74 // |account_information|: |
51 interface Authenticator { | 75 interface Authenticator { |
52 makeCredential(RelyingPartyAccount account_information, | 76 MakeCredential(RelyingPartyAccount account_information, |
53 array<ScopedCredentialParameters> crypto_parameters, | 77 array<ScopedCredentialParameters> crypto_parameters, |
54 array<uint8> attestation_challenge, | 78 array<uint8> attestation_challenge, |
55 ScopedCredentialOptions? options) | 79 ScopedCredentialOptions options) |
56 => (array<ScopedCredentialInfo> scoped_credentials); | 80 => (AuthenticatorStatus status, |
| 81 ScopedCredentialInfo? scoped_credential); |
57 }; | 82 }; |
OLD | NEW |