mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-04 19:45:34 +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 =
|
||||
|
||||
Reference in New Issue
Block a user