(payload: str)
| 17 | |
| 18 | |
| 19 | def _split_pipe_payload(payload: str) -> Dict[str, str]: |
| 20 | parts = [part.strip() for part in payload.split("|")] |
| 21 | # Extend the list so unpacking always works even if Lynis omits fields |
| 22 | while len(parts) < len(ENTRY_KEYS): |
| 23 | parts.append("") |
| 24 | |
| 25 | code, message, detail, remediation, *rest = parts + [""] |
| 26 | return { |
| 27 | "code": _cleanup(code), |
| 28 | "message": _cleanup(message) or payload.strip(), |
| 29 | "detail": _cleanup(detail), |
| 30 | "remediation": _cleanup(remediation or (rest[0] if rest else "")), |
| 31 | "raw": payload.strip() |
| 32 | } |
| 33 | |
| 34 | |
| 35 | def _parse_vulnerable_package(payload: str) -> Dict[str, str]: |
no test coverage detected