diff --git a/Cargo.lock b/Cargo.lock index 6da2bba..9cec5b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2879,7 +2879,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "elide" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "elide-codec", @@ -2917,7 +2917,7 @@ dependencies = [ [[package]] name = "elide-codec" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "bytes", @@ -2939,7 +2939,7 @@ dependencies = [ [[package]] name = "elide-context" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "elide-core", @@ -2950,7 +2950,7 @@ dependencies = [ [[package]] name = "elide-core" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "blake3", @@ -2970,7 +2970,7 @@ dependencies = [ [[package]] name = "elide-detection" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "elide-core", "futures", @@ -2982,7 +2982,7 @@ dependencies = [ [[package]] name = "elide-engine" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "bytes", "elide-codec", @@ -3000,7 +3000,7 @@ dependencies = [ [[package]] name = "elide-export" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "csv", "elide", @@ -3012,7 +3012,7 @@ dependencies = [ [[package]] name = "elide-fake" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "elide-core", @@ -3023,7 +3023,7 @@ dependencies = [ [[package]] name = "elide-governance" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "elide-core", "elide-operator", @@ -3037,7 +3037,7 @@ dependencies = [ [[package]] name = "elide-lingua" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "elide-core", @@ -3048,7 +3048,7 @@ dependencies = [ [[package]] name = "elide-llm" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "derive_builder", @@ -3069,7 +3069,7 @@ dependencies = [ [[package]] name = "elide-ner" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "derive_builder", @@ -3083,7 +3083,7 @@ dependencies = [ [[package]] name = "elide-ocr" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "derive_builder", @@ -3095,7 +3095,7 @@ dependencies = [ [[package]] name = "elide-office" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "bytes", "hipstr", @@ -3107,7 +3107,7 @@ dependencies = [ [[package]] name = "elide-operator" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "aes-gcm", "async-trait", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "elide-pattern" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "aho-corasick", "async-trait", @@ -3149,7 +3149,7 @@ dependencies = [ [[package]] name = "elide-pdf" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "bytes", "hipstr", @@ -3161,7 +3161,7 @@ dependencies = [ [[package]] name = "elide-pipeline" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "bytes", "elide", @@ -3182,7 +3182,7 @@ dependencies = [ [[package]] name = "elide-provider" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "elide", "elide-bento", @@ -3196,7 +3196,7 @@ dependencies = [ [[package]] name = "elide-redaction" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "elide-core", "hipstr", @@ -3206,7 +3206,7 @@ dependencies = [ [[package]] name = "elide-review" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "elide", "elide-governance", @@ -3218,7 +3218,7 @@ dependencies = [ [[package]] name = "elide-stt" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#95088b70854f3c7c980f57b566d2bedd15d74417" +source = "git+https://github.com/nvisycom/elide?branch=main#7da9b52534d1024602872816ce27feaad54c6a40" dependencies = [ "async-trait", "derive_builder", @@ -3230,7 +3230,7 @@ dependencies = [ [[package]] name = "elide-template" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#052d9a66647710fc9ff8e10efd2d4a926aac63d4" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#c50e46715bda0dcab13910bcac6f480ed1426e40" dependencies = [ "elide-core", "elide-governance", @@ -6996,7 +6996,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "itertools 0.14.0", "log", "multimap", @@ -8556,7 +8556,7 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.119", @@ -8568,7 +8568,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287f59010008f0d7cf5e3b03196d666c1acc46c8d3e9cf34c28a1a7157601e72" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.119", diff --git a/crates/nvisy-server/src/handler/error/engine_error.rs b/crates/nvisy-server/src/handler/error/engine_error.rs index 4baacda..dbd6ecc 100644 --- a/crates/nvisy-server/src/handler/error/engine_error.rs +++ b/crates/nvisy-server/src/handler/error/engine_error.rs @@ -1,10 +1,12 @@ //! Redaction-engine error to HTTP error conversion. //! -//! Maps `elide_pipeline::Error` onto an HTTP error by its kind: a -//! `MalformedInput` is a bad document the caller supplied (a client error), -//! while every other kind — including `CapabilityUnavailable` (a codec/renderer -//! the build does not ship) — is a server-side processing fault. The engine's -//! own message travels along as context. +//! Maps `elide_pipeline::Error` onto an HTTP error by its kind. Two kinds are +//! caller errors: `MalformedInput` is a bad document the caller supplied, and +//! `Configuration` is an incoherent request or policy set (e.g. policies that can +//! detect but never redact, or a reviewer override naming an off-pipeline +//! policy). Every other kind — including `CapabilityUnavailable` (a codec or +//! renderer the build does not ship) — is a server-side processing fault. The +//! engine's own message travels along as context. use elide_pipeline::ErrorKind as EngineErrorKind; use elide_pipeline::entity::EditError; @@ -17,6 +19,9 @@ impl<'a> From for HttpError<'a> { EngineErrorKind::MalformedInput => ErrorKind::BadRequest .with_message("Document could not be processed") .with_context(error.to_string()), + EngineErrorKind::Configuration => ErrorKind::BadRequest + .with_message("The pipeline's policies cannot process this request") + .with_context(error.to_string()), _ => ErrorKind::InternalServerError .with_message("Redaction engine failed") .with_context(error.to_string()),