use super::*;
pub(super) fn validate_backup_sync(
id: &str,
resource: &Resource,
errors: &mut Vec<ValidationError>,
) {
if let Err(e) = crate::resources::backup_sync::backup_of(resource) {
errors.push(ValidationError {
message: format!("resource '{id}' (backup_sync): {e}"),
});
return;
}
if let Some(t) = resource.backup.token.as_deref() {
if !t.contains("{{") && t.len() > 24 {
errors.push(ValidationError {
message: format!(
"resource '{id}' (backup_sync) has a literal `backup_token`. Use \
`{{{{secrets.NAME}}}}` so the credential is resolved through the \
secrets provider instead of being committed."
),
});
}
}
}