Commit 9ca07884 authored by Zach Trudo's avatar Zach Trudo Committed by Commit Bot

Adds protos required for Messaging Layer

File Changes:
~ chrome/browser/chromeos/
| ~ BUILD.gn
|   Added reporting_record_proto, and reporting_constants_proto
|   targets
+ chrome/browser/chromeos/policy/messaging_layer/
| + proto/record.proto
|   Contains Record, WrappedRecord, and EncryptedRecord.
| + public/record_constants.proto
|   Contatins constants that the user will use to indicate the
|   destination and priority of their records.

Change-Id: I2ee585d8294781ea4cece76d74b72513d787596f

Bug: b:153365169
Change-Id: I2ee585d8294781ea4cece76d74b72513d787596f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2139854
Commit-Queue: Zach Trudo <zatrudo@google.com>
Reviewed-by: default avatarSergey Poromov <poromov@chromium.org>
Auto-Submit: Zach Trudo <zatrudo@google.com>
Cr-Commit-Position: refs/heads/master@{#760573}
parent d71809e8
...@@ -56,6 +56,8 @@ source_set("chromeos") { ...@@ -56,6 +56,8 @@ source_set("chromeos") {
":device_configuration_proto", ":device_configuration_proto",
":device_policy_remover_generated", ":device_policy_remover_generated",
":print_job_info_proto", ":print_job_info_proto",
":reporting_constants_proto",
":reporting_record_proto",
":screen_brightness_event_proto", ":screen_brightness_event_proto",
":user_activity_event_proto", ":user_activity_event_proto",
":user_charging_event_proto", ":user_charging_event_proto",
...@@ -3384,6 +3386,14 @@ proto_library("print_job_info_proto") { ...@@ -3384,6 +3386,14 @@ proto_library("print_job_info_proto") {
sources = [ "printing/history/print_job_info.proto" ] sources = [ "printing/history/print_job_info.proto" ]
} }
proto_library("reporting_record_proto") {
sources = [ "policy/messaging_layer/proto/record.proto" ]
}
proto_library("reporting_constants_proto") {
sources = [ "policy/messaging_layer/public/record_constants.proto" ]
}
device_policy_remover_path = "$target_gen_dir/device_policy_remover.cc" device_policy_remover_path = "$target_gen_dir/device_policy_remover.cc"
action("device_policy_remover_generate") { action("device_policy_remover_generate") {
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package reporting_messaging_layer;
// Record represents the data sent from the Reporting Client.
message Record {
// Record data as enqueued with an ReportingQueue::Enqueue call (required).
// Data structure requirements are set by the destination. For destinations
// expecting a proto - the proto will be MessageLite::SerializeToString(), and
// will be DeserializedFromString() in the destination handler, prior to being
// forwarded.
//
// Current expected formats (destination : type):
// Destination::UPLOAD_EVENTS : UploadEventsRequest
optional bytes data = 1 [ctype = CORD];
// The destination associated with this request as set with the
// ReportingQueueConfiguration (required).
optional string destination = 2;
// The DMToken associated with this request as set with the
// ReportingQueueConfiuguration (required).
optional string dm_token = 3;
}
// A Record with it's digest and the digest of the previous record.
message WrappedRecord {
// Record (required)
// Data provided by the Reporting Client.
optional Record record = 1;
// Record Digest (required)
// SHA256 hash used to validate that the record has been retrieved without
// being manipulated while it was on the device or during transfer.
optional uint64 record_digest = 2;
// Last record digest (required)
// Created by client and used by server to verify that the sequence of records
// has not been tampered with.
optional uint64 last_record_digest = 3;
}
// Information about how the record was encrypted.
message EncryptionInfo {
// Encryption key (optional).
// Represents a symmetric key used for |encrypted_wrapped_record|
// encryption; itself encrypted with asymmetric encryption by a public key.
// The private portion of the key is known to the receiver only, and
// identified with the |public_key_id|.
optional bytes encryption_key = 1;
// Public key id (optional)
// Hash of the public key used to do encryption. Used to identity the
// private key for decryption. If no key_id is present, it is assumed that
// |key| has been transferred in plaintext.
optional uint64 public_key_id = 2;
}
// Tracking information for what order a record appears in.
message SequencingInformation {
// Sequencing ID (monotonic number, required)
// Tracks records processing progress and is used for confirming that this
// and all prior records have been processed. If the same number is
// encountered more than once, only one instance needs to be processed. If
// certain number is absent when higher are encountered, it indicates that
// some records have been lost and there is a gap in the records stream
// (what to do with that is a decision that the caller needs to make).
optional uint64 sequencing_id = 1;
// Generation ID (required)
// UUID of the last boot that did not find the public key cached - can
// happen after powerwash.
optional uint64 generation_id = 2;
}
// |WrappedRecord| as it is stored on disc, and sent to the server.
message EncryptedRecord {
// Encrypted Wrapped Record (required)
// |WrappedRecord| encrypted with the |encryption_key| in |encryption_info|.
optional bytes encrypted_wrapped_record = 1;
optional EncryptionInfo encryption_info = 2;
optional SequencingInformation sequencing_information = 3;
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package reporting_messaging_layer;
// |Destination| indicates which handler a |Record| should be delivered to.
enum Destination {
UNDEFINED_DESTINATION = 0;
// |UPLOAD_EVENTS| handler sends records to the Eventing pipeline.
UPLOAD_EVENTS = 1;
}
// |Priority| is used to determine when items from the queue should be rate
// limited or shed. Rate limiting indicates that fewer records will be sent due
// to message volume, records of the lowest priority are limited first. Shedding
// records occurs when disk space is at or near the limt, records of the lowest
// priority are shed first.
enum Priority {
UNDEFINED_PRIORITY = 0;
// |IMMEDIATE| queues should transfer small amounts of immediately necessary
// information. These are the events that will be rate limited last.
// |IMMEDIATE| records are the last ones to be shed.
// Security events are the only example of events that need to be |IMMEDIATE|.
IMMEDIATE = 1;
// |FAST_BATCH| queues should transfer small amounts of information that may
// be critical for administrative experience. These records will be rate
// limited before |IMMEDIATE| records.
// |FAST_BATCH| records are shed before |IMMEDIATE| records.
// Resource utilization and failed application installation are perfect
// examples of records that need to be |FAST_BATCH|.
FAST_BATCH = 2;
// |SLOW_BATCH| queues should transfer small amounts of non-immediate data.
// These records will be rate limited before |FAST_BATCH| records.
// |SLOW_BATCH| records are shed before |FAST_BATCH| records.
// Application metrics are a good example of records that should be
// |SLOW_BATCH|.
SLOW_BATCH = 3;
// |BACKGROUND_BATCH| queues transfer large amounts of non-immediate data.
// These records are the first to be rate limited.
// |BACKGROUND_BATCH| records are the first to be shed.
// Log files are a perfect examples of records that need to be
// |BACKGROUND_BATCH|.
BACKGROUND_BATCH = 4;
}
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