pub mod auth;
pub mod authz;
pub mod body;
pub mod body_store;
pub mod error;
pub mod events;
pub mod gateway;
pub mod persistence;
pub mod protocol;
pub mod request_detail;
pub mod request_event;
pub mod router;
pub mod state;
pub use authz::{
AuthzEngine, GrantLookup, NoopPrincipalLookup, PrincipalLookup, ResolvedPrincipal,
ResourcePolicyLookup, ScpLookup,
};
pub use body::Body;
pub use body_store::{BlobInventory, BodyStore};
pub use error::AwsError;
pub use events::{EventBus, InternalEvent};
pub use gateway::{AppState, BodyStoreHandle};
pub use persistence::PersistenceManager;
pub use protocol::{Protocol, RouteDefinition};
pub use request_detail::{
CapturedBody, CapturedHeader, DEFAULT_BODY_CAP, DEFAULT_RING_CAPACITY, RequestDetail,
RequestDetailStore, capture_body, capture_headers,
};
pub use request_event::{RequestEvent, RequestEventBus};
pub use router::RequestContext;
pub use state::{AccountRegionStore, Snapshottable};
use serde_json::Value;
#[async_trait::async_trait]
pub trait ServiceHandler: Send + Sync {
fn service_name(&self) -> &str;
fn signing_name(&self) -> &str {
self.service_name()
}
fn protocol(&self) -> Protocol;
fn routes(&self) -> Vec<RouteDefinition> {
Vec::new()
}
async fn handle(
&self,
operation: &str,
input: Value,
ctx: &RequestContext,
) -> Result<Value, AwsError>;
fn snapshot(&self) -> Option<Vec<u8>> {
None
}
fn restore(&self, _data: &[u8]) -> Result<(), String> {
Ok(())
}
fn iam_action(&self, _operation: &str) -> Option<String> {
None
}
fn iam_resource(
&self,
_operation: &str,
_input: &serde_json::Value,
_ctx: &router::RequestContext,
) -> Option<String> {
None
}
}