Repository navigation
Conversation
Safari blocks fetch() from the https dashboard to http://127.0.0.1 as mixed content, and Chrome gates it behind a Local Network Access prompt. The dashboard now submits a top-level form POST to the callback server, which responds with a 303 redirect to the success page. Over SSH, the callback server is skipped and the user pastes the API key.
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
==========================================
- Coverage 91.67% 91.44% -0.23%
==========================================
Files 13 13
Lines 2523 2538 +15
==========================================
+ Hits 2313 2321 +8
- Misses 210 217 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Browser-based
apitally authfails in Safari: WebKit blocks anyhttp://subresource request from anhttps://page as mixed content, includinghttp://127.0.0.1(WebKit bug 171934). Chrome also gates it behind a Local Network Access permission prompt. Top-level form navigations are not subject to mixed-content blocking, so the callback transport changes from a cross-originfetch()to a form POST.Requires the matching dashboard change to be deployed first.
Changes
{app_url}/cli-auth?callback_port=<port>&callback_mode=form.POST /callbackwith anapplication/x-www-form-urlencodedbody containingapi_key:303 See OtherwithLocation: {app_url}/cli-auth/successand stops listening.api_keygets400 Bad Requestand the server keeps listening.Content-Length(capped at 64 KiB), instead of a singleread().Access-Control-*headers) are removed.SSH_CONNECTIONorSSH_TTYset), the browser cannot reach the CLI's loopback server, so no callback server is started. The CLI opens{app_url}/cli-authwithout query parameters and waits for the API key to be pasted. Without an interactive terminal it fails immediately, pointing to--api-key/APITALLY_API_KEY.form_urlencodedas a direct dependency (already in the lock file viamockito).Testing
test_run_with_callbackfor the form POST protocol, including headers and body arriving in separate writes.curlagainst the built binary (303 +Location, 400 withoutapi_key,auth.jsonwritten).