Parse key-value pairs from a comma-separated KEY=VALUE string.
(kv_string: str | None)
| 59 | |
| 60 | |
| 61 | def parse_key_value_pairs(kv_string: str | None) -> dict[str, str]: |
| 62 | """Parse key-value pairs from a comma-separated KEY=VALUE string.""" |
| 63 | result = {} |
| 64 | if kv_string: |
| 65 | for pair in kv_string.split(","): |
| 66 | if "=" in pair: |
| 67 | key, value = pair.split("=", 1) |
| 68 | result[key.strip()] = value.strip() |
| 69 | else: |
| 70 | logging.warning(f"Skipping malformed key-value pair: {pair}") |
| 71 | return result |
| 72 | |
| 73 | |
| 74 | def parse_secrets(secrets_string: str | None) -> dict[str, dict[str, str]]: |
no outgoing calls
no test coverage detected