tauri-apps / tauri-apps/plugins-workspace
[clipboard-manager] support hinting clipboard managers to exclude copied items from history
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
### Describe the problem
I am working on a project that requires copying secrets to the clipboard without having them saved on clipboard managers' history in order not to leak or expose secrets as plain-text. The behavior is very similar to how password managers copy secrets into clipboard.
### Describe the solution you'd like
In order not to break compatibility, I was thinking of adding either a single `write_secret` function for texts without supporting html and image, or three functions named `write_*_secret` for text, html, and image.
I did search through the `arboard` code base and there are platform specific extensions under `SetExtLinux`, `SetExtApple`, and `SetExtWindows` for each desktop platforms. Related functions that are implemented for each platform are as follows:
- **Linux** has `exclude_from_history`
- **Apple** has `exclude_from_history`
- **Windows** has `exclude_from_history`, `exclude_from_cloud`, and `exclude_from_monitoring`
According to [this](https://github.com/1Password/arboard/pull/155#issuecomment-3014681875) comment Linux support seems to be released in `3.6.0` version and this would require the plugin to bump `arboard` version to at least `3.6.0`.
There is also an issue to [promote `exclude_from_history` from extensions](https://github.com/1Password/arboard/issues/195), but they seem to be holding it due to the lack of `wasm` support.
I have an implementation [here](https://github.com/tauri-apps/plugins-workspace/compare/v2...umtdg:plugins-workspace:feat-clipboard-exclude?expand=1) using the functions mentioned above. I tested the implementation with both the example app and my application using a local path and seems to be working fine for now. I only tested the example app on Wayland and Apple Silicon, and i will try to test on Windows and X11 too. I am happy to submit a PR if this gets any traciton and until then I will be using my own fork.
### Alternatives considered
I could theoretically use the inner `arboard::Clipboard` in my app and bypass the plugin's abstraction layer, but I couldn't find a way to access to the `clipboard` field in the plugin's public API.
### Additional context
My use case is limited to desktop and I didn't do any research on if this can be added to mobile.
Contributor guide
Assessment
This issue has not been assessed yet.