| 365 | return secrets, found_secrets_file |
| 366 | |
| 367 | def _parse_file_path(self, path: str) -> tuple[Mapping[str, Any], bool]: |
| 368 | if path.endswith(".toml"): |
| 369 | return self._parse_toml_file(path) |
| 370 | |
| 371 | if os.path.isdir(path): |
| 372 | return self._parse_directory(path) |
| 373 | |
| 374 | error_msg = secret_error_messages_singleton.get_invalid_secret_path_message( |
| 375 | path |
| 376 | ) |
| 377 | raise StreamlitSecretNotFoundError(error_msg) |
| 378 | |
| 379 | def _parse(self) -> Mapping[str, Any]: |
| 380 | """Parse our secrets.toml files if they're not already parsed. |