Commit c6254598 authored by Josh Nohle's avatar Josh Nohle Committed by Commit Bot

[DeviceSync v2] Add logging tools for protos

Add functions to print CryptAuth protos in JSON format. Use these for
verbose logs throughout the v2 DeviceSync flow.

Note: cryptauth_logging.h is included in the enrollment and device
managers to allow for better printing of the InvocationReason.

Manually tested to verify formatting.

Bug: 951969
Change-Id: Icb9540541f6a080f7bd6f1e661c124eb610dcc91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091707Reviewed-by: default avatarJames Vecore <vecore@google.com>
Commit-Queue: Josh Nohle <nohle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748342}
parent eb209161
......@@ -21,6 +21,7 @@
#include "chromeos/services/device_sync/cryptauth_key_bundle.h"
#include "chromeos/services/device_sync/cryptauth_task_metrics_logger.h"
#include "chromeos/services/device_sync/device_sync_type_converters.h"
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
namespace chromeos {
......@@ -200,6 +201,8 @@ void CryptAuthDeviceActivityGetterImpl::OnGetDevicesActivityStatusSuccess(
base::TimeTicks::Now() - last_state_change_timestamp_,
CryptAuthApiCallResult::kSuccess);
PA_LOG(VERBOSE) << "GetDevicesActivityStatus response:\n" << response;
DeviceActivityStatusResult device_activity_statuses;
for (const cryptauthv2::DeviceActivityStatus& device_activity_status :
......
......@@ -17,6 +17,7 @@
#include "chromeos/services/device_sync/cryptauth_key_creator_impl.h"
#include "chromeos/services/device_sync/cryptauth_task_metrics_logger.h"
#include "chromeos/services/device_sync/pref_names.h"
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
#include "chromeos/services/device_sync/value_string_encoding.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
......@@ -296,8 +297,11 @@ CryptAuthMetadataSyncerImpl::GetGroupPublicKeyState() {
void CryptAuthMetadataSyncerImpl::AttemptNextStep() {
switch (state_) {
case State::kNotStarted:
switch (GetGroupPublicKeyState()) {
// Start the flow.
case State::kNotStarted: {
GroupPublicKeyState group_public_key_state = GetGroupPublicKeyState();
PA_LOG(VERBOSE) << "Group public key state: " << group_public_key_state;
switch (group_public_key_state) {
case GroupPublicKeyState::kNewKeyNeedsToBeCreated:
CreateGroupKey();
return;
......@@ -308,17 +312,25 @@ void CryptAuthMetadataSyncerImpl::AttemptNextStep() {
NOTREACHED();
return;
}
}
// After group key creation, encrypt the local device metadata.
case State::kWaitingForGroupKeyCreation:
EncryptLocalDeviceMetadata();
return;
// After local device metadata is encrypted, start constructing the
// SyncMetadata call.
case State::kWaitingForLocalDeviceMetadataEncryption:
MakeSyncMetadataCall();
return;
case State::kWaitingForFirstSyncMetadataResponse:
switch (GetGroupPublicKeyState()) {
// After receiving the first SyncMetadata response, take further action
// based on the state of the group public key.
case State::kWaitingForFirstSyncMetadataResponse: {
GroupPublicKeyState group_public_key_state = GetGroupPublicKeyState();
PA_LOG(VERBOSE) << "Group public key state: " << group_public_key_state;
switch (group_public_key_state) {
case GroupPublicKeyState::kNewKeyNeedsToBeCreated:
CreateGroupKey();
return;
......@@ -336,11 +348,16 @@ void CryptAuthMetadataSyncerImpl::AttemptNextStep() {
NOTREACHED();
return;
}
}
case State::kWaitingForSecondSyncMetadataResponse:
// No more than two SyncMetadata requests should be necessary in the v2
// DeviceSync protocol to establish the group public key.
switch (GetGroupPublicKeyState()) {
// After receiving the second SyncMetadata response, process the metadata
// and finish. Note: In the v2 DeviceSync protocol, no more than two
// SyncMetadata requests should be necessary to establish the group public
// key.
case State::kWaitingForSecondSyncMetadataResponse: {
GroupPublicKeyState group_public_key_state = GetGroupPublicKeyState();
PA_LOG(VERBOSE) << "Group public key state: " << group_public_key_state;
switch (group_public_key_state) {
case GroupPublicKeyState::kEstablished:
FilterMetadataAndFinishAttempt();
return;
......@@ -349,7 +366,9 @@ void CryptAuthMetadataSyncerImpl::AttemptNextStep() {
kErrorEstablishingGroupPublicKey);
return;
}
}
// Each CryptAuthMetadataSyncer object can only be used once.
case State::kFinished:
NOTREACHED();
return;
......@@ -505,6 +524,8 @@ void CryptAuthMetadataSyncerImpl::OnSyncMetadataSuccess(
else
NOTREACHED();
PA_LOG(VERBOSE) << "SyncMetadata response:\n" << response;
// Cache encrypted and unencrypted local device metadata, along with the group
// public key used to encrypt the data, that was successfully sent in the
// SyncMetadata request. Note: the cached group public key might not match
......@@ -668,6 +689,33 @@ std::ostream& operator<<(std::ostream& stream,
return stream;
}
std::ostream& operator<<(
std::ostream& stream,
const CryptAuthMetadataSyncerImpl::GroupPublicKeyState& key_state) {
switch (key_state) {
case CryptAuthMetadataSyncerImpl::GroupPublicKeyState::kUndetermined:
stream << "[Undetermined]";
break;
case CryptAuthMetadataSyncerImpl::GroupPublicKeyState::
kKeyExistsButNotConfirmedWithCryptAuth:
stream << "[Key exists but not confirmed with CryptAuth]";
break;
case CryptAuthMetadataSyncerImpl::GroupPublicKeyState::
kNewKeyNeedsToBeCreated:
stream << "[New key needs to be created]";
break;
case CryptAuthMetadataSyncerImpl::GroupPublicKeyState::
kNewKeyReceivedFromCryptAuth:
stream << "[New key received from CryptAuth]";
break;
case CryptAuthMetadataSyncerImpl::GroupPublicKeyState::kEstablished:
stream << "[Established]";
break;
}
return stream;
}
} // namespace device_sync
} // namespace chromeos
......@@ -77,6 +77,7 @@ class CryptAuthMetadataSyncerImpl : public CryptAuthMetadataSyncer {
kWaitingForSecondSyncMetadataResponse,
kFinished
};
friend std::ostream& operator<<(std::ostream& stream, const State& state);
// kKeyExistsButNotConfirmedWithCryptAuth: A local group public key exists but
// CryptAuth has yet to confirm or deny that it is the correct group key.
......@@ -98,8 +99,8 @@ class CryptAuthMetadataSyncerImpl : public CryptAuthMetadataSyncer {
kNewKeyReceivedFromCryptAuth,
kEstablished
};
friend std::ostream& operator<<(std::ostream& stream, const State& state);
friend std::ostream& operator<<(std::ostream& stream,
const GroupPublicKeyState& state);
static base::Optional<base::TimeDelta> GetTimeoutForState(State state);
static base::Optional<CryptAuthDeviceSyncResult::ResultCode>
......
......@@ -13,6 +13,7 @@
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
#include "chromeos/services/device_sync/pref_names.h"
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
#include "chromeos/services/device_sync/value_string_encoding.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
......@@ -331,7 +332,7 @@ void CryptAuthSchedulerImpl::HandleResult(
if (new_client_directive && IsClientDirectiveValid(*new_client_directive)) {
client_directive_ = *new_client_directive;
PA_LOG(VERBOSE) << "New client directive:\n" << client_directive_;
pref_service_->Set(
prefs::kCryptAuthSchedulerClientDirective,
util::EncodeProtoMessageAsValueString(&client_directive_));
......
......@@ -14,6 +14,7 @@
#include "chromeos/services/device_sync/cryptauth_device_syncer_impl.h"
#include "chromeos/services/device_sync/cryptauth_key_registry.h"
#include "chromeos/services/device_sync/cryptauth_task_metrics_logger.h"
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
#include "chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h"
namespace chromeos {
......
......@@ -18,6 +18,7 @@
#include "chromeos/services/device_sync/cryptauth_task_metrics_logger.h"
#include "chromeos/services/device_sync/cryptauth_v2_enroller_impl.h"
#include "chromeos/services/device_sync/pref_names.h"
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
#include "chromeos/services/device_sync/public/cpp/client_app_metadata_provider.h"
#include "chromeos/services/device_sync/value_string_encoding.h"
#include "components/prefs/pref_registry_simple.h"
......
......@@ -20,6 +20,8 @@ proto_library("proto") {
static_library("util") {
sources = [
"cryptauth_logging.cc",
"cryptauth_logging.h",
"cryptauth_proto_to_query_parameters_util.cc",
"cryptauth_proto_to_query_parameters_util.h",
"device_classifier_util.cc",
......@@ -32,6 +34,7 @@ static_library("util") {
deps = [
"//base",
"//base:i18n",
"//components/version_info",
]
}
......
// 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 <utility>
#include "chromeos/services/device_sync/proto/cryptauth_logging.h"
#include "base/base64url.h"
#include "base/i18n/time_formatting.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
namespace cryptauthv2 {
namespace {
std::string Encode(const std::string& str) {
std::string encoded_string;
base::Base64UrlEncode(str, base::Base64UrlEncodePolicy::INCLUDE_PADDING,
&encoded_string);
return encoded_string;
}
} // namespace
std::string TruncateStringForLogs(const std::string& str) {
if (str.length() <= 10)
return str;
return str.substr(0, 5) + "..." + str.substr(str.length() - 5, str.length());
}
std::string TargetServiceToString(TargetService service) {
switch (service) {
case TargetService::TARGET_SERVICE_UNSPECIFIED:
return "[Unspecified]";
case TargetService::ENROLLMENT:
return "[Enrollment]";
case TargetService::DEVICE_SYNC:
return "[DeviceSync]";
default:
return "[Unknown TargetService value " + base::NumberToString(service) +
"]";
}
}
std::ostream& operator<<(std::ostream& stream, const TargetService& service) {
stream << TargetServiceToString(service);
return stream;
}
std::string InvocationReasonToString(ClientMetadata::InvocationReason reason) {
switch (reason) {
case ClientMetadata::INVOCATION_REASON_UNSPECIFIED:
return "[Unspecified]";
case ClientMetadata::INITIALIZATION:
return "[Initialization]";
case ClientMetadata::PERIODIC:
return "[Periodic]";
case ClientMetadata::SLOW_PERIODIC:
return "[Slow periodic]";
case ClientMetadata::FAST_PERIODIC:
return "[Fast periodic]";
case ClientMetadata::EXPIRATION:
return "[Expiration]";
case ClientMetadata::FAILURE_RECOVERY:
return "[Failure recovery]";
case ClientMetadata::NEW_ACCOUNT:
return "[New account]";
case ClientMetadata::CHANGED_ACCOUNT:
return "[Changed account]";
case ClientMetadata::FEATURE_TOGGLED:
return "[Feature toggled]";
case ClientMetadata::SERVER_INITIATED:
return "[Server initiated]";
case ClientMetadata::ADDRESS_CHANGE:
return "[Address change]";
case ClientMetadata::SOFTWARE_UPDATE:
return "[Software update]";
case ClientMetadata::MANUAL:
return "[Manual]";
case ClientMetadata::CUSTOM_KEY_INVALIDATION:
return "[Custom key invalidation]";
case ClientMetadata::PROXIMITY_PERIODIC:
return "[Proximity periodic]";
default:
return "[Unknown InvocationReason value " + base::NumberToString(reason) +
"]";
}
}
std::ostream& operator<<(std::ostream& stream,
const ClientMetadata::InvocationReason& reason) {
stream << InvocationReasonToString(reason);
return stream;
}
std::string ConnectivityStatusToString(ConnectivityStatus status) {
switch (status) {
case ConnectivityStatus::UNKNOWN_CONNECTIVITY:
return "[Unknown connectivity]";
case ConnectivityStatus::OFFLINE:
return "[Offline]";
case ConnectivityStatus::ONLINE:
return "[Online]";
default:
return "[Unknown ConnectivityStatus value " +
base::NumberToString(status) + "]";
}
}
std::ostream& operator<<(std::ostream& stream,
const ConnectivityStatus& status) {
stream << ConnectivityStatusToString(status);
return stream;
}
base::Value PolicyReferenceToReadableDictionary(const PolicyReference& policy) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Name", policy.name());
dict.SetIntKey("Version", policy.version());
return dict;
}
std::ostream& operator<<(std::ostream& stream, const PolicyReference& policy) {
stream << PolicyReferenceToReadableDictionary(policy);
return stream;
}
base::Value InvokeNextToReadableDictionary(const InvokeNext& invoke_next) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Target service",
TargetServiceToString(invoke_next.service()));
dict.SetStringKey("Key name", invoke_next.key_name());
return dict;
}
std::ostream& operator<<(std::ostream& stream, const InvokeNext& invoke_next) {
stream << InvokeNextToReadableDictionary(invoke_next);
return stream;
}
base::Value ClientDirectiveToReadableDictionary(
const ClientDirective& directive) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetKey("Policy reference", PolicyReferenceToReadableDictionary(
directive.policy_reference()));
{
base::string16 checkin_delay;
bool success = base::TimeDurationFormatWithSeconds(
base::TimeDelta::FromMilliseconds(directive.checkin_delay_millis()),
base::DurationFormatWidth::DURATION_WIDTH_NARROW, &checkin_delay);
if (success) {
dict.SetStringKey("Next enrollment", checkin_delay);
}
checkin_delay = base::UTF8ToUTF16(
"[Error formatting time " +
base::NumberToString(directive.checkin_delay_millis()) + "ms]");
}
dict.SetIntKey("Immediate failure retry attempts",
directive.retry_attempts());
{
base::string16 retry_period;
bool success = base::TimeDurationFormatWithSeconds(
base::TimeDelta::FromMilliseconds(directive.retry_period_millis()),
base::DurationFormatWidth::DURATION_WIDTH_NARROW, &retry_period);
if (!success) {
retry_period = base::UTF8ToUTF16(
"[Error formatting time " +
base::NumberToString(directive.retry_period_millis()) + "ms]");
}
dict.SetStringKey("Failure retry delay", retry_period);
}
dict.SetStringKey(
"Directive creation time",
base::TimeFormatShortDateAndTimeWithTimeZone(
base::Time::FromJavaTime(directive.create_time_millis())));
base::Value invoke_next_list(base::Value::Type::LIST);
for (const auto& invoke_next : directive.invoke_next()) {
invoke_next_list.Append(InvokeNextToReadableDictionary(invoke_next));
}
dict.SetKey("Invoke next list", std::move(invoke_next_list));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const ClientDirective& directive) {
stream << ClientDirectiveToReadableDictionary(directive);
return stream;
}
base::Value DeviceMetadataPacketToReadableDictionary(
const DeviceMetadataPacket& packet) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Instance ID", packet.device_id());
dict.SetStringKey(
"Encrypted metadata",
(packet.encrypted_metadata().empty()
? "[Empty]"
: TruncateStringForLogs(Encode(packet.encrypted_metadata()))));
dict.SetBoolKey("Needs group private key?", packet.need_group_private_key());
dict.SetStringKey("DeviceSync:BetterTogether device public key",
TruncateStringForLogs(Encode(packet.device_public_key())));
dict.SetStringKey("Device name", packet.device_name());
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const DeviceMetadataPacket& packet) {
stream << DeviceMetadataPacketToReadableDictionary(packet);
return stream;
}
base::Value EncryptedGroupPrivateKeyToReadableDictionary(
const EncryptedGroupPrivateKey& key) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Recipient Instance ID", key.recipient_device_id());
dict.SetStringKey("Sender Instance ID", key.sender_device_id());
dict.SetStringKey(
"Encrypted group private key",
(key.encrypted_private_key().empty()
? "[Empty]"
: TruncateStringForLogs(Encode(key.encrypted_private_key()))));
dict.SetIntKey("Group public key hash", key.group_public_key_hash());
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const EncryptedGroupPrivateKey& key) {
stream << EncryptedGroupPrivateKeyToReadableDictionary(key);
return stream;
}
base::Value SyncMetadataResponseToReadableDictionary(
const SyncMetadataResponse& response) {
base::Value dict(base::Value::Type::DICTIONARY);
base::Value metadata_list(base::Value::Type::LIST);
for (const auto& metadata : response.encrypted_metadata()) {
metadata_list.Append(DeviceMetadataPacketToReadableDictionary(metadata));
}
dict.SetKey("Device metadata packets", std::move(metadata_list));
dict.SetStringKey("Group public key",
TruncateStringForLogs(Encode(response.group_public_key())));
if (response.has_encrypted_group_private_key()) {
dict.SetKey("Encrypted group private key",
EncryptedGroupPrivateKeyToReadableDictionary(
response.encrypted_group_private_key()));
} else {
dict.SetStringKey("Encrypted group private key", "[Not sent]");
}
dict.SetStringKey("Freshness token",
TruncateStringForLogs(Encode(response.freshness_token())));
if (response.has_client_directive()) {
dict.SetKey("Client directive", ClientDirectiveToReadableDictionary(
response.client_directive()));
} else {
dict.SetStringKey("Client directive", "[Not sent]");
}
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const SyncMetadataResponse& response) {
stream << SyncMetadataResponseToReadableDictionary(response);
return stream;
}
base::Value FeatureStatusToReadableDictionary(
const DeviceFeatureStatus::FeatureStatus& status) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Feature type", status.feature_type());
dict.SetBoolKey("Enabled?", status.enabled());
dict.SetStringKey(
"Last modified time (BatchGet* only)",
base::TimeFormatShortDateAndTimeWithTimeZone(
base::Time::FromJavaTime(status.last_modified_time_millis())));
dict.SetBoolKey("Enable exclusively (BatchSet* only)?",
status.enable_exclusively());
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const DeviceFeatureStatus::FeatureStatus& status) {
stream << FeatureStatusToReadableDictionary(status);
return stream;
}
base::Value DeviceFeatureStatusToReadableDictionary(
const DeviceFeatureStatus& status) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Instance ID", status.device_id());
base::Value feature_status_list(base::Value::Type::LIST);
for (const auto& feature_status : status.feature_statuses()) {
feature_status_list.Append(
FeatureStatusToReadableDictionary(feature_status));
}
dict.SetKey("Feature statuses", std::move(feature_status_list));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const DeviceFeatureStatus& status) {
stream << DeviceFeatureStatusToReadableDictionary(status);
return stream;
}
base::Value BatchGetFeatureStatusesResponseToReadableDictionary(
const BatchGetFeatureStatusesResponse& response) {
base::Value dict(base::Value::Type::DICTIONARY);
base::Value device_statuses_list(base::Value::Type::LIST);
for (const auto& device_statuses : response.device_feature_statuses()) {
device_statuses_list.Append(
DeviceFeatureStatusToReadableDictionary(device_statuses));
}
dict.SetKey("Device feature statuses list", std::move(device_statuses_list));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const BatchGetFeatureStatusesResponse& response) {
stream << BatchGetFeatureStatusesResponseToReadableDictionary(response);
return stream;
}
base::Value DeviceActivityStatusToReadableDictionary(
const DeviceActivityStatus& status) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Instance ID", status.device_id());
dict.SetStringKey(
"Last activity time",
base::TimeFormatShortDateAndTimeWithTimeZone(
base::Time::FromJavaTime(status.last_activity_time_sec() * 1000)));
dict.SetStringKey("Connectivity status",
ConnectivityStatusToString(status.connectivity_status()));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const DeviceActivityStatus& status) {
stream << DeviceActivityStatusToReadableDictionary(status);
return stream;
}
base::Value GetDevicesActivityStatusResponseToReadableDictionary(
const GetDevicesActivityStatusResponse& response) {
base::Value dict(base::Value::Type::DICTIONARY);
base::Value status_list(base::Value::Type::LIST);
for (const auto& status : response.device_activity_statuses()) {
status_list.Append(DeviceActivityStatusToReadableDictionary(status));
}
dict.SetKey("Device activity statuses", std::move(status_list));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const GetDevicesActivityStatusResponse& response) {
stream << GetDevicesActivityStatusResponseToReadableDictionary(response);
return stream;
}
base::Value BeaconSeedToReadableDictionary(const BeaconSeed& seed) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Data", TruncateStringForLogs(Encode(seed.data())));
dict.SetStringKey("Start time",
base::TimeFormatShortDateAndTimeWithTimeZone(
base::Time::FromJavaTime(seed.start_time_millis())));
dict.SetStringKey("End time",
base::TimeFormatShortDateAndTimeWithTimeZone(
base::Time::FromJavaTime(seed.end_time_millis())));
return dict;
}
std::ostream& operator<<(std::ostream& stream, const BeaconSeed& seed) {
stream << BeaconSeedToReadableDictionary(seed);
return stream;
}
base::Value BetterTogetherDeviceMetadataToReadableDictionary(
const BetterTogetherDeviceMetadata& metadata) {
base::Value dict(base::Value::Type::DICTIONARY);
dict.SetStringKey("Public key",
TruncateStringForLogs(Encode(metadata.public_key())));
dict.SetStringKey("PII-free device name", metadata.no_pii_device_name());
base::Value beacon_seed_list(base::Value::Type::LIST);
for (const auto& seed : metadata.beacon_seeds()) {
beacon_seed_list.Append(BeaconSeedToReadableDictionary(seed));
}
dict.SetKey("Beacon seeds", std::move(beacon_seed_list));
return dict;
}
std::ostream& operator<<(std::ostream& stream,
const BetterTogetherDeviceMetadata& metadata) {
stream << BetterTogetherDeviceMetadataToReadableDictionary(metadata);
return stream;
}
} // namespace cryptauthv2
// 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 CHROMEOS_SERVICES_DEVICE_SYNC_PROTO_CRYPTAUTH_LOGGING_H_
#define CHROMEOS_SERVICES_DEVICE_SYNC_PROTO_CRYPTAUTH_LOGGING_H_
#include <ostream>
#include <string>
#include "base/values.h"
#include "chromeos/services/device_sync/proto/cryptauth_better_together_device_metadata.pb.h"
#include "chromeos/services/device_sync/proto/cryptauth_common.pb.h"
#include "chromeos/services/device_sync/proto/cryptauth_devicesync.pb.h"
#include "chromeos/services/device_sync/proto/cryptauth_directive.pb.h"
namespace cryptauthv2 {
std::string TruncateStringForLogs(const std::string& str);
std::string TargetServiceToString(TargetService service);
std::ostream& operator<<(std::ostream& stream, const TargetService& service);
std::string InvocationReasonToString(ClientMetadata::InvocationReason reason);
std::ostream& operator<<(std::ostream& stream,
const ClientMetadata::InvocationReason& reason);
std::string ConnectivityStatusToString(ConnectivityStatus status);
std::ostream& operator<<(std::ostream& stream,
const ConnectivityStatus& status);
base::Value PolicyReferenceToReadableDictionary(const PolicyReference& policy);
std::ostream& operator<<(std::ostream& stream, const PolicyReference& policy);
base::Value InvokeNextToReadableDictionary(const InvokeNext& invoke_next);
std::ostream& operator<<(std::ostream& stream, const InvokeNext& invoke_next);
base::Value ClientDirectiveToReadableDictionary(
const ClientDirective& directive);
std::ostream& operator<<(std::ostream& stream,
const ClientDirective& directive);
base::Value DeviceMetadataPacketToReadableDictionary(
const DeviceMetadataPacket& packet);
std::ostream& operator<<(std::ostream& stream,
const DeviceMetadataPacket& packet);
base::Value EncryptedGroupPrivateKeyToReadableDictionary(
const EncryptedGroupPrivateKey& key);
std::ostream& operator<<(std::ostream& stream,
const EncryptedGroupPrivateKey& key);
base::Value SyncMetadataResponseToReadableDictionary(
const SyncMetadataResponse& response);
std::ostream& operator<<(std::ostream& stream,
const SyncMetadataResponse& response);
base::Value FeatureStatusToReadableDictionary(
const DeviceFeatureStatus::FeatureStatus& status);
std::ostream& operator<<(std::ostream& stream,
const DeviceFeatureStatus::FeatureStatus& status);
base::Value DeviceFeatureStatusToReadableDictionary(
const DeviceFeatureStatus& status);
std::ostream& operator<<(std::ostream& stream,
const DeviceFeatureStatus& status);
base::Value BatchGetFeatureStatusesResponseToReadableDictionary(
const BatchGetFeatureStatusesResponse& response);
std::ostream& operator<<(std::ostream& stream,
const BatchGetFeatureStatusesResponse& response);
base::Value DeviceActivityStatusToReadableDictionary(
const DeviceActivityStatus& status);
std::ostream& operator<<(std::ostream& stream,
const DeviceActivityStatus& status);
base::Value GetDevicesActivityStatusResponseToReadableDictionary(
const GetDevicesActivityStatusResponse& response);
std::ostream& operator<<(std::ostream& stream,
const GetDevicesActivityStatusResponse& response);
base::Value BeaconSeedToReadableDictionary(const BeaconSeed& seed);
std::ostream& operator<<(std::ostream& stream, const BeaconSeed& seed);
base::Value BetterTogetherDeviceMetadataToReadableDictionary(
const BetterTogetherDeviceMetadata& metadata);
std::ostream& operator<<(std::ostream& stream,
const BetterTogetherDeviceMetadata& metadata);
} // namespace cryptauthv2
#endif // CHROMEOS_SERVICES_DEVICE_SYNC_PROTO_CRYPTAUTH_LOGGING_H_
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