blob: 437a90b769ac80a85c75d1fd21beeb41daf518f1 [file] [log] [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_AGGREGATION_SERVICE_AGGREGATION_COORDINATOR_UTILS_H_
#define COMPONENTS_AGGREGATION_SERVICE_AGGREGATION_COORDINATOR_UTILS_H_
#include <vector>
#include "base/component_export.h"
#include "url/origin.h"
namespace aggregation_service {
constexpr char kDefaultAggregationCoordinatorAwsCloud[] =
"https://publickeyservice.msmt.aws.privacysandboxservices.com";
constexpr char kDefaultAggregationCoordinatorGcpCloud[] =
"https://publickeyservice.msmt.gcp.privacysandboxservices.com";
COMPONENT_EXPORT(AGGREGATION_SERVICE)
url::Origin GetDefaultAggregationCoordinatorOrigin();
COMPONENT_EXPORT(AGGREGATION_SERVICE)
bool IsAggregationCoordinatorOriginAllowed(const url::Origin&);
class COMPONENT_EXPORT(AGGREGATION_SERVICE)
ScopedAggregationCoordinatorAllowlistForTesting {
public:
explicit ScopedAggregationCoordinatorAllowlistForTesting(
std::vector<url::Origin> origins = {});
~ScopedAggregationCoordinatorAllowlistForTesting();
ScopedAggregationCoordinatorAllowlistForTesting(
const ScopedAggregationCoordinatorAllowlistForTesting&) = delete;
ScopedAggregationCoordinatorAllowlistForTesting& operator=(
const ScopedAggregationCoordinatorAllowlistForTesting&) = delete;
ScopedAggregationCoordinatorAllowlistForTesting(
ScopedAggregationCoordinatorAllowlistForTesting&&) = delete;
ScopedAggregationCoordinatorAllowlistForTesting& operator=(
ScopedAggregationCoordinatorAllowlistForTesting&&) = delete;
private:
std::vector<url::Origin> previous_;
};
} // namespace aggregation_service
#endif // COMPONENTS_AGGREGATION_SERVICE_AGGREGATION_COORDINATOR_UTILS_H_