1pub mod auth;
2pub mod authz;
3pub mod error;
4pub mod events;
5pub mod gateway;
6pub mod persistence;
7pub mod protocol;
8pub mod router;
9pub mod state;
10
11pub use authz::{AuthzEngine, NoopPrincipalLookup, PrincipalLookup, ResolvedPrincipal, ResourcePolicyLookup, ScpLookup};
12pub use error::AwsError;
13pub use events::{EventBus, InternalEvent};
14pub use gateway::AppState;
15pub use persistence::PersistenceManager;
16pub use protocol::{Protocol, RouteDefinition};
17pub use router::RequestContext;
18pub use state::AccountRegionStore;
19
20use serde_json::Value;
21
22#[async_trait::async_trait]
27pub trait ServiceHandler: Send + Sync {
28 fn service_name(&self) -> &str;
30
31 fn signing_name(&self) -> &str {
34 self.service_name()
35 }
36
37 fn protocol(&self) -> Protocol;
39
40 fn routes(&self) -> Vec<RouteDefinition> {
43 Vec::new()
44 }
45
46 async fn handle(
48 &self,
49 operation: &str,
50 input: Value,
51 ctx: &RequestContext,
52 ) -> Result<Value, AwsError>;
53
54 fn snapshot(&self) -> Option<Vec<u8>> {
58 None
59 }
60
61 fn restore(&self, _data: &[u8]) -> Result<(), String> {
65 Ok(())
66 }
67
68 fn iam_action(&self, _operation: &str) -> Option<String> {
69 None
70 }
71
72 fn iam_resource(
73 &self,
74 _operation: &str,
75 _input: &serde_json::Value,
76 _ctx: &router::RequestContext,
77 ) -> Option<String> {
78 None
79 }
80}