OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 #ifndef SERVICES_AUTHENTICATION_AUTH_DATA_H_ | |
6 #define SERVICES_AUTHENTICATION_AUTH_DATA_H_ | |
7 | |
8 #include <string> | |
9 | |
10 namespace authentication { | |
11 | |
12 // AuthData struct is used to persist auth tokens for the authentication | |
13 // service onto a Database file. | |
14 struct AuthData { | |
15 AuthData(); | |
jln (very slow on Chromium)
2015/12/08 22:27:29
Fine to put trivial constructor/destructor inline
ukode
2015/12/16 19:24:13
Acknowledged. But inlining led to compile time err
| |
16 ~AuthData(); | |
17 | |
18 // The user's unique account name such as email id. | |
19 std::string username; | |
20 // The type of authentication service provider such as Google, Facebook, | |
21 // Twitter. | |
22 std::string auth_provider; | |
23 // Password or equivalent token grant that acts as the key to user data such | |
24 // as encrypted password or fully scoped master OAuth token. | |
25 std::string persistent_credential; | |
26 // The type of credential whether it is plain password, encrypted password, | |
27 // fully scoped master OAuth token or downscoped token. | |
28 std::string persistent_credential_type; | |
29 // List of permissible scopes for this saved grant. | |
30 std::string scopes; | |
31 }; | |
32 | |
33 // Returns a string representation for AuthData. | |
34 std::string GetAuthDataAsString(const AuthData& auth_data); | |
jln (very slow on Chromium)
2015/12/08 22:27:29
Should these be static method in an AuthData class
ukode
2015/12/16 19:24:13
+Mitch - thoughts?
| |
35 | |
36 // Parses and creates an AuthData instance from a string representation. | |
37 AuthData* GetAuthDataFromString(const std::string& str); | |
38 | |
39 } // namespace authentication | |
40 | |
41 #endif // SERVICES_AUTHENTICATION_AUTH_DATA_H_ | |
OLD | NEW |