1pub mod auth;
2pub mod authz;
3pub mod body;
4pub mod body_store;
5pub mod error;
6pub mod events;
7pub mod gateway;
8pub mod persistence;
9pub mod protocol;
10pub mod request_detail;
11pub mod request_event;
12pub mod router;
13pub mod state;
14
15pub use authz::{
16 AuthzEngine, GrantLookup, NoopPrincipalLookup, PrincipalLookup, ResolvedPrincipal,
17 ResourcePolicyLookup, ScpLookup,
18};
19pub use body::Body;
20pub use body_store::{BlobInventory, BodyStore};
21pub use error::AwsError;
22pub use events::{EventBus, InternalEvent};
23pub use gateway::{AppState, BodyStoreHandle};
24pub use persistence::PersistenceManager;
25pub use protocol::{Protocol, RouteDefinition};
26pub use request_detail::{
27 CapturedBody, CapturedHeader, DEFAULT_BODY_CAP, DEFAULT_RING_CAPACITY, RequestDetail,
28 RequestDetailStore, capture_body, capture_headers,
29};
30pub use request_event::{RequestEvent, RequestEventBus};
31pub use router::RequestContext;
32pub use state::{AccountRegionStore, Snapshottable};
33
34use serde_json::Value;
35
36#[async_trait::async_trait]
41pub trait ServiceHandler: Send + Sync {
42 fn service_name(&self) -> &str;
44
45 fn signing_name(&self) -> &str {
48 self.service_name()
49 }
50
51 fn protocol(&self) -> Protocol;
53
54 fn routes(&self) -> Vec<RouteDefinition> {
57 Vec::new()
58 }
59
60 async fn handle(
62 &self,
63 operation: &str,
64 input: Value,
65 ctx: &RequestContext,
66 ) -> Result<Value, AwsError>;
67
68 fn snapshot(&self) -> Option<Vec<u8>> {
72 None
73 }
74
75 fn restore(&self, _data: &[u8]) -> Result<(), String> {
79 Ok(())
80 }
81
82 fn iam_action(&self, _operation: &str) -> Option<String> {
83 None
84 }
85
86 fn iam_resource(
87 &self,
88 _operation: &str,
89 _input: &serde_json::Value,
90 _ctx: &router::RequestContext,
91 ) -> Option<String> {
92 None
93 }
94}