16 lines
440 B
Python
Raw Permalink Normal View History

"""Gitea token-based authentication."""
from agent.encryption import encrypt_token
2026-03-20 14:38:07 +09:00
async def get_gitea_token() -> str:
import os
return os.environ.get("GITEA_TOKEN", "")
2026-03-20 14:38:07 +09:00
async def get_encrypted_gitea_token() -> tuple[str, str]:
import os
token = os.environ.get("GITEA_TOKEN", "")
fernet_key = os.environ.get("FERNET_KEY", "")
encrypted = encrypt_token(token) if fernet_key else token
2026-03-20 14:38:07 +09:00
return token, encrypted