INNER CODE UNIT · Python
sync_railway_secrets
phasehq/console · backend/api/utils/syncing/railway/main.py:122
def sync_railway_secrets(
secrets, credential_id, project_id, railway_environment_id, service_id=None
):
try:
credentials = get_credentials(credential_id)
api_token = credentials.get("api_token")
headers = {
"Authorization": f"Bearer {api_token}",
"Content-Type": "application/json",
"Accept-Encoding": "application/json",
}
# Prepare the secrets to the format expected by Railway
formatted_secrets = {k: v for k, v, _ in secrets}
# Build the mutation query