chromium/components/policy/core/common/cloud/cloud_policy_constants.h

// Copyright 2012 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_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_
#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_

#include <string>

#include "components/policy/policy_export.h"

namespace policy {

// Constants related to the device management protocol.
namespace dm_protocol {

// Name extern constants for URL query parameters.
extern const char kParamAgent[];
extern const char kParamAppType[];
extern const char kParamCritical[];
extern const char kParamDeviceID[];
extern const char kParamDeviceType[];
extern const char kParamLastError[];
extern const char kParamOAuthToken[];
extern const char kParamPlatform[];
extern const char kParamRequest[];
extern const char kParamRetry[];
extern const char kParamProfileID[];

// Policy constants used in authorization header.
extern const char kAuthHeader[];
extern const char kServiceTokenAuthHeaderPrefix[];
extern const char kDMTokenAuthHeaderPrefix[];
extern const char kEnrollmentTokenAuthHeaderPrefix[];
extern const char kOAuthTokenHeaderPrefix[];
extern const char kOidcAuthHeaderPrefix[];
extern const char kOidcAuthTokenHeaderPrefix[];
extern const char kOidcIdTokenHeaderPrefix[];

// String extern constants for the device and app type we report to the server.
extern const char kValueAppType[];
extern const char kValueBrowserUploadPublicKey[];
extern const char kValueDeviceType[];
extern const char kValueRequestAutoEnrollment[];
extern const char kValueRequestPsmHasDeviceState[];
extern const char kValueCheckUserAccount[];
extern const char kValueRequestPolicy[];
extern const char kValueRequestRegister[];
extern const char kValueRequestRegisterProfile[];
extern const char kValueRequestApiAuthorization[];
extern const char kValueRequestUnregister[];
extern const char kValueRequestUploadCertificate[];
extern const char kValueRequestUploadEuiccInfo[];
extern const char kValueRequestDeviceStateRetrieval[];
extern const char kValueRequestUploadStatus[];
extern const char kValueRequestRemoteCommands[];
extern const char kValueRequestDeviceAttributeUpdatePermission[];
extern const char kValueRequestDeviceAttributeUpdate[];
extern const char kValueRequestGcmIdUpdate[];
extern const char kValueRequestCheckAndroidManagement[];
extern const char kValueRequestCertBasedRegister[];
extern const char kValueRequestTokenBasedRegister[];
extern const char kValueRequestActiveDirectoryEnrollPlayUser[];
extern const char kValueRequestActiveDirectoryPlayActivity[];
extern const char kValueRequestAppInstallReport[];
extern const char kValueRequestRegisterBrowser[];
extern const char kValueRequestRegisterPolicyAgent[];
extern const char kValueRequestChromeDesktopReport[];
extern const char kValueRequestInitialEnrollmentStateRetrieval[];
extern const char kValueRequestUploadPolicyValidationReport[];
extern const char kValueRequestPublicSamlUser[];
extern const char kValueRequestChromeOsUserReport[];
extern const char kValueRequestCertProvisioningRequest[];
extern const char kValueRequestChromeProfileReport[];
extern const char kValueRequestFmRegistrationTokenUpload[];

// Policy type strings for the policy_type field in PolicyFetchRequest.
extern const char kChromeDevicePolicyType[];
extern const char kChromeUserPolicyType[];
extern const char kChromePublicAccountPolicyType[];
extern const char kChromeExtensionPolicyType[];
extern const char kChromeSigninExtensionPolicyType[];
extern const char kChromeMachineLevelUserCloudPolicyType[];
extern const char kChromeMachineLevelExtensionCloudPolicyType[];
extern const char kChromeRemoteCommandPolicyType[];
extern const char kGoogleUpdateMachineLevelAppsPolicyType[];
extern const char kGoogleUpdateMachineLevelOmahaPolicyType[];

// Remote command type for `type` field in DeviceRemoteCommandRequest.
// Command for Chrome OS Ash user.
extern const char kChromeAshUserRemoteCommandType[];
// Command for Chrome OS device.
extern const char kChromeDeviceRemoteCommandType[];
// Command for CBCM device on non-CrOS
extern const char kChromeBrowserRemoteCommandType[];
// Command for browser profile.
extern const char kChromeUserRemoteCommandType[];

extern const char kChromeMachineLevelUserCloudPolicyTypeBase64[];

// These codes are sent in the |error_code| field of PolicyFetchResponse.
enum PolicyFetchStatus {};

}  // namespace dm_protocol

// Public half of the verification key that is used to verify that policy
// signing keys are originating from DM server.
std::string GetPolicyVerificationKey();

// Corresponding hash.
extern const char kPolicyVerificationKeyHash[];

// Status codes for communication errors with the device management service.
// This enum is used to define the buckets for an enumerated UMA histogram.
// Hence,
//   (a) existing enumerated constants should never be deleted or reordered, and
//   (b) new constants should only be appended at the end of the enumeration.
enum DeviceManagementStatus {};

// List of modes that the device can be locked into. Some IDs are skipped
// because they have been used in the past but got deprecated and deleted.
enum DeviceMode {};

// List of modes of OIDC management.
enum ThirdPartyIdentityType {};

// Domain that demo mode devices are enrolled into: cros-demo-mode.com
extern const char kDemoModeDomain[];

// Indicate this device's market segment. go/cros-rlz-segments.
// This enum should be kept in sync with MarketSegment enum in
// device_management_backend.proto (http://shortn/_p0P58C4BRV). If any additions
// are made to this proto, the UserDeviceMatrix in
// src/tools/metrics/histograms/enums.xml should also be updated, as well as the
// browser test suite in usertype_by_devicetype_metrics_provider_browsertest.cc
// (http://shortn/_gD5uIM9Z78) to account for the new user / device type combo.
enum class MarketSegment {};

// Sender ID of FCM (Firebase Cloud Messaging)
// Policy Invalidation sender coming from the Firebase console.
inline constexpr char kPolicyFCMInvalidationSenderID[] =;

// Kiosk SKU name. This is the constant of the enrollment license type that
// exists on the server side.
inline static const char kKioskSkuName[] =;

}  // namespace policy

#endif  // COMPONENTS_POLICY_CORE_COMMON_CLOUD_CLOUD_POLICY_CONSTANTS_H_