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, RestoreState, SessionStore, SessionStoreError, StoredSession,
25    StreamingRestoreContext, authorized_tokens, create_restore_permit, decrypt_restore_permit,
26    decrypt_session_from_storage, decrypt_session_from_str, encrypt_restore_permit,
27    encrypt_session_for_storage, encrypt_session_to_string, ensure_restore_valid,
28    inspect_encrypted_session, require_external_id, restore_patch_with_session,
29    restore_text_with_session,
30};
31use thiserror::Error;
32pub use types::{
33    AppliedReplacement, CustomFileRule, CustomStringMatch, CustomStringRule, CustomStringScope,
34    Finding, FindingKind, FindingSource, RedactionArtifact, RedactionPolicy, RedactionResult,
35    RedactionRules, RedactionSession, RedactionStats, ReplacementStrategy, RestorationEntry,
36    RestorePermit, RestoreResult, SessionEntrySummary, SessionSummary,
37};
38
39#[derive(Debug, Error)]
40pub enum RedactorError {
41    #[error("llm error: {0}")]
42    Llm(String),
43    #[error("validation error: {0}")]
44    Validation(String),
45}