P0: AWS Signature V4 implementation complete

- Full Canonical Request with signed headers
- Proper URI encoding (encode_slash option)
- X-Amz-Date timestamp support
- SignedHeaders extraction from Authorization header
- Payload hash from X-Amz-Content-Sha256
- 4 unit tests passing

Tests: 297 passed (293 + 4 new)
This commit is contained in:
Warren
2026-06-21 22:14:34 +08:00
parent 49873cb302
commit f5074b2ce2
4 changed files with 238 additions and 81 deletions
+2
View File
@@ -29,6 +29,7 @@ pub struct WebSection {
pub log_level: String,
pub auth_db_path: String,
pub users_db_dir: String,
pub webdav_root: String,
}
impl Default for WebSection {
@@ -39,6 +40,7 @@ impl Default for WebSection {
log_level: "info".to_string(),
auth_db_path: "data/auth.sqlite".to_string(),
users_db_dir: "data/users".to_string(),
webdav_root: "/Users/accusys/momentry/var/sftpgo/data/demo".to_string(),
}
}
}
+7
View File
@@ -18,6 +18,7 @@ pub struct ServerConfig {
pub log_level: String,
pub auth_db_path: String,
pub users_db_dir: String,
pub webdav_root: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -87,6 +88,7 @@ impl MarkBaseConfig {
log_level: "info".to_string(),
auth_db_path: "data/auth.sqlite".to_string(),
users_db_dir: "data/users".to_string(),
webdav_root: "/Users/accusys/momentry/var/sftpgo/data/demo".to_string(),
},
postgresql: PostgreSQLConfig {
host: "127.0.0.1".to_string(),
@@ -138,6 +140,9 @@ impl MarkBaseConfig {
if let Ok(log_level) = std::env::var("MB_LOG_LEVEL") {
self.server.log_level = log_level;
}
if let Ok(webdav_root) = std::env::var("MB_WEBDAV_ROOT") {
self.server.webdav_root = webdav_root;
}
if let Ok(pg_host) = std::env::var("PG_HOST") {
self.postgresql.host = pg_host;
@@ -176,6 +181,7 @@ impl MarkBaseConfig {
"server.log_level" => Some(self.server.log_level.clone()),
"server.auth_db_path" => Some(self.server.auth_db_path.clone()),
"server.users_db_dir" => Some(self.server.users_db_dir.clone()),
"server.webdav_root" => Some(self.server.webdav_root.clone()),
"postgresql.host" => Some(self.postgresql.host.clone()),
"postgresql.port" => Some(self.postgresql.port.to_string()),
@@ -221,6 +227,7 @@ impl MarkBaseConfig {
"server.log_level" => self.server.log_level = value.to_string(),
"server.auth_db_path" => self.server.auth_db_path = value.to_string(),
"server.users_db_dir" => self.server.users_db_dir = value.to_string(),
"server.webdav_root" => self.server.webdav_root = value.to_string(),
"postgresql.host" => self.postgresql.host = value.to_string(),
"postgresql.port" => self.postgresql.port = value.parse()?,