Repository navigation
fix(login): validate the token on the runtime's API port, not always 3333 - #1490
Merged
Merged
Conversation
…3333 With a local Console URL, `apify login` always validated the token against http://localhost:3333. A runtime started on another port (`apify runtime start --api-port 4333`, `ACTOR_RUNTIME_API_PORT` in the container) was therefore never reachable from login. Login now takes the API from `APIFY_CLIENT_BASE_URL` or the connected runtime first, then the port the runtime was last started on, and only falls back to 3333 when no port is known (hand-started runtime on the defaults, local platform development). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015JzfLYa5CHCXxfzC1No3gV
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.
What
apify loginwith a local Console URL always validated the token againsthttp://localhost:3333, so a runtime started on another port (apify runtime start --api-port 4333, orACTOR_RUNTIME_API_PORTfrom feat: Make the API and console ports configurable actor-runtime#80) was unreachable from login.APIFY_CLIENT_BASE_URLor the connected runtime, then the port the runtime was last started on, then 3333 when no port is known (hand-started runtime on the defaults, local platform development).resolveLoginApiBaseUrl()with unit tests for each of those cases.Verified
apify/actor-runtime:lateststarted with--api-port 4333 --console-port 4000: login succeeds while connected, and with onlyAPIFY_CONSOLE_URL=http://localhost:4000set, with nothing listening on 3333.test:local(the only failures are the pre-existing root-user "cannot write" cases).