refactor(hermes_cli): auth group B — squeeze body blanks, fold repeated AuthError ctor

This commit is contained in:
Teknium
2026-09-02 22:27:46 -07:00
parent 31e6c6fab4
commit 55a4b75347
4 changed files with 30 additions and 80 deletions
+8 -14
View File
@@ -106,22 +106,16 @@ def _print_loopback_ssh_hint(redirect_uri: str, *, docs_url: str | None = None)
if host not in {"127.0.0.1", "::1", "localhost"} or not port:
return
divider = "-" * 60
print()
print(divider)
print("Remote session detected — SSH tunnel required")
print(divider)
print(f"Hermes is waiting for the OAuth callback on {redirect_uri}")
print("but your browser is on a different machine. Run this command")
print("in a NEW terminal on your local machine BEFORE opening the URL:")
print()
print(f" ssh -N -L {port}:127.0.0.1:{port} {_ssh_user_at_host()}")
print()
print("Then open the authorize URL above in your local browser.")
print(
f"\n{divider}\nRemote session detected — SSH tunnel required\n{divider}\n"
f"Hermes is waiting for the OAuth callback on {redirect_uri}\n"
"but your browser is on a different machine. Run this command\n"
"in a NEW terminal on your local machine BEFORE opening the URL:\n\n"
f" ssh -N -L {port}:127.0.0.1:{port} {_ssh_user_at_host()}\n\n"
"Then open the authorize URL above in your local browser.")
if docs_url:
print(f"Provider docs: {docs_url}")
print(f"SSH/jump-box guide: {OAUTH_OVER_SSH_DOCS_URL}")
print(divider)
print()
print(f"SSH/jump-box guide: {OAUTH_OVER_SSH_DOCS_URL}\n{divider}\n")
def _default_verify() -> bool | ssl.SSLContext: