From a555ccb1f5626912c049a8d5b76a1fe7525d7615 Mon Sep 17 00:00:00 2001 From: Niklas Fiekas Date: Wed, 18 Mar 2020 20:43:09 +0100 Subject: [PATCH] safer authorization header --- bin/ci-deploy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/ci-deploy.py b/bin/ci-deploy.py index d28aeefcc7..78960e807b 100644 --- a/bin/ci-deploy.py +++ b/bin/ci-deploy.py @@ -10,6 +10,7 @@ import logging import asyncssh import shlex + logging.basicConfig(level=logging.DEBUG) @@ -144,7 +145,8 @@ async def main(): async with asyncssh.connect("khiaw.lichess.ovh", username="root") as ssh: logging.info(f"Downloading {url} on khiaw ...") - await ssh.run(f"wget --header=\"Authorization: token {github_api_token}\" {shlex.quote(url)}", check=True) + header = f"Authorization: {session.headers['Authorization']}" + await ssh.run(f"wget --header={shlex.quote(header)} {shlex.quote(url)}", check=True) return 0