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

// Copyright 2020 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_ENCRYPTED_REPORTING_JOB_CONFIGURATION_H_
#define COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENCRYPTED_REPORTING_JOB_CONFIGURATION_H_

#include <memory>
#include <string>

#include "base/functional/callback.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/policy/core/common/cloud/cloud_policy_client.h"
#include "components/policy/core/common/cloud/device_management_service.h"
#include "components/policy/core/common/cloud/reporting_job_configuration_base.h"
#include "components/policy/policy_export.h"
#include "components/reporting/proto/synced/record_constants.pb.h"

namespace policy {

// {{{Note}}} ERP Request Payload Overview
//
// EncryptedReportingJobConfiguration configures a payload for the Encrypted
// server endpoint. A JSON version of the payload looks like this:
// {
//   "encryptedRecord": [
//     {
//       "encryptedWrappedRecord": "EncryptedMessage",
//       "encryptionInfo" : {
//         "encryptionKey": "LocalPublicValue",
//         "publicKeyId": 1
//       },
//       "sequenceInformation": {
//         "sequencingId": 1,
//         "generationId": 123456789,
//         "priority": 1
//         "generation_guid": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
//       },
//       "compressionInformation": {
//         "compressionAlgorithm": 1
//       }
//     },
//     {
//       "encryptedWrappedRecord": "EncryptedMessage",
//       "encryptionInfo" : {
//         "encryptionKey": "LocalPublicValue",
//         "publicKeyId": 2
//       },
//       "sequenceInformation": {
//         "sequencingId": 2,
//         "generationId": 123456789,
//         "priority": 1
//         "generation_guid": "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
//       },
//       "compressionInformation": {
//         "compressionAlgorithm": 1
//       }
//     }
//   ],
//   "attachEncryptionSettings": true,  // optional field
//   "configurationFileVersion": 123456, // optional field
//   "source": "SomeString", // optional field - used only by tast tests
//   "requestId": "SomeString",
//   "device": {
//     "client_id": "abcdef1234",
//     "dmToken": "abcdef1234",
//     "name": "George",
//     "osPlatform": "Windows",
//     "osVersion": "10.0.0.0"
//   },
//   "browser": {
//     "browserId": "abcdef1234",
//     "chromeVersion": "10.0.0.0",
//     "machineUser": "abcdef1234",
//     "userAgent": "abcdef1234"
//   }
// }
// "device" and "browser" are populated by the base class,
// the rest needs to be provided as |merging_payload|.
//
// Details other than the "device" and "browser" fields are documented at note
// "ERP Encrypted Record".

class POLICY_EXPORT EncryptedReportingJobConfiguration
    : public ReportingJobConfigurationBase {};

}  // namespace policy

#endif  // COMPONENTS_POLICY_CORE_COMMON_CLOUD_ENCRYPTED_REPORTING_JOB_CONFIGURATION_H_