Enforce outbound policy at each HTTP connection
This commit is contained in:
parent
be651d559c
commit
12c59ee70f
1 changed files with 1397 additions and 4 deletions
35
crates/remora-outbound/src/lib.rs
Normal file
35
crates/remora-outbound/src/lib.rs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
mod policy;
|
||||
mod resolver;
|
||||
mod transport;
|
||||
mod url;
|
||||
|
||||
pub use policy::{AllowedEndpoint, OutboundPolicy, OutboundPolicyBuilder};
|
||||
pub use resolver::{Resolver, SystemResolver};
|
||||
pub use transport::{OutboundClient, OutboundClientBuilder, OutboundRequest, OutboundResponse};
|
||||
pub use url::{CanonicalUrl, Origin};
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Error, PartialEq)]
|
||||
pub enum OutboundError {
|
||||
#[error("outbound URL is invalid")]
|
||||
InvalidUrl,
|
||||
#[error("outbound scheme and port are denied")]
|
||||
SchemePortDenied,
|
||||
#[error("outbound name resolution failed")]
|
||||
ResolutionFailed,
|
||||
#[error("outbound name resolution returned no addresses")]
|
||||
EmptyResolution,
|
||||
#[error("outbound name resolution contains a denied address")]
|
||||
AddressDenied,
|
||||
#[error("outbound request headers are invalid")]
|
||||
InvalidHeaders,
|
||||
#[error("outbound redirect is invalid")]
|
||||
InvalidRedirect,
|
||||
#[error("outbound redirect limit exceeded")]
|
||||
RedirectLimit,
|
||||
#[error("outbound HTTPS downgrade is denied")]
|
||||
HttpsDowngrade,
|
||||
#[error("outbound transport failed")]
|
||||
Transport,
|
||||
}
|
||||
Loading…
Reference in a new issue