Skip to content

Commit

Permalink
Clipboard integration (#17)
Browse files Browse the repository at this point in the history
* Clipboard source/destination integration

* Docs update
  • Loading branch information
abdolence authored Aug 14, 2024
1 parent ae6e871 commit dc5c71a
Show file tree
Hide file tree
Showing 6 changed files with 450 additions and 1 deletion.
254 changes: 253 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rand = "0.8"
pdfium-render = { version = "0.8", features = ["thread_safe", "image"], optional = true }
image = "0.25"
bytes = { version = "1" }
arboard = { version = "3", features = ["image"] }


[dev-dependencies]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Google Cloud Platform's DLP API.
* Google Cloud Storage (GCS)
* Amazon Simple Storage Service (S3)
* Zip files
* Clipboard (text content and images)
* **DLP Integration:**
* [Google Cloud Platform DLP](https://cloud.google.com/security/products/dlp?hl=en) for accurate and customizable
redaction for:
Expand Down Expand Up @@ -217,6 +218,12 @@ Override media types based on filenames:
redacter cp --mime-override "text/plain=*.bin" ...
```

Redact an image from clipboard:

```sh
redacter cp clipboard:// tmp/image/ ...
```

## List (LS) command

For convenience, the tool also supports listing files in the source directory so you can see what files will be copied:
Expand Down
5 changes: 5 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use gcloud_sdk::tonic::metadata::errors::InvalidMetadataValue;
use indicatif::style::TemplateError;
use std::time::SystemTimeError;
use thiserror::Error;

#[derive(Error, Debug)]
Expand Down Expand Up @@ -38,6 +39,10 @@ pub enum AppError {
PdfiumError(#[from] pdfium_render::prelude::PdfiumError),
#[error("Image conversion error: {0}")]
ImageError(#[from] image::ImageError),
#[error("Clipboard error: {0}")]
ClipboardError(#[from] arboard::Error),
#[error("SystemTimeError: {0}")]
SystemTimeError(#[from] SystemTimeError),
#[error("System error: {message}")]
SystemError { message: String },
}
Expand Down
Loading

0 comments on commit dc5c71a

Please sign in to comment.