W-24224590: Select request authentication by path - #4175
Merged
wmathurin merged 2 commits intoSep 22, 2026
Merged
Conversation
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
||||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4175 +/- ##
==========================================
- Coverage 71.82% 67.82% -4.00%
==========================================
Files 254 254
Lines 23027 23045 +18
==========================================
- Hits 16539 15631 -908
- Misses 6488 7414 +926
🚀 New features to boost your workflow:
|
|
||||||||||||||||
sfdctaka
approved these changes
Sep 17, 2026
sfdctaka
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the full diff plus surrounding source (DPoPRequestDecorator, SFRestAPI, SFRestRequest, credential model). This is tightly scoped and well-tested — approving.
Verified it holds up:
- Gate is consistent end to end.
isDPoPTokenType && uiSid nonempty && policy(path), and the credential model only ever populatesuiSidfor DPoP tokens and clears it on downgrade, so the invariant lines up. - Nonce-retry gate has no false negatives. Genuine DPoP requests still carry both
Authorization: DPoP …and the proof header, so the anchored/case-insensitive check keeps the retry;Bearer <ui_sid>attempts correctly skip it.finalRequestis the stamped request, so it's the right object to inspect. - Other call sites stay DPoP. Identity and revoke/refresh remain on the 4-arg overload — only the REST client path opts into the policy. Good.
- Additive, backward-compatible public API with doc comments;
setValue(nil, …)header removal is asserted by the LWR test.
Two non-blocking notes:
- Expired
ui_sid→ 401 replay. ABearer <ui_sid>/lwrrequest that 401s runs normal token refresh; replay works only if the refresh updatesuiSid(it does), and degrades gracefully to DPoP if a refresh returns noui_sid. Worth a quick sanity-check against a live LWR org. - Subtle (practically inert) semantic change.
SFRestRequestmoved from the 4-arg overload (strict token-type) to the credentials overload (shouldAttachDPoP, with the nil-token-type key-material fallback). Can't flip behavior in practice sincetokenTypeis always persisted for logged-in users and no REST calls happen in the/authorize→/tokenwindow — just flagging that the gate changed.
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
SalesforceSDKManagersynchronously chooseui_sidBearer authentication by request path when a DPoP access token is present.ui_sidBearer, and all other requests keep DPoP.Test plan