Expand description
HTTP-backed external guard adapters.
This crate hosts the concrete cloud guardrail and threat-intel guards that
need an HTTP transport dependency. The generic async adapter, retry,
caching, and circuit-breaker infrastructure remains in chio-guards.
Re-exports§
pub use external::denied_external_guard_ip;pub use external::validate_external_guard_url;pub use external::validate_external_guard_url_with_resolver;pub use external::validate_external_guard_url_without_dns;pub use external::AzureCategory;pub use external::AzureCategoryBreakdown;pub use external::AzureContentSafetyConfig;pub use external::AzureContentSafetyGuard;pub use external::AzureDecisionDetails;pub use external::BedrockDecisionDetails;pub use external::BedrockGuardrailConfig;pub use external::BedrockGuardrailGuard;pub use external::BedrockSource;pub use external::SafeBrowsingConfig;pub use external::SafeBrowsingGuard;pub use external::SnykConfig;pub use external::SnykGuard;pub use external::SnykSeverity;pub use external::VertexDecisionDetails;pub use external::VertexProbability;pub use external::VertexRatingBreakdown;pub use external::VertexSafetyConfig;pub use external::VertexSafetyGuard;pub use external::VirusTotalConfig;pub use external::VirusTotalGuard;
Modules§
Structs§
- Async
Guard Adapter - Adapter that composes circuit breaker + token bucket + TTL cache + retry
on top of an
ExternalGuard. - Async
Guard Adapter Builder - Fluent builder for
AsyncGuardAdapter. - Async
Guard Adapter Config - Configuration for
AsyncGuardAdapter. Built viaAsyncGuardAdapter::builder. - Circuit
Breaker - Thread-safe three-state circuit breaker.
- Circuit
Breaker Config - Static configuration for a
CircuitBreaker. - Guard
Call Context - Subset of guard-request information passed to an
ExternalGuard. - Retry
Config - Retry configuration.
- Scoped
Async Guard - Synchronous kernel bridge for an async external guard adapter.
- Token
Bucket - Single-instance token bucket rate limiter.
- Tokio
Clock - Default
Clockimplementation backed by Tokio’s pausable timer. - TtlCache
- Thread-safe TTL cache with LRU eviction.
Enums§
- Backoff
Strategy - Backoff strategy between retry attempts.
- Circuit
Open Verdict - Verdict returned when the circuit breaker is open.
- Circuit
State - State of the circuit breaker.
- External
Guard Error - Errors surfaced from an
ExternalGuardcall. - Rate
Limited Verdict - Verdict returned when the token bucket rejects a call.
Traits§
- Clock
- Clock abstraction used by the cache and other resilience primitives.
- External
Guard - Trait implemented by guards that call external services.
Functions§
- retry_
with_ jitter - Run
opwith retry + jitter using a deterministic RNG seeded fromconfig.max_retries. For customizable randomness seeretry_with_jitter_rng. - retry_
with_ jitter_ rng - Run
opwith retry + jitter using a caller-supplied RNG.