-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
245 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2020 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library") | ||
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
proto_library( | ||
name = "resources_proto", | ||
srcs = ["resources.proto"], | ||
deps = [ | ||
"//sharing/proto:share_proto", | ||
], | ||
) | ||
|
||
cc_proto_library( | ||
name = "resources_cc_proto", | ||
deps = [":resources_proto"], | ||
) | ||
|
||
proto_library( | ||
name = "rpcs_proto", | ||
srcs = ["rpcs.proto"], | ||
deps = [ | ||
":resources_proto", | ||
], | ||
) | ||
|
||
cc_proto_library( | ||
name = "rpcs_cc_proto", | ||
deps = [":rpcs_proto"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// DO NOT EDIT DIRECTLY. | ||
// This file is a third_party mirror of | ||
// google/nearby/identity/v1/resources.proto. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.nearby.identity.v1; | ||
|
||
import "sharing/proto/timestamp.proto"; | ||
|
||
option java_package = "com.google.nearby.identity.v1"; | ||
option java_outer_classname = "ResourcesProto"; | ||
option java_multiple_files = true; | ||
option optimize_for = LITE_RUNTIME; | ||
|
||
// This message represents an SharedCredential generated by Google Nearby client | ||
// for a device participating in the Nearby Ecosystem. The "data" field in this | ||
// proto is transparent to the Nearby SDK clients as well as the Nearby backend | ||
// service. | ||
message SharedCredential { | ||
// Data type of the "data" field. | ||
enum DataType { | ||
// Undefined or unset. | ||
DATA_TYPE_UNSPECIFIED = 0; | ||
// For Nearby Share. | ||
DATA_TYPE_PUBLIC_CERTIFICATE = 1; | ||
// For Nearby Presence. | ||
DATA_TYPE_SHARED_CREDENTIAL = 2; | ||
} | ||
|
||
// The unique identifier for the SharedCredential. | ||
int64 id = 1; | ||
|
||
// Set it to DATE_TYPE_NEARBY_PUBLIC_CERTIFICATE for Nearby Share and | ||
// DATA_TYPE_NEARBY_SHARED_CREDENTIAL for Nearby Presence. | ||
DataType data_type = 2; | ||
|
||
// Serialized proto based on data_type that indicates the proto type, e.g. | ||
// DATA_TYPE_PUBLIC_CERTIFICATE for proto message PublicCertificate. The | ||
// server will store and distribute them to contacts and requesters, but it | ||
// doesn't interprete the data itself. | ||
bytes data = 3; | ||
|
||
// The expiration timestamp. The SharedCredential is excluded from the | ||
// QuerySharedCredentials RPC response if it is expired. | ||
.nearby.sharing.proto.Timestamp expiration_time = 5; | ||
} | ||
|
||
// The SharedCredentials for a specific visibility. | ||
message PerVisibilitySharedCredentials { | ||
// The visility of the SharedCredential. | ||
enum Visibility { | ||
// Undefined or unset. | ||
VISIBILITY_UNSPECIFIED = 0; | ||
// Visible to requester's devices only | ||
VISIBILITY_SELF = 1; | ||
// Visible to requester's contacts. This also implies VISIBILITY_SELF. | ||
VISIBILITY_CONTACTS = 2; | ||
} | ||
// The visibility of the SharedCredentials. | ||
Visibility visibility = 1; | ||
// All the SharedCredentials for the visibility. | ||
repeated SharedCredential shared_credentials = 2; | ||
} | ||
|
||
// Device represents the device meta information and its SharedCredentials | ||
// for discovery. | ||
message Device { | ||
// The device id, unique per gaia user. | ||
string name = 1; | ||
// The display_name. | ||
string display_name = 2; | ||
|
||
// What contact and how they should be used in distribute the | ||
// SharedCredentials. | ||
enum Contact { | ||
// Unknown or unset. It will be treated as an error. | ||
CONTACT_UNSPECIFIED = 0; | ||
// For the requester only. | ||
CONTACT_SELF = 1; | ||
// The Google contact, the best effort for the freshness. | ||
CONTACT_GOOGLE_CONTACT = 2; | ||
// The latest Google contacts in the Google backend. | ||
CONTACT_GOOGLE_CONTACT_LATEST = 3; | ||
} | ||
// For CONTACT_GOOGLE_CONTACT/CONTACT_GOOGLE_CONTACT_LATEST, the service will | ||
// allow requester's Google contacts to download (Query) SharedCredentials | ||
// from the Nearby service. | ||
Contact contact = 3; | ||
|
||
// All the SharedCredentials including VISIBILITY_SELF and VISIBILITY_CONTACT. | ||
// When per_visibility_shared_credentials for VISIBILITY_CONTACT and the | ||
// contact is not CONTACT_SELF, the server will make those to be accessible to | ||
// (downloaded by) the requester's contacts. | ||
repeated PerVisibilitySharedCredentials per_visibility_shared_credentials = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright 2021 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// DO NOT EDIT DIRECTLY. | ||
// This file is a third_party mirror of | ||
// google/nearby/identity/v1/rpcs.proto. | ||
|
||
syntax = "proto3"; | ||
|
||
package google.nearby.identity.v1; | ||
|
||
import "proto/identity/resources.proto"; | ||
|
||
option java_package = "com.google.nearby.identity.v1"; | ||
option java_outer_classname = "RpcsProto"; | ||
option java_multiple_files = true; | ||
option optimize_for = LITE_RUNTIME; | ||
|
||
// Publish the Device's SharedCredentials, its meta-info and contacts info | ||
// that the backend uses to distribute the SharedCredentials. | ||
message PublishDeviceRequest { | ||
// The Device with both metadata and SharedCredentials. | ||
Device device = 1; | ||
} | ||
// The response message for PublishDevic RPC. | ||
message PublishDeviceResponse { | ||
// The enum used to indicate the contact update result. | ||
enum ContactUpdate { | ||
// The contact is not updated. | ||
CONTACT_UPDATE_UNSPECIFIED = 0; | ||
// The contact is updated. | ||
CONTACT_UPDATE_ADDED = 1; | ||
// The contact is removed. | ||
CONTACT_UPDATE_REMOVED = 2; | ||
} | ||
// The contact update result. | ||
repeated ContactUpdate contact_updates = 1; | ||
} | ||
|
||
// Query all the SharedCredentials. | ||
message QuerySharedCredentialsRequest { | ||
// The Device to query with format: devices/{device}. The device is the | ||
// requester's current device-id. The device-id is used to filter out the | ||
// SharedCredentials from the current device as the device has all of them. | ||
string name = 1; | ||
// the page size for the streaming request. | ||
int32 page_size = 2; | ||
// the continue token. | ||
string page_token = 3; | ||
} | ||
|
||
// The message containing all the SharedCredentials the requester can access, | ||
// i.e. those devices using the SharedCredentials in advertising are visible to | ||
// the requester. | ||
message QuerySharedCredentialsResponse { | ||
// All the unexpired SharedCredentials that other devices has shared with the | ||
// requester | ||
repeated SharedCredential shared_credentials = 1; | ||
// next page token. | ||
string next_page_token = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters