fix(NET-10): Pass request URLs per call instead of mutating shared BaseUrl - #33
Open
cozminu wants to merge 10 commits into
Open
fix(NET-10): Pass request URLs per call instead of mutating shared BaseUrl#33cozminu wants to merge 10 commits into
cozminu wants to merge 10 commits into
Conversation
Adds the missing <param> tags for the Uri parameters introduced by the thread-safe base URL refactor (resourceServerUrl/incomingPaymentUrl/ outgoingPaymentUrl) in the Incoming/Outgoing Payment partials, clearing the CS1573 warnings from the documentation build. Also hardens the CI BaseUrl guard: scans all of OpenPayments.Sdk/ (not just Clients/) while excluding generated *.g.cs files, tolerates whitespace around the '=' in "BaseUrl =", and fails loudly instead of silently passing if its scan target ever disappears or is renamed.
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
Removes the shared mutable
BaseUrlfromResourceClientBaseandAuthClientBaseso a singleton client can serve concurrent requests to different wallet addresses without cross-talk. Ten hand-written methods onResourceServerClient/AuthServerClientnow take their targetUrias an explicit first parameter and build their URL from that parameter, instead of reading a_baseUrlfield their wrapper mutated immediately before the call. This is the same pattern already used byContinueGrantAsync(Uri continueUrl, ...),RotateTokenAsync(Uri tokenUrl, ...), andWalletAddressClient.GetWalletAddressAsync(string walletAddress, ...).@target-uriis a signed component of the HTTP message signature, the previous code also signed over the malformed URI.ResourceServerClientandAuthServerClientarepublictypes, so their hand-written method signatures changing is source-breaking for anyone calling them directly rather than throughIAuthenticatedClient. The supported surface (IResourceClientBase,IAuthClientBase,IAuthenticatedClient) is unchanged..github/workflows/build.yaml) that fails the build ifBaseUrl =is reintroduced anywhere in hand-written code underOpenPayments.Sdk/(excluding generated*.g.csconstructors).Test plan
dotnet test— 78/78 passing (49 SDK tests, 29 HttpSignatureUtils tests)dotnet build --configuration Release— clean, no new warningsdotnet build OpenPayments.Snippets/OpenPayments.Snippets.csproj— compiles unchanged, confirming the public surface didn't moveRecordingHandlertest double + cross-host/200-iteration parallel tests exercise the concurrency fix directlyBaseUrl =write and to pass cleanly on the current tree