mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 11:43:57 +08:00
refactor(database): certify canonical restore boundary
This commit is contained in:
+604
-152
File diff suppressed because it is too large
Load Diff
@@ -93,7 +93,14 @@ pub(crate) fn validate_provider_storage_json(
|
||||
settings_config: &str,
|
||||
meta: &str,
|
||||
) -> Result<(), AppError> {
|
||||
decode_provider_json(app_type, provider_id, settings_config, meta).map(|_| ())
|
||||
let (_, meta) = decode_provider_json(app_type, provider_id, settings_config, meta)?;
|
||||
if let Some(multiplier) = meta.cost_multiplier.as_deref() {
|
||||
super::proxy::validate_cost_multiplier(multiplier)?;
|
||||
}
|
||||
if let Some(source) = meta.pricing_model_source.as_deref() {
|
||||
super::proxy::validate_pricing_source(source)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(super) const PROVIDER_SELECT: &str =
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
"binaryRestoreBytes": 2147483648,
|
||||
"scratchBytes": 2147483648
|
||||
},
|
||||
"specSha256": "c0bf1a34172de0b4d63ca597973c6126d8d5cbba42e73c0b7a7ff043f2a58cdb",
|
||||
"specSha256": "e2b44f6fbbb1ca7287487e68aeb5684853c024978f418be688fcd15d665fd3aa",
|
||||
"tables": [
|
||||
{"name": "providers", "policy": "portable_incoming"},
|
||||
{"name": "provider_endpoints", "policy": "portable_incoming"},
|
||||
|
||||
Reference in New Issue
Block a user