feat: add ClipboardPolicy to ConnectOptions#6
Open
lettimepassby wants to merge 1 commit into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
图形会话(lion / RDP、VNC)需要从 JumpServer core 接收细粒度的剪贴板策略(文件上行/下行、字符串复制/粘贴,以及复制/粘贴的字符数上限)。
由于 SDK 的
ConnectOptions此前没有承载该策略的字段,临时实现是把策略 JSON塞进lang连接选项里传输。lang是有真实消费方的(应用机 / RemoteApp的 Chrome 界面语言会读取它),被覆写后存在语言被污染的风险。本 PR 为该策略增加专用的强类型字段,从根本上替换这一临时方案。改动内容
model/token.goClipboardPolicy结构体,含 6 个字段:file_upload/file_download/text_copy/text_paste(bool)text_copy_max_length/text_paste_max_length(int,0 表示不限制)ConnectOptions上新增ClipboardPolicy *ClipboardPolicy json:"clipboard_policy,omitempty"。