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