Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard integration #17

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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