From c1d7f6e3e03e6d90a411d75abeb17df05b50f738 Mon Sep 17 00:00:00 2001 From: Anthony Rueda Date: Wed, 7 Jun 2023 09:18:29 -0700 Subject: [PATCH] [Presence] Data Structure modification for NP Multiple Account Phase One Implementation: b/285573323 PiperOrigin-RevId: 538508248 --- internal/proto/credential.proto | 12 ++++++++++++ internal/proto/metadata.proto | 15 +++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/internal/proto/credential.proto b/internal/proto/credential.proto index 7f719292..4d965327 100644 --- a/internal/proto/credential.proto +++ b/internal/proto/credential.proto @@ -31,9 +31,16 @@ enum IdentityType { IDENTITY_TYPE_PROVISIONED = 4; } +enum CredentialType { + CREDENTIAL_TYPE_UNKNOWN = 0; + CREDENTIAL_TYPE_DEVICE = 1; + CREDENTIAL_TYPE_GAIA = 2; +} + // The shared credential is derived from local credential, and distributed to // remote devices based on the trust token for identity decryption and // authentication. +// NEXT_ID=12 message SharedCredential { // The randomly generated unique id of the public credential. bytes secret_id = 1; @@ -71,4 +78,9 @@ message SharedCredential { // The version number of this SharedCredential, matches the corresponding // protocol version. bytes version = 10; + + // The type assigned to the credential. The CredentialType is used to + // determine whether a device identity credential or account based identity + // credential is used for decryption. + CredentialType type = 11; } diff --git a/internal/proto/metadata.proto b/internal/proto/metadata.proto index 819a68b7..022bd22f 100644 --- a/internal/proto/metadata.proto +++ b/internal/proto/metadata.proto @@ -22,6 +22,21 @@ option java_package = "com.google.nearby.presence"; option java_outer_classname = "MetadataProto"; option optimize_for = LITE_RUNTIME; +// The metadata of a device. Contains confidential data not to be broadcasted +// directly in OTA. +// NEXT_ID=4 +message DeviceIdentityMetaData { + // The type of the device. + DeviceType device_type = 1; + + // The name of the local device to be returned through credentials. + string device_name = 2; + + // The ChromeOS team requires the BT mac address for debugging purposes + // temporarily. This should be removed by the end of this year. + bytes bluetooth_mac_address = 3; +} + // The metadata of a device. // Contains confidential data not to be broadcasted directly in OTA. message Metadata {