From ac282e7b73b354e33a87665da1f7d7357573c2a5 Mon Sep 17 00:00:00 2001 From: Konstantin Ivanov <54908981+konstantiniiv@users.noreply.github.com> Date: Wed, 21 May 2025 13:26:42 +0200 Subject: [PATCH] DROID-3678 Protocol | Integrate 0.41.0-rc7mobile (#2422) --- gradle/libs.versions.toml | 2 +- protocol/src/main/proto/commands.proto | 70 ++++++++++++++++++++++++++ protocol/src/main/proto/events.proto | 1 + protocol/src/main/proto/models.proto | 9 ++++ 4 files changed, 81 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a1558abaa2..fcf6834f91 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -middlewareVersion = "v0.41.0-rc5mobile" +middlewareVersion = "v0.41.0-rc7mobile" kotlinVersion = '2.0.21' kspVersion = "2.0.21-1.0.25" diff --git a/protocol/src/main/proto/commands.proto b/protocol/src/main/proto/commands.proto index 5ccb85e395..d4852a15c8 100644 --- a/protocol/src/main/proto/commands.proto +++ b/protocol/src/main/proto/commands.proto @@ -1265,7 +1265,77 @@ message Rpc { } } } + message ListApps { + message Request { + } + + message Response { + Error error = 1; + repeated model.Account.Auth.AppInfo app = 2; + + message Error { + Code code = 1; + string description = 2; + + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + + ACCOUNT_IS_NOT_RUNNING = 101; + } + } + } + } + message CreateApp { + message Request { + model.Account.Auth.AppInfo app = 1; + } + + message Response { + Error error = 1; + string appKey = 2; // persistent key, that can be used to restore session via CreateSession or for JSON API + + message Error { + Code code = 1; + string description = 2; + + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + + ACCOUNT_IS_NOT_RUNNING = 101; + } + } + } + } + message RevokeApp { + message Request { + string appHash = 1; + } + + message Response { + Error error = 1; + + message Error { + Code code = 1; + string description = 2; + + enum Code { + NULL = 0; + UNKNOWN_ERROR = 1; + BAD_INPUT = 2; + NOT_FOUND = 3; + + ACCOUNT_IS_NOT_RUNNING = 101; + } + } + } + } + } + } message Workspace { message GetCurrent { diff --git a/protocol/src/main/proto/events.proto b/protocol/src/main/proto/events.proto index 591d784e24..31da241fbb 100644 --- a/protocol/src/main/proto/events.proto +++ b/protocol/src/main/proto/events.proto @@ -197,6 +197,7 @@ message Event { message ClientInfo { string processName = 1; string processPath = 2; + string name = 4; bool signatureVerified = 3; } string challenge = 1; diff --git a/protocol/src/main/proto/models.proto b/protocol/src/main/proto/models.proto index b10480e812..a5a4bf4ca4 100644 --- a/protocol/src/main/proto/models.proto +++ b/protocol/src/main/proto/models.proto @@ -677,6 +677,15 @@ message Account { } message Auth { + message AppInfo { + string appHash = 1; + string appName = 2; // either from process or specified manually when creating + string appKey = 4; + int64 createdAt = 5; + int64 expireAt = 6; + LocalApiScope scope = 7; + bool isActive = 8; + } enum LocalApiScope { Limited = 0; // Used in WebClipper; AccountSelect(to be deprecated), ObjectSearch, ObjectShow, ObjectCreate, ObjectCreateFromURL, BlockPreview, BlockPaste, BroadcastPayloadEvent JsonAPI = 1; // JSON API only, no direct grpc api calls allowed