Skip to main content

cloudiful_redactor/
lib.rs

1mod detect;
2mod input;
3mod llm;
4mod redactor;
5mod replace;
6mod service;
7mod session;
8mod session_types;
9#[cfg(test)]
10mod tests;
11mod types;
12
13pub use input::InputKind;
14pub use llm::LlmConfig;
15pub use redactor::{Redactor, RedactorBuilder, SessionRedactor};
16pub use service::{
17    EncryptedRedactionArtifact, decrypt_permits, decrypt_redaction_session, redact_text_artifact,
18    redact_text_artifact_with_source, redact_text_artifact_with_source_and_stateful_session,
19    redact_text_artifact_with_stateful_session, redact_text_with_encrypted_session,
20    redact_text_with_encrypted_session_and_source, restore_text_from_encrypted_session,
21    restore_text_from_store,
22};
23pub use session::{
24    RestoreContext, SessionStore, SessionStoreError, StoredSession, authorized_tokens,
25    create_restore_permit, decrypt_restore_permit, decrypt_session_from_storage,
26    decrypt_session_from_str, encrypt_restore_permit, encrypt_session_for_storage,
27    encrypt_session_to_string, ensure_restore_valid, inspect_encrypted_session,
28    require_external_id, restore_patch_with_session, restore_text_with_session,
29};
30use thiserror::Error;
31pub use types::{
32    AppliedReplacement, CustomFileRule, CustomStringMatch, CustomStringRule, CustomStringScope,
33    Finding, FindingKind, FindingSource, RedactionArtifact, RedactionPolicy, RedactionResult,
34    RedactionRules, RedactionSession, RedactionStats, ReplacementStrategy, RestorationEntry,
35    RestorePermit, RestoreResult, SessionEntrySummary, SessionSummary,
36};
37
38#[derive(Debug, Error)]
39pub enum RedactorError {
40    #[error("llm error: {0}")]
41    Llm(String),
42    #[error("validation error: {0}")]
43    Validation(String),
44}