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 DOWNSCOPED_OAUTH_REFRESH_TOKEN = 1 |
| 12 }; |
| 13 |
| 14 // Specifies the type of identity provider for authenticating user. |
| 15 enum AuthProvider { |
| 16 GOOGLE = 1 |
| 17 }; |
| 18 |
| 19 // This struct is used to persist long lived credentials for each user and is |
| 20 // not passed between services. |
| 21 struct Credentials { |
| 22 // The type of authentication service provider such as Google, Facebook, |
| 23 // Twitter, or Amazon. |
| 24 AuthProvider auth_provider; |
| 25 // Password or equivalent token grant that acts as the key to user data such |
| 26 // as encrypted password or fully scoped master OAuth token. |
| 27 string token; |
| 28 // Type of stored credential. |
| 29 CredentialType credential_type; |
| 30 // List of permissible scopes for this saved grant. |
| 31 string scopes; |
| 32 }; |
| 33 |
| 34 // Database for the credentials database implementation. |
| 35 struct CredentialStore { |
| 36 // Version of the database. |
| 37 uint32 version; |
| 38 // Map from user account to credentials. User account is identified by a |
| 39 // user's unique account name such as email id. |
| 40 map<string, Credentials> credentials; |
| 41 }; |
OLD | NEW |