Generate a signed token for task status access without auth.
(task_id: str)
| 23 | |
| 24 | |
| 25 | def _generate_task_token(task_id: str) -> str: |
| 26 | """Generate a signed token for task status access without auth.""" |
| 27 | secret = settings.SECRET_KEY.encode() |
| 28 | return hmac.new(secret, task_id.encode(), hashlib.sha256).hexdigest()[:32] |
| 29 | |
| 30 | |
| 31 | def _verify_task_token(task_id: str, token: str) -> bool: |
no outgoing calls
no test coverage detected