MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _generate_task_token

Function _generate_task_token

apps/backups/api_views.py:25–28  ·  view source on GitHub ↗

Generate a signed token for task status access without auth.

(task_id: str)

Source from the content-addressed store, hash-verified

23
24
25def _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
31def _verify_task_token(task_id: str, token: str) -> bool:

Callers 4

_verify_task_tokenFunction · 0.85
create_backupFunction · 0.85
get_download_tokenFunction · 0.85
restore_backupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected