The CLI's view-name rules (ported so the daemon refuses the same names the local path would).
(name: &str)
| 1145 | /// The CLI's view-name rules (ported so the daemon refuses the same |
| 1146 | /// names the local path would). |
| 1147 | fn validate_view_name(name: &str) -> Result<(), Status> { |
| 1148 | if name.is_empty() { |
| 1149 | return Err(domain_status( |
| 1150 | ErrorCode::InvalidArgument, |
| 1151 | "view name cannot be empty", |
| 1152 | )); |
| 1153 | } |
| 1154 | if name.len() > 100 { |
| 1155 | return Err(domain_status( |
| 1156 | ErrorCode::InvalidArgument, |
| 1157 | "view name cannot exceed 100 characters", |
| 1158 | )); |
| 1159 | } |
| 1160 | if name.contains("..") || name.contains('/') || name.contains('\\') { |
| 1161 | return Err(domain_status( |
| 1162 | ErrorCode::InvalidArgument, |
| 1163 | "view name cannot contain '..' or path separators", |
| 1164 | )); |
| 1165 | } |
| 1166 | Ok(()) |
| 1167 | } |
| 1168 | |
| 1169 | // --------------------------------------------------------------------------- |
| 1170 | // Goals — `atomic vault goal list` (ListVaultEntries kind=GOAL) |
no test coverage detected