Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 module authentication; | |
| 6 | |
| 7 // Specifies if the type of stored credential is a plain text password, | |
| 8 // password in encrypted form, fully scoped master OAuth token or | |
| 9 // downscoped OAuth token. | |
| 10 enum CredentialType { | |
| 11 PLAIN_PASSWORD = 1, | |
| 12 ENCRYPTED_PASSWORD, | |
| 13 FULL_SCOPED_OAUTH_REFRESH_TOKEN, | |
| 14 DOWNSCOPED_OAUTH_REFRESH_TOKEN | |
|
qsr
2016/03/04 15:06:46
Can you remove everything we do not use?
ukode
2016/03/11 22:48:52
Done.
| |
| 15 }; | |
| 16 | |
| 17 enum AuthProvider { | |
| 18 GOOGLE = 1, | |
| 19 FACEBOOK, | |
| 20 TWITTER | |
|
qsr
2016/03/04 15:06:45
Same here.
ukode
2016/03/11 22:48:52
Done.
| |
| 21 }; | |
| 22 | |
| 23 // This struct is used to persist long lived credentials for each user and is | |
| 24 // not passed between services. | |
| 25 struct Credentials { | |
| 26 // The type of authentication service provider such as Google, Facebook, | |
| 27 // Twitter, or Amazon. | |
| 28 AuthProvider auth_provider; | |
| 29 // Password or equivalent token grant that acts as the key to user data such | |
| 30 // as encrypted password or fully scoped master OAuth token. | |
| 31 string token; | |
| 32 // Type of stored credential. | |
| 33 CredentialType credential_type; | |
| 34 // List of permissible scopes for this saved grant. | |
| 35 string scopes; | |
| 36 }; | |
| 37 | |
| 38 // Database for the credentials database implementation. | |
| 39 struct CredentialStore { | |
| 40 // Version of the database. | |
| 41 uint32 version; | |
| 42 // Map from user account to credentials. User account is identified by a | |
| 43 // user's unique account name such as email id. | |
| 44 map<string, Credentials> credentials; | |
| 45 }; | |
| OLD | NEW |