diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/enterprise/common | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/enterprise/common')
-rw-r--r-- | chromium/components/enterprise/common/BUILD.gn | 10 | ||||
-rw-r--r-- | chromium/components/enterprise/common/proto/BUILD.gn | 12 | ||||
-rw-r--r-- | chromium/components/enterprise/common/proto/connectors.proto | 106 | ||||
-rw-r--r-- | chromium/components/enterprise/common/strings.cc | 13 | ||||
-rw-r--r-- | chromium/components/enterprise/common/strings.h | 18 |
5 files changed, 159 insertions, 0 deletions
diff --git a/chromium/components/enterprise/common/BUILD.gn b/chromium/components/enterprise/common/BUILD.gn new file mode 100644 index 00000000000..cea78da082b --- /dev/null +++ b/chromium/components/enterprise/common/BUILD.gn @@ -0,0 +1,10 @@ +# 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. + +static_library("strings") { + sources = [ + "strings.cc", + "strings.h", + ] +} diff --git a/chromium/components/enterprise/common/proto/BUILD.gn b/chromium/components/enterprise/common/proto/BUILD.gn new file mode 100644 index 00000000000..38563e2ea2d --- /dev/null +++ b/chromium/components/enterprise/common/proto/BUILD.gn @@ -0,0 +1,12 @@ +# 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. + +import("//third_party/protobuf/proto_library.gni") + +proto_library("connectors_proto") { + proto_in_dir = "//" + sources = [ "connectors.proto" ] + + deps = [ "//components/safe_browsing/core:csd_proto" ] +} diff --git a/chromium/components/enterprise/common/proto/connectors.proto b/chromium/components/enterprise/common/proto/connectors.proto new file mode 100644 index 00000000000..1fafb7ef9e8 --- /dev/null +++ b/chromium/components/enterprise/common/proto/connectors.proto @@ -0,0 +1,106 @@ +// 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 enterprise_connectors; + +// For ClientDownloadRequest. +import "components/safe_browsing/core/proto/csd.proto"; + +// Which connector is calling BinaryUploadService so that the proper rules can +// be triggered. BinaryUploadService also uses this value to find the URL that +// the payload should be uploaded to. +// +// The values in this enum can be extended in future versions of Chrome to +// support new analysis connectors. +enum AnalysisConnector { + ANALYSIS_CONNECTOR_UNSPECIFIED = 0; + FILE_DOWNLOADED = 1; + FILE_ATTACHED = 2; + BULK_DATA_ENTRY = 3; +} + +message ContentMetaData { + // The URL containing the file download/upload or to which web content is + // being uploaded. + optional string url = 1; + + // Name of file on user system (if applicable). + optional string filename = 2; + + // Sha256 digest of file. + optional string digest = 3; + + // Specifically for the download case. + optional safe_browsing.ClientDownloadRequest csd = 4; +} + +// Analysis request sent from chrome to backend. +message ContentAnalysisRequest { + // The TokenID for Enterprise-enrolled devices. This identifies a specific + // chrome instance. + optional string device_token = 1; + + // Firebase Cloud Messaging token used to notify this client of the verdict. + // This identifies a specific chrome instance. + optional string fcm_notification_token = 2; + + // Which enterprise connector fired this request. + optional AnalysisConnector analysis_connector = 9; + + // Information about the data that triggered the content analysis request. + optional ContentMetaData request_data = 10; + + // Token used to correlate requests and responses. This is different than the + // FCM token in that it is unique for each request. + optional string request_token = 5; + + // The tags configured for the URL that triggered the content analysis. + repeated string tags = 11; + + // Reserved to make sure there is no overlap with DeepScanningClientRequest. + reserved 3, 4, 6 to 8; +} + +// Scanning response sent from backend to Chrome. +message ContentAnalysisResponse { + // Token used to correlate requests and responses. Corresponds to field in + // ContentAnalysisRequest with the same name. + optional string request_token = 1; + + // Represents the analysis result from a given tag. + message Result { + optional string tag = 1; + + // The status of this result. + enum Status { + STATUS_UNKNOWN = 0; + SUCCESS = 1; + FAILURE = 2; + } + optional Status status = 2; + + // Identifies the detection rules that were triggered by the analysis. + // Only relevant when status is SUCCESS. + message TriggeredRule { + enum Action { + ACTION_UNSPECIFIED = 0; + REPORT_ONLY = 1; + WARN = 2; + BLOCK = 3; + } + optional Action action = 1; + optional string rule_name = 2; + optional string rule_id = 3; + } + repeated TriggeredRule triggered_rules = 3; + } + repeated Result results = 4; + + // Reserved to make sure there is no overlap with DeepScanningClientResponse. + reserved 2 to 3; +} diff --git a/chromium/components/enterprise/common/strings.cc b/chromium/components/enterprise/common/strings.cc new file mode 100644 index 00000000000..529ed8b1d2c --- /dev/null +++ b/chromium/components/enterprise/common/strings.cc @@ -0,0 +1,13 @@ +// 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. + +#include "components/enterprise/common/strings.h" + +namespace enterprise { + +const char kUrlParamConnector[] = "connector"; +const char kUrlParamDeviceToken[] = "device_token"; +const char kUrlParamTag[] = "tag"; + +} // namespace enterprise diff --git a/chromium/components/enterprise/common/strings.h b/chromium/components/enterprise/common/strings.h new file mode 100644 index 00000000000..df3d348a633 --- /dev/null +++ b/chromium/components/enterprise/common/strings.h @@ -0,0 +1,18 @@ +// 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. + +#ifndef COMPONENTS_ENTERPRISE_COMMON_STRINGS_H_ +#define COMPONENTS_ENTERPRISE_COMMON_STRINGS_H_ + +namespace enterprise { + +// URL parameters used when enterprise connectors call on service provider +// endpoints. +extern const char kUrlParamConnector[]; +extern const char kUrlParamDeviceToken[]; +extern const char kUrlParamTag[]; + +} // namespace enterprise + +#endif // COMPONENTS_ENTERPRISE_COMMON_STRINGS_H_ |