validateAllPathComponents will enforce validation for a slice of components
(pathComponent ...string)
| 338 | |
| 339 | // validateAllPathComponents will enforce validation for a slice of components |
| 340 | func validateAllPathComponents(pathComponent ...string) error { |
| 341 | if len(pathComponent) == 0 { |
| 342 | return errors.Join(ErrInvalidArgument, errors.New("you must specify an identifier")) |
| 343 | } |
| 344 | |
| 345 | for _, key := range pathComponent { |
| 346 | if err := filesystem.ValidatePathComponent(key); err != nil { |
| 347 | return errors.Join(ErrInvalidArgument, err) |
| 348 | } |
| 349 | } |
| 350 | |
| 351 | return nil |
| 352 | } |
| 353 | |
| 354 | func IsFilesystemSafe(identifier string) error { |
| 355 | if err := filesystem.ValidatePathComponent(identifier); err != nil { |
no test coverage detected
searching dependent graphs…