chromium/components/policy/test_support/request_handler_for_policy.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/policy/test_support/request_handler_for_policy.h"

#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "components/policy/test_support/policy_storage.h"
#include "components/policy/test_support/signature_provider.h"
#include "components/policy/test_support/test_server_helpers.h"
#include "crypto/rsa_private_key.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "net/base/url_util.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"

HttpRequest;
HttpResponse;

em;

namespace policy {

// As policy test server can be used not only for regular managed users,
// but also for unicorn users, we need to handle some policy aspects for
// them in a special way.
inline constexpr char kUnicornUsersDomain[] =;

RequestHandlerForPolicy::RequestHandlerForPolicy(
    EmbeddedPolicyTestServer* parent)
    :{}

RequestHandlerForPolicy::~RequestHandlerForPolicy() = default;

std::string RequestHandlerForPolicy::RequestType() {}

std::unique_ptr<HttpResponse> RequestHandlerForPolicy::HandleRequest(
    const HttpRequest& request) {}

bool RequestHandlerForPolicy::ProcessCloudPolicy(
    const em::PolicyFetchRequest& fetch_request,
    const ClientStorage::ClientInfo& client_info,
    em::PolicyFetchResponse* fetch_response,
    std::string* error_msg) {}

bool RequestHandlerForPolicy::ProcessCloudPolicyForExtensions(
    const em::PolicyFetchRequest& fetch_request,
    const ClientStorage::ClientInfo& client_info,
    em::DevicePolicyResponse* response,
    std::string* error_msg) {}

}  // namespace policy