Skip to content

[clipboard-manager] support hinting clipboard managers to exclude copied items from history #3375

@umtdg

Description

@umtdg

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 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, but they seem to be holding it due to the lack of wasm support.

I have an implementation here 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions