diff options
| author | Aram Drevekenin <aram@poor.dev> | 2025-12-16 09:16:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-16 09:16:41 +0100 |
| commit | 1296a46a68f7a63681f294c12fadc9ca5e0c6459 (patch) | |
| tree | 8b829389b78205d7dcc322c80fcef50fb8a0e669 /zellij-utils/src/plugin_api/plugin_command.rs | |
| parent | HOTFIX: fix flaky macos test (diff) | |
| download | sl0ppij-1296a46a68f7a63681f294c12fadc9ca5e0c6459.tar.gz sl0ppij-1296a46a68f7a63681f294c12fadc9ca5e0c6459.tar.xz sl0ppij-1296a46a68f7a63681f294c12fadc9ca5e0c6459.zip | |
Read only web tokens (#4551)
* initial implementation
* fix race condition potentially allowing read-only clients to gain write access
* clear read only status on disconnect
* cleanups and formatting
* fix tests
* refactor first message + ipc pipe creation out of trait
* fix web tests
* fix web tests again
* refactor: move os_input connection establishment to session manager trait
* add read-only-token tests
* fix: identify watchers as web-clients when they are and enforce no-web-clients for them as well
* identify watcher web clients on the server
* fix tests
* cleanups and formatting
* add read-only-tokens to the plugin api
* update share plugin ui for read-only tokens
* cleanups and formatting
* docs(changelog): add PR
Diffstat (limited to 'zellij-utils/src/plugin_api/plugin_command.rs')
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs index 771bb9ec..542e1ea2 100644 --- a/zellij-utils/src/plugin_api/plugin_command.rs +++ b/zellij-utils/src/plugin_api/plugin_command.rs @@ -1761,6 +1761,7 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand { Some(Payload::GenerateWebLoginTokenPayload(generate_web_login_token_payload)) => { Ok(PluginCommand::GenerateWebLoginToken( generate_web_login_token_payload.token_label, + generate_web_login_token_payload.read_only.unwrap_or(false), )) }, _ => Err("GenerateWebLoginToken requires a payload"), @@ -2996,12 +2997,17 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand { )), }) }, - PluginCommand::GenerateWebLoginToken(token_label) => Ok(ProtobufPluginCommand { - name: CommandName::GenerateWebLoginToken as i32, - payload: Some(Payload::GenerateWebLoginTokenPayload( - GenerateWebLoginTokenPayload { token_label }, - )), - }), + PluginCommand::GenerateWebLoginToken(token_label, read_only) => { + Ok(ProtobufPluginCommand { + name: CommandName::GenerateWebLoginToken as i32, + payload: Some(Payload::GenerateWebLoginTokenPayload( + GenerateWebLoginTokenPayload { + token_label, + read_only: Some(read_only), + }, + )), + }) + }, PluginCommand::RevokeWebLoginToken(token_label) => Ok(ProtobufPluginCommand { name: CommandName::RevokeWebLoginToken as i32, payload: Some(Payload::RevokeWebLoginTokenPayload( |
