One question about the header replacement. git over HTTPS sends the token as Basic auth, so the stub ends up base64-encoded inside the Authorization header and a plain string replace wouldn't match it. Does the GitHub addon decode and re-encode that header, or do pushes go through a different path?
Also agree on dev containers: SSH agent forwarding being on by default undoes a lot of the isolation people think they're getting.
def _decoded(value: str) -> str:
# git and acli put the token in the password half of Basic auth.
if value.startswith("Basic "):
return base64.b64decode(value[len("Basic ") :]).decode()
return value
def _substitute(value: str, placeholder: str, secret: str) -> str:
if value.startswith("Basic "):
return "Basic " + base64.b64encode(_decoded(value).replace(placeholder, secret).encode()).decode()
return value.replace(placeholder, secret)