-
Notifications
You must be signed in to change notification settings - Fork 2
/
device_service.proto
74 lines (61 loc) · 2.63 KB
/
device_service.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
syntax = "proto3";
package code.device.v1;
option go_package = "github.com/code-payments/code-protobuf-api/generated/go/device/v1;device";
option java_package = "com.codeinc.gen.device.v1";
option objc_class_prefix = "CPBDevicetV1";
import "common/v1/model.proto";
import "validate/validate.proto";
service Device {
// RegisterLoggedInAccounts registers a set of owner accounts logged for
// an app install. Currently, a single login is enforced per app install.
// After using GetLoggedInAccounts to detect stale logins, clients can use
// this RPC to update the set of accounts with valid login sessions.
rpc RegisterLoggedInAccounts(RegisterLoggedInAccountsRequest) returns (RegisterLoggedInAccountsResponse);
// GetLoggedInAccounts gets the set of logged in accounts for an app install.
// Clients can use this RPC to detect stale logins for boot out of the app.
rpc GetLoggedInAccounts(GetLoggedInAccountsRequest) returns (GetLoggedInAccountsResponse);
}
message RegisterLoggedInAccountsRequest {
common.v1.AppInstallId app_install = 1 [(validate.rules).message.required = true];
// The set of owners logged into the app install. Setting an empty value
// indicates there are no logged in users. We allow for more than one owner
// in the spec with a repeated field to be flexible in the future.
repeated common.v1.SolanaAccountId owners = 2 [(validate.rules).repeated = {
min_items: 0
max_items: 1
}];
// Signature values must appear in the exact order their respecitive signing
// owner account appears in the owners field. All signatures should be generated
// without any other signature values set.
repeated common.v1.Signature signatures = 3 [(validate.rules).repeated = {
min_items: 0
max_items: 1
}];
}
message RegisterLoggedInAccountsResponse {
Result result = 1;
enum Result {
OK = 0;
INVALID_OWNER = 1;
}
// Set of invalid owner accounts detected in the request. An owner account
// can be invalid for several reasons: not phone verified, timelock account
// unlocked, etc. Value is set when result is INVALID_OWNER.
repeated common.v1.SolanaAccountId invalid_owners = 2 [(validate.rules).repeated = {
min_items: 0
max_items: 1
}];
}
message GetLoggedInAccountsRequest {
common.v1.AppInstallId app_install = 1 [(validate.rules).message.required = true];
}
message GetLoggedInAccountsResponse {
Result result = 1;
enum Result {
OK = 0;
}
repeated common.v1.SolanaAccountId owners = 2 [(validate.rules).repeated = {
min_items: 0
max_items: 1
}];
}