Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: components/signin/core/browser/signin_header_helper.h

Issue 2918403009: [Dice] Parse the Dice response header (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/signin/core/browser/signin_header_helper.h
diff --git a/components/signin/core/browser/signin_header_helper.h b/components/signin/core/browser/signin_header_helper.h
index 948d8718c90dd3371c399001b4dc478fe9a9fdea..70d144ce6aae19df3463238091bb2afd2a68f976 100644
--- a/components/signin/core/browser/signin_header_helper.h
+++ b/components/signin/core/browser/signin_header_helper.h
@@ -9,6 +9,7 @@
#include <string>
#include "build/build_config.h"
+#include "url/gurl.h"
namespace content_settings {
class CookieSettings;
@@ -18,8 +19,6 @@ namespace net {
class URLRequest;
}
-class GURL;
-
namespace signin {
// Profile mode flags.
@@ -47,6 +46,13 @@ enum GAIAServiceType {
GAIA_SERVICE_TYPE_DEFAULT, // All other cases.
};
+enum class DiceAction {
+ NONE,
+ SIGNIN, // Sign in an account.
+ SIGNOUT, // Sign out of all sessions.
+ SINGLE_SESSION_SIGNOUT // Sign out of a single session.
msarda 2017/06/12 11:52:21 I think I would not implement the single sign-out
droger 2017/06/12 12:39:14 Currently, all I'm doing is parsing the header. No
msarda 2017/06/12 14:03:42 That's why I thought. But I do not have a strong p
+};
+
// Struct describing the paramters received in the manage account header.
struct ManageAccountsParams {
// The requested service type such as "ADDSESSION".
@@ -73,6 +79,34 @@ struct ManageAccountsParams {
ManageAccountsParams(const ManageAccountsParams& other);
};
+// Struct describing the paramters received in the Dice response header.
msarda 2017/06/12 11:52:21 s/paramters/parameters
droger 2017/06/12 12:39:14 Done.
+struct DiceResponseParams {
+ DiceResponseParams();
+ ~DiceResponseParams();
+ DiceResponseParams(const DiceResponseParams& other);
+
+ DiceAction user_intention;
+
+ // ID of the account signed in or signed out. When |user_intention| is
+ // SIGNOUT, this is the ID of the primary account.
msarda 2017/06/12 11:52:21 "this is the Gaia ID of the account that was signe
droger 2017/06/12 12:39:14 Added the clarifications. FYI: My comments were c
+ std::string obfuscated_gaia_id;
+
+ // Email of the account signed in or signed out. When |user_intention| is
+ // SIGNOUT, this is the email of the primary account.
+ std::string email;
+
+ // Session index for the account signed in or signed out. When
+ // |user_intention| is SIGNOUT, this is 0.
+ std::string session_index;
droger 2017/06/09 14:51:07 I'm not quite sure what it is, but that should pro
msarda 2017/06/12 11:52:21 This is the index of the account in the Gaia authe
droger 2017/06/12 12:39:16 Done.
+
+ // Optional.
+ std::string authorization_code;
msarda 2017/06/12 11:52:21 This should be set when action is SIGNIN (otherwis
droger 2017/06/12 12:39:15 Done.
+
+ // Logout URL Chrome should call after revoking LSTs in sign out flow.
+ // Optional.
+ GURL logout_url;
msarda 2017/06/12 11:52:21 Should be set when action is SIGNOUT.
droger 2017/06/12 12:39:15 Done.
+};
+
// Base class for managing the signin headers (Dice and Chrome-Connected).
class SigninHeaderHelper {
public:
@@ -146,6 +180,12 @@ void AppendOrRemoveAccountConsistentyRequestHeader(
// header.
ManageAccountsParams BuildManageAccountsParams(const std::string& header_value);
+#if !defined(OS_IOS) && !defined(OS_ANDROID)
+// Returns the parameters contained in the X-Chrome-ID-Consistency-Response
+// response header.
+DiceResponseParams BuildDiceResponseParams(const std::string& header_value);
+#endif
+
} // namespace signin
#endif // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_HEADER_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698