Build a work-item `secret` the way the control plane does: URL-safe base64 of a JSON payload, without padding.
(payload: dict[str, Any])
| 50 | |
| 51 | |
| 52 | def _encode_secret(payload: dict[str, Any]) -> str: |
| 53 | """Build a work-item `secret` the way the control plane does: URL-safe |
| 54 | base64 of a JSON payload, without padding.""" |
| 55 | return base64.urlsafe_b64encode(json.dumps(payload).encode()).decode().rstrip("=") |
| 56 | |
| 57 | |
| 58 | def _api_status_error(code: int, body: object = None) -> APIStatusError: |
no test coverage detected