Skip to content

Commit 49cc68a

Browse files
committed
easy access
Signed-off-by: 21pages <sunboeasy@gmail.com>
1 parent 48c37de commit 49cc68a

3 files changed

Lines changed: 27 additions & 9 deletions

File tree

protos/message.proto

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ message LoginRequest {
8888
string my_platform = 13;
8989
bytes hwid = 14;
9090
string avatar = 17;
91+
bytes easy_access_token = 18;
92+
bytes easy_access_signature = 19;
9193
}
9294

9395
message Terminal {
94-
string service_id = 1; // Service ID for reconnecting to existing session
96+
string service_id = 1; // Service ID for reconnecting to existing session
9597
}
9698

9799
message Auth2FA {
@@ -439,7 +441,7 @@ message FileTransferDigest {
439441
bool is_upload = 5;
440442
bool is_identical = 6;
441443
uint64 transferred_size = 7; // For resume. Indicates the size of the file already transferred
442-
bool is_resume = 8; // For resume. Indicates if the transfer is a resume.
444+
bool is_resume = 8; // For resume. Indicates if the transfer is a resume.
443445
// `is_resume` can let the controlled side know whether to check the `.digest` file.
444446
// When `is_resume` is false, `.digest` exists, the same file does not exist,
445447
// the controlled side should not check `.digest`, it should confirm with a new transfer request.
@@ -889,7 +891,7 @@ message ScreenshotResponse {
889891

890892
// Terminal messages - standalone feature like FileAction
891893
message OpenTerminal {
892-
int32 terminal_id = 1; // 0 for default terminal
894+
int32 terminal_id = 1; // 0 for default terminal
893895
uint32 rows = 2;
894896
uint32 cols = 3;
895897
}
@@ -924,7 +926,7 @@ message TerminalOpened {
924926
bool success = 2;
925927
string message = 3;
926928
uint32 pid = 4;
927-
string service_id = 5; // Service ID for persistent sessions
929+
string service_id = 5; // Service ID for persistent sessions
928930
repeated int32 persistent_sessions = 6; // Used to restore the persistent sessions.
929931
}
930932

protos/rendezvous.proto

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ message PunchHoleRequest {
3030
bytes socket_addr_v6 = 10;
3131
}
3232

33-
message ControlPermissions {
33+
// Data passed from server to controlled device (via PunchHole / FetchLocalAddr / RequestRelay)
34+
message ControlledConfig {
3435
enum Permission {
3536
keyboard = 0;
3637
remote_printer = 1;
@@ -45,7 +46,9 @@ message ControlPermissions {
4546
block_input = 10;
4647
remote_modify = 11;
4748
}
48-
uint64 permissions = 1;
49+
uint64 control_permissions = 1;
50+
bytes easy_access_token = 2; // encrypted, opaque to both peers
51+
bytes manager_id = 3; // user manager uuid
4952
}
5053

5154
message PunchHole {
@@ -56,7 +59,7 @@ message PunchHole {
5659
bool force_relay = 5;
5760
int32 upnp_port = 6;
5861
bytes socket_addr_v6 = 7;
59-
ControlPermissions control_permissions = 8;
62+
ControlledConfig conn_config = 8;
6063
}
6164

6265
message TestNatRequest {
@@ -107,6 +110,12 @@ message RegisterPkResponse {
107110
int32 keep_alive = 2;
108111
}
109112

113+
// Data passed from server to controller (via PunchHoleResponse / RelayResponse)
114+
message ControllerConfig {
115+
bytes easy_access_token = 1; // encrypted, opaque to both peers
116+
bytes sk = 2; // user sk or user group sk for easy access signature
117+
}
118+
110119
message PunchHoleResponse {
111120
bytes socket_addr = 1;
112121
bytes pk = 2;
@@ -127,6 +136,7 @@ message PunchHoleResponse {
127136
bool is_udp = 9;
128137
int32 upnp_port = 10;
129138
bytes socket_addr_v6 = 11;
139+
ControllerConfig controller_config = 12;
130140
}
131141

132142
message ConfigUpdate {
@@ -143,7 +153,7 @@ message RequestRelay {
143153
string licence_key = 6;
144154
ConnType conn_type = 7;
145155
string token = 8;
146-
ControlPermissions control_permissions = 9;
156+
ControlledConfig conn_config = 9;
147157
}
148158

149159
message RelayResponse {
@@ -159,6 +169,7 @@ message RelayResponse {
159169
int32 feedback = 9;
160170
bytes socket_addr_v6 = 10;
161171
int32 upnp_port = 11;
172+
ControllerConfig controller_config = 12;
162173
}
163174

164175
message SoftwareUpdate { string url = 1; }
@@ -171,7 +182,7 @@ message FetchLocalAddr {
171182
bytes socket_addr = 1;
172183
string relay_server = 2;
173184
bytes socket_addr_v6 = 3;
174-
ControlPermissions control_permissions = 4;
185+
ControlledConfig conn_config = 4;
175186
}
176187

177188
message LocalAddr {

src/config.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,6 +2539,11 @@ pub fn is_disable_installation() -> bool {
25392539
is_some_hard_opton("disable-installation")
25402540
}
25412541

2542+
#[inline]
2543+
pub fn is_allow_easy_access() -> bool {
2544+
is_some_hard_opton("allow-easy-access")
2545+
}
2546+
25422547
// This function must be kept the same as the one in flutter and sciter code.
25432548
// flutter: flutter/lib/common.dart -> option2bool()
25442549
// sciter: Does not have the function, but it should be kept the same.

0 commit comments

Comments
 (0)