Commit e2488c09 authored by Kyle Horimoto's avatar Kyle Horimoto Committed by Commit Bot

[CrOS MultiDevice] Update CryptAuth proto messages.

They now include fields needed for the MultiDevice setup flow.

Bug: 824568, 752273
Change-Id: Ie1375ae3a288fc0fb34e047cd20f81ea45cb1ea7
Reviewed-on: https://chromium-review.googlesource.com/1008202
Commit-Queue: Kyle Horimoto <khorimoto@chromium.org>
Reviewed-by: default avatarJeremy Klein <jlklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550272}
parent 11ba24f9
......@@ -600,8 +600,8 @@ std::unique_ptr<base::DictionaryValue>
ProximityAuthWebUIHandler::IneligibleDeviceToDictionary(
const cryptauth::IneligibleDevice& ineligible_device) {
std::unique_ptr<base::ListValue> ineligibility_reasons(new base::ListValue());
for (const std::string& reason : ineligible_device.reasons()) {
ineligibility_reasons->AppendString(reason);
for (const auto& reason : ineligible_device.reasons()) {
ineligibility_reasons->AppendInteger(reason);
}
std::unique_ptr<base::DictionaryValue> device_dictionary =
......
......@@ -238,7 +238,8 @@ TEST_F(CryptAuthClientTest, FindEligibleUnlockDevicesSuccess) {
response_proto.add_eligible_devices();
response_proto.mutable_eligible_devices(0)->set_public_key(kPublicKey1);
const std::string kIneligibilityReason = "You require more vespine gas.";
const cryptauth::IneligibilityReason kIneligibilityReason =
cryptauth::IneligibilityReason::UNKNOWN_INELIGIBILITY_REASON;
response_proto.add_ineligible_devices();
response_proto.mutable_ineligible_devices(0)
->mutable_device()
......
......@@ -36,6 +36,19 @@ enum DeviceType {
BROWSER = 4;
}
// MultiDevice features which may be supported and enabled on a device.
enum SoftwareFeature {
UNKNOWN_FEATURE = 0;
BETTER_TOGETHER_HOST = 1;
BETTER_TOGETHER_CLIENT = 2;
EASY_UNLOCK_HOST = 3;
EASY_UNLOCK_CLIENT = 4;
MAGIC_TETHER_HOST = 5;
MAGIC_TETHER_CLIENT = 6;
SMS_CONNECT_HOST = 7;
SMS_CONNECT_CLIENT = 8;
}
// A seed used to feed an EID BLE advertisement for some time period. This
// key is specific to the device being targeted by the advertisement.
// Next ID: 4
......@@ -87,6 +100,13 @@ message ExternalDeviceInfo {
// Whether this is a "Pixel Experience" phone.
optional bool pixel_phone = 11 [default = false];
// A list of multi-device software features supported by the device.
repeated SoftwareFeature supported_software_features = 12;
// A list of multi-device software features currently enabled (active) on the
// device.
repeated SoftwareFeature enabled_software_features = 13;
}
// Determine if the calling device is allowed to promote the SmartLock
......@@ -136,6 +156,14 @@ message FindEligibleUnlockDevicesRequest {
// Information about the requesting device and its platform.
optional DeviceClassifier device_classifier = 6;
// The version of the setup protocol that the calling device expects to use.
optional int32 protocol_version = 7;
// The feature for which eligibility should be checked. Note that this RPC is
// overloaded instead of adding new RPCs due to the ongoing V2 transition.
// See go/unified-better-together-cryptauth for more details.
optional SoftwareFeature feature = 8 [default = EASY_UNLOCK_HOST];
}
// Response containing a list of devices that could be made Unlock Keys
......@@ -267,7 +295,7 @@ message GcmDeviceInfo {
// Fields corresponding to screenlock type/features and hardware features
// should be numbered in the 400 range.
// Is this device using a secure screenlock (e.g., pattern or pin unlock).
// Is this device using a secure screenlock (e.g., pattern or pin unlock)
optional bool using_secure_screenlock = 400 [default = false];
// Is auto-unlocking the screenlock (e.g., when at "home") supported?
......@@ -282,10 +310,37 @@ message GcmDeviceInfo {
// Is the Bluetooth (classic) radio on?
optional bool bluetooth_radio_enabled = 404 [default = false];
// The enrollment session id this is sent with.
// Does the device hardware support a mobile data connection?
optional bool mobile_data_supported = 405 [default = false];
// Does the device support tethering?
optional bool tethering_supported = 406 [default = false];
// Does the device have a BLE radio?
optional bool ble_radio_supported = 407 [default = false];
// Is the device a "Pixel Experience" Android device?
optional bool pixel_experience = 408 [default = false];
// Is the device running in the ARC++ container on a chromebook?
optional bool arc_plus_plus = 409 [default = false];
// Is the value set in |using_secure_screenlock| reliable? On some Android
// devices, the platform API to get the screenlock state is not trustworthy.
// See b/32212161.
optional bool is_screenlock_state_flaky = 410 [default = false];
// A list of multi-device software features supported by the device.
repeated SoftwareFeature supported_software_features = 411;
// A list of multi-device software features currently enabled (active) on the
// device.
repeated SoftwareFeature enabled_software_features = 412;
// The enrollment session id this is sent with
optional bytes enrollment_session_id = 1000;
// A copy of the user's OAuth token.
// A copy of the user's OAuth token
optional string oauth_token = 1001;
}
......@@ -319,18 +374,53 @@ message GetMyDevicesResponse {
repeated ExternalDeviceInfo devices = 1;
}
// Reasons why the server thinks a certain device is not eligible to be an
// EasyUnlock key.
enum IneligibilityReason {
UNKNOWN_INELIGIBILITY_REASON = 0;
// The screen is larger than 6.9 inches (which most likely means this is
// a tablet).
SCREEN_TOO_LARGE = 1;
// The device has reported that it does not support bluetooth.
BLUETOOTH_NOT_SUPPORTED = 2;
// The devices last known credentials are no longer valid.
INVALID_CREDENTIALS = 3;
// The device has reported that it does not support auto-unlocking.
AUTO_UNLOCKING_NOT_SUPPORTED = 4;
// We think the device is offline.
DEVICE_OFFLINE = 5;
// The database entry for this device was not updated in the last
// max_last_update_time_delta_millis (see FindEligibleUnlockDevicesRequest).
NO_RECENT_UPDATES = 6;
// Operating system version is not accepted.
BAD_OS_VERSION = 7;
// SmartLock client software version is not accepted.
BAD_DEVICE_SOFTWARE_VERSION = 8;
// Feature is not in supported_software_features for this device.
FEATURE_UNSUPPORTED = 9;
}
// A device that the server thinks is not eligible to be an unlock key, and the
// reason for this.
message IneligibleDevice {
// The device that is not eligible to be an unlock key.
optional ExternalDeviceInfo device = 1;
// The reasons why the server thinks it is not an unlock key. NOTE: for now,
// this list of reasons will contain exactly one element. It is a repeated
// field because, in principle, there can be more than one reason that makes a
// device not eligible to be an unlock key, and we want to be able to add
// multiple reasons in the future.
repeated string reasons = 2;
// The reasons why the server thinks it is not an unlock key.
// NOTE: for now, this list of reasons will contain exactly one element.
// It is a repeated field because, in principle, there can be more than
// one reason that makes a device not eligible to be an unlock key,
// and we want to be able to add multiple reasons in the future.
repeated IneligibilityReason reasons = 2;
}
// A list of "reasons" that can be provided for calling server-side APIs.
......@@ -512,6 +602,15 @@ message ToggleEasyUnlockRequest {
// Information about the requesting device and its platform.
optional DeviceClassifier device_classifier = 4;
// The feature for which enabled state should be toggled. Note that this RPC
// is overloaded instead of adding new RPCs due to the ongoing V2 transition.
// See go/unified-better-together-cryptauth for more details.
optional SoftwareFeature feature = 5 [default = EASY_UNLOCK_HOST];
// True if enabling one device for this feature should disable all others on
// the account.
optional bool is_exclusive = 6 [default = true];
}
message ToggleEasyUnlockResponse {
......
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