Commit bf1be9f4 authored by Pavol Marko's avatar Pavol Marko Committed by Chromium LUCI CQ

Remove refs to ACCOUNT_TYPE_SESSIONLESS_USER

Remove all references of ACCOUNT_TYPE_SESSIONLESS_USER from
SessionManagerClient, in preparation of removing this account type from
session_manager.
The only user of this account type was PreSigninPolicyFetcher which was
removed in CL:2513205

Bug: 832127
Change-Id: I3b8e8a9fdfb38c5cc925a1c77dafc3a96297b054
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2513584
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836801}
parent 6e08fea7
...@@ -102,8 +102,6 @@ void UserPolicyMixin::SetUpPolicy() { ...@@ -102,8 +102,6 @@ void UserPolicyMixin::SetUpPolicy() {
const cryptohome::AccountIdentifier cryptohome_id = const cryptohome::AccountIdentifier cryptohome_id =
cryptohome::CreateAccountIdentifierFromAccountId(account_id_); cryptohome::CreateAccountIdentifierFromAccountId(account_id_);
FakeSessionManagerClient::Get()->set_user_policy(cryptohome_id, policy_blob); FakeSessionManagerClient::Get()->set_user_policy(cryptohome_id, policy_blob);
FakeSessionManagerClient::Get()->set_user_policy_without_session(
cryptohome_id, policy_blob);
if (policy_server_) { if (policy_server_) {
policy_server_->UpdateUserPolicy(user_policy_builder_.payload(), policy_server_->UpdateUserPolicy(user_policy_builder_.payload(),
......
...@@ -41,8 +41,8 @@ class ComponentActiveDirectoryPolicyService : public SchemaRegistry::Observer { ...@@ -41,8 +41,8 @@ class ComponentActiveDirectoryPolicyService : public SchemaRegistry::Observer {
// //
// |account_type| and |account_id| specify the Session Manager store from // |account_type| and |account_id| specify the Session Manager store from
// which policy is retrieved. |account_id| must be the user's cryptohome id // which policy is retrieved. |account_id| must be the user's cryptohome id
// for ACCOUNT_TYPE_USER and empty for ACCOUNT_TYPE_DEVICE. Not suppored yet // for ACCOUNT_TYPE_USER and empty for ACCOUNT_TYPE_DEVICE.
// are ACCOUNT_TYPE_SESSIONLESS_USER and ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT. // ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT is not yet supported.
// //
// Usually, |scope|, |domain|, |account_type| and |account_id| are coupled: // Usually, |scope|, |domain|, |account_type| and |account_id| are coupled:
// For user-level policy, use: // For user-level policy, use:
......
...@@ -149,7 +149,6 @@ base::FilePath GetStubRelativePolicyPath( ...@@ -149,7 +149,6 @@ base::FilePath GetStubRelativePolicyPath(
return base::FilePath(kStubDevicePolicyFileNamePrefix + postfix); return base::FilePath(kStubDevicePolicyFileNamePrefix + postfix);
case login_manager::ACCOUNT_TYPE_USER: case login_manager::ACCOUNT_TYPE_USER:
case login_manager::ACCOUNT_TYPE_SESSIONLESS_USER:
case login_manager::ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT: { case login_manager::ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT: {
DCHECK(descriptor.has_account_id()); DCHECK(descriptor.has_account_id());
cryptohome::AccountIdentifier cryptohome_id; cryptohome::AccountIdentifier cryptohome_id;
...@@ -159,9 +158,10 @@ base::FilePath GetStubRelativePolicyPath( ...@@ -159,9 +158,10 @@ base::FilePath GetStubRelativePolicyPath(
return base::FilePath(sanitized_id) return base::FilePath(sanitized_id)
.AppendASCII(kStubPerAccountPolicyFileNamePrefix + postfix); .AppendASCII(kStubPerAccountPolicyFileNamePrefix + postfix);
} }
} default:
NOTREACHED(); NOTREACHED();
return base::FilePath(); return base::FilePath();
}
} }
// Gets the stub file paths of the policy blob and optionally the policy key // Gets the stub file paths of the policy blob and optionally the policy key
...@@ -185,7 +185,6 @@ base::FilePath GetStubPolicyFilePath( ...@@ -185,7 +185,6 @@ base::FilePath GetStubPolicyFilePath(
} }
case login_manager::ACCOUNT_TYPE_USER: case login_manager::ACCOUNT_TYPE_USER:
case login_manager::ACCOUNT_TYPE_SESSIONLESS_USER:
case login_manager::ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT: { case login_manager::ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT: {
base::FilePath base_path; base::FilePath base_path;
CHECK( CHECK(
...@@ -196,9 +195,10 @@ base::FilePath GetStubPolicyFilePath( ...@@ -196,9 +195,10 @@ base::FilePath GetStubPolicyFilePath(
} }
return base_path.Append(relative_policy_path); return base_path.Append(relative_policy_path);
} }
} default:
NOTREACHED(); NOTREACHED();
return base::FilePath(); return base::FilePath();
}
} }
// Returns a key that's used for storing policy in memory. // Returns a key that's used for storing policy in memory.
...@@ -423,14 +423,6 @@ FakeSessionManagerClient::BlockingRetrievePolicyForUser( ...@@ -423,14 +423,6 @@ FakeSessionManagerClient::BlockingRetrievePolicyForUser(
return BlockingRetrievePolicy(descriptor, policy_out); return BlockingRetrievePolicy(descriptor, policy_out);
} }
void FakeSessionManagerClient::RetrievePolicyForUserWithoutSession(
const cryptohome::AccountIdentifier& cryptohome_id,
RetrievePolicyCallback callback) {
login_manager::PolicyDescriptor descriptor = MakeChromePolicyDescriptor(
login_manager::ACCOUNT_TYPE_SESSIONLESS_USER, cryptohome_id.account_id());
RetrievePolicy(descriptor, std::move(callback));
}
void FakeSessionManagerClient::RetrieveDeviceLocalAccountPolicy( void FakeSessionManagerClient::RetrieveDeviceLocalAccountPolicy(
const std::string& account_id, const std::string& account_id,
RetrievePolicyCallback callback) { RetrievePolicyCallback callback) {
...@@ -751,15 +743,6 @@ void FakeSessionManagerClient::set_user_policy( ...@@ -751,15 +743,6 @@ void FakeSessionManagerClient::set_user_policy(
policy_[GetMemoryStorageKey(descriptor)] = policy_blob; policy_[GetMemoryStorageKey(descriptor)] = policy_blob;
} }
void FakeSessionManagerClient::set_user_policy_without_session(
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& policy_blob) {
DCHECK(policy_storage_ == PolicyStorageType::kInMemory);
login_manager::PolicyDescriptor descriptor = MakeChromePolicyDescriptor(
login_manager::ACCOUNT_TYPE_SESSIONLESS_USER, cryptohome_id.account_id());
policy_[GetMemoryStorageKey(descriptor)] = policy_blob;
}
const std::string& FakeSessionManagerClient::device_local_account_policy( const std::string& FakeSessionManagerClient::device_local_account_policy(
const std::string& account_id) const { const std::string& account_id) const {
DCHECK(policy_storage_ == PolicyStorageType::kInMemory); DCHECK(policy_storage_ == PolicyStorageType::kInMemory);
......
...@@ -92,9 +92,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient ...@@ -92,9 +92,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient
RetrievePolicyResponseType BlockingRetrievePolicyForUser( RetrievePolicyResponseType BlockingRetrievePolicyForUser(
const cryptohome::AccountIdentifier& cryptohome_id, const cryptohome::AccountIdentifier& cryptohome_id,
std::string* policy_out) override; std::string* policy_out) override;
void RetrievePolicyForUserWithoutSession(
const cryptohome::AccountIdentifier& cryptohome_id,
RetrievePolicyCallback callback) override;
void RetrieveDeviceLocalAccountPolicy( void RetrieveDeviceLocalAccountPolicy(
const std::string& account_id, const std::string& account_id,
RetrievePolicyCallback callback) override; RetrievePolicyCallback callback) override;
...@@ -186,9 +183,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient ...@@ -186,9 +183,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) FakeSessionManagerClient
const cryptohome::AccountIdentifier& cryptohome_id) const; const cryptohome::AccountIdentifier& cryptohome_id) const;
void set_user_policy(const cryptohome::AccountIdentifier& cryptohome_id, void set_user_policy(const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& policy_blob); const std::string& policy_blob);
void set_user_policy_without_session(
const cryptohome::AccountIdentifier& cryptohome_id,
const std::string& policy_blob);
// Accessors for device local account policy. Only available for // Accessors for device local account policy. Only available for
// PolicyStorageType::kInMemory. // PolicyStorageType::kInMemory.
......
...@@ -95,10 +95,8 @@ void LogPolicyResponseUma(login_manager::PolicyAccountType account_type, ...@@ -95,10 +95,8 @@ void LogPolicyResponseUma(login_manager::PolicyAccountType account_type,
UMA_HISTOGRAM_ENUMERATION("Enterprise.RetrievePolicyResponse.User", UMA_HISTOGRAM_ENUMERATION("Enterprise.RetrievePolicyResponse.User",
response, RetrievePolicyResponseType::COUNT); response, RetrievePolicyResponseType::COUNT);
break; break;
case login_manager::ACCOUNT_TYPE_SESSIONLESS_USER: default:
UMA_HISTOGRAM_ENUMERATION( NOTREACHED();
"Enterprise.RetrievePolicyResponse.UserDuringLogin", response,
RetrievePolicyResponseType::COUNT);
break; break;
} }
} }
...@@ -449,15 +447,6 @@ class SessionManagerClientImpl : public SessionManagerClient { ...@@ -449,15 +447,6 @@ class SessionManagerClientImpl : public SessionManagerClient {
return BlockingRetrievePolicy(descriptor, policy_out); return BlockingRetrievePolicy(descriptor, policy_out);
} }
void RetrievePolicyForUserWithoutSession(
const cryptohome::AccountIdentifier& cryptohome_id,
RetrievePolicyCallback callback) override {
login_manager::PolicyDescriptor descriptor =
MakeChromePolicyDescriptor(login_manager::ACCOUNT_TYPE_SESSIONLESS_USER,
cryptohome_id.account_id());
CallRetrievePolicy(descriptor, std::move(callback));
}
void RetrieveDeviceLocalAccountPolicy( void RetrieveDeviceLocalAccountPolicy(
const std::string& account_name, const std::string& account_name,
RetrievePolicyCallback callback) override { RetrievePolicyCallback callback) override {
......
...@@ -298,13 +298,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) SessionManagerClient { ...@@ -298,13 +298,6 @@ class COMPONENT_EXPORT(SESSION_MANAGER) SessionManagerClient {
const cryptohome::AccountIdentifier& cryptohome_id, const cryptohome::AccountIdentifier& cryptohome_id,
std::string* policy_out) = 0; std::string* policy_out) = 0;
// Fetches the user policy blob for a hidden user home mount. |callback| is
// invoked upon completition.
// DEPRECATED, use RetrievePolicy() instead.
virtual void RetrievePolicyForUserWithoutSession(
const cryptohome::AccountIdentifier& cryptohome_id,
RetrievePolicyCallback callback) = 0;
// Fetches the policy blob associated with the specified device-local account // Fetches the policy blob associated with the specified device-local account
// from session manager. |callback| is invoked up on completion. // from session manager. |callback| is invoked up on completion.
// DEPRECATED, use RetrievePolicy() instead. // DEPRECATED, use RetrievePolicy() instead.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment