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 |
13 struct RelyingPartyAccount { | 22 struct RelyingPartyAccount { |
| 23 // Friendly name of the Relying Party, e.g. "Acme Corporation" |
14 string rp_display_name; | 24 string rp_display_name; |
| 25 // Friendly name associated with the user account, e.g. "John P. Smith" |
15 string display_name; | 26 string display_name; |
16 string id; | 27 // Identifier for the account, corresponding to no more than one credential |
17 string name; | 28 // per authenticator and Relying Party. |
| 29 string id; |
| 30 // Detailed name for the account, e.g. john.p.smith@example.com |
| 31 string? name; |
18 // TODO(kpaulhamus): Make this url.mojom.Url in followup CL | 32 // TODO(kpaulhamus): Make this url.mojom.Url in followup CL |
19 string image_url; | 33 string? image_url; |
20 }; | 34 }; |
21 | 35 |
22 struct ScopedCredentialParameters { | 36 struct ScopedCredentialParameters { |
23 ScopedCredentialType type; | 37 ScopedCredentialType type; |
24 // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; | 38 // TODO(kpaulhamus): add AlgorithmIdentifier algorithm; |
25 }; | 39 }; |
26 | 40 |
27 struct ScopedCredentialOptions { | 41 struct ScopedCredentialOptions { |
28 // TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL | 42 //TODO(kpaulhamus): Make this mojo.common.mojom.TimeDelta in followup CL |
29 uint32 timeout_seconds; | 43 double adjusted_timeout; |
30 string rp_id; | 44 string? rp_id; |
31 array<ScopedCredentialDescriptor> exclude_list; | 45 array<ScopedCredentialDescriptor> exclude_list; |
32 // TODO(kpaulhamus): add Extensions | 46 // TODO(kpaulhamus): add Extensions |
33 }; | 47 }; |
34 | 48 |
35 enum ScopedCredentialType { | 49 enum ScopedCredentialType { |
36 SCOPEDCRED, | 50 SCOPEDCRED, |
37 }; | 51 }; |
38 | 52 |
39 struct ScopedCredentialDescriptor { | 53 struct ScopedCredentialDescriptor { |
40 ScopedCredentialType type; | 54 ScopedCredentialType type; |
41 array<uint8> id; | 55 array<uint8> id; |
42 array<Transport> transports; | 56 array<Transport> transports; |
43 }; | 57 }; |
44 | 58 |
45 enum Transport { | 59 enum Transport { |
46 USB, | 60 USB, |
47 NFC, | 61 NFC, |
48 BLE, | 62 BLE, |
49 }; | 63 }; |
50 | 64 |
| 65 // TODO add comments everywhere |
| 66 // |account_information|: |
51 interface Authenticator { | 67 interface Authenticator { |
52 makeCredential(RelyingPartyAccount account_information, | 68 MakeCredential(RelyingPartyAccount account_information, |
53 array<ScopedCredentialParameters> crypto_parameters, | 69 array<ScopedCredentialParameters> crypto_parameters, |
54 array<uint8> attestation_challenge, | 70 array<uint8> attestation_challenge, |
55 ScopedCredentialOptions? options) | 71 ScopedCredentialOptions options) |
56 => (array<ScopedCredentialInfo> scoped_credentials); | 72 => (AuthenticatorStatus status, |
| 73 ScopedCredentialInfo? scoped_credential); |
57 }; | 74 }; |
OLD | NEW |