Fix path auth: substitute API key placeholder into RPC URL before use#2638
Draft
Fix path auth: substitute API key placeholder into RPC URL before use#2638
Conversation
Add resolve_url() to AuthConfig which replaces the placeholder with
the resolved token for Path auth (and returns the URL unchanged for
all other auth kinds). Use this in all three build_http_client call
sites (Bitcoin, Abstract, Starknet) in sign.rs so that the {api_key}
placeholder is actually substituted before the HTTP request is made.
Add unit tests for the new resolve_url() method.
Agent-Logs-Url: https://github.com/near/mpc/sessions/0ac35124-89b3-4fe5-9288-a5c1685a6666
Co-authored-by: netrome <22524681+netrome@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix path auth API key substitution in RPC URL
Fix path auth: substitute API key placeholder into RPC URL before use
Mar 27, 2026
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.
AuthConfig::Pathproviders (e.g. Alchemy for Abstract/Starknet) had{api_key}left as a literal string in the URL — the token was never substituted, causing all HTTP requests to fail.Changes
auth.rs— AddedAuthConfig::resolve_url(): forPathauth, replaces the placeholder with the resolved token; returns the URL unchanged for all other variants.sign.rs— All threebuild_http_clientcall sites (Bitcoin, Abstract, Starknet) now callauth.resolve_url(&rpc_url)?instead of cloning the raw URL directly.resolve_urlfor allAuthConfigvariants.The existing
strip_placeholder(used for logging) is unchanged;resolve_urlis the companion method for actual request dispatch.⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.