This commit is contained in:
Alexey
2026-10-19 00:15:27 +03:00
parent a99b548aa1
commit 6fdc2a5ba4
43 changed files with 2764 additions and 159 deletions
+19
View File
@@ -0,0 +1,19 @@
use super::*;
#[tokio::test]
async fn quota_periods_do_not_enable_access_mutation_through_generic_config_patch() {
let dir = tempfile::tempdir().unwrap();
let path = dir.path().join("config.toml");
let body = "[access.users]\nalice = '0123456789abcdef0123456789abcdef'\n";
std::fs::write(&path, body).unwrap();
let error = apply_patch_to_path(
&path,
&serde_json::json!({"access":{"user_quota_periods":{"alice":"daily"}}}),
None,
)
.await
.err()
.unwrap();
assert_eq!(error.code, "access_not_editable");
assert_eq!(std::fs::read_to_string(path).unwrap(), body);
}