Upgrade saloonphp/saloon from v2 to v4#45
Closed
tance77 wants to merge 5 commits into
Closed
Conversation
Rename HasBody trait to HasStringBody and replace removed Saloon\Contracts\Response with Saloon\Http\Response.
- Add allowBaseUrlOverride to requests using full URLs in resolveEndpoint (SSRF protection now requires opt-in) - Replace removed AccessTokenAuthenticator::unserialize() with direct AccessTokenAuthenticator parameter - Remove stale @phpstan-ignore-line comments
Replace removed serialize/unserialize with JSON encoding of access_token, refresh_token, and expires_at properties.
There was a problem hiding this comment.
Pull request overview
Upgrades this Salesforce PHP client to Saloon v4, updating OAuth token handling to avoid insecure serialization and aligning request behavior with Saloon v4’s SSRF/base URL override protections.
Changes:
- Upgrade
saloonphp/saloondependency from^2to^4and adjust code for breaking changes. - Replace removed
AccessTokenAuthenticator::serialize/unserializewith JSON-based token persistence and manual authenticator construction. - Opt-in to full-URL endpoints by enabling
allowBaseUrlOverrideon affected requests / OAuth config.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
composer.json |
Bumps Saloon requirement to ^4.0 (but PHP requirement not yet aligned). |
composer.lock |
Locks Saloon to v4.0.0 and updates dependency graph accordingly. |
src/SalesforceApi.php |
Updates OAuth restore/refresh APIs to accept AccessTokenAuthenticator objects; removes old unserialize flow. |
src/Connectors/SalesforceOAuthLoginConnector.php |
Updates Response import and enables base URL override on OAuth config. |
src/Requests/OAuth2/UserInfo.php |
Enables base URL override for full-URL endpoint resolution. |
src/Requests/OAuth/GetAccessTokenWithPKCERequest.php |
Enables base URL override for token endpoint resolution. |
src/Requests/Auth/LoginApiUser.php |
Enables base URL override for full-URL token endpoint. |
src/Requests/BulkApi/UploadJobData.php |
Switches to HasStringBody for CSV upload payloads. |
tests/Pest.php |
Updates test helper to restore/store OAuth credentials via JSON. |
.tinkerwell/SalesforcePhpTinkerwellDriver.php |
Updates local Tinkerwell bootstrap to restore/store OAuth credentials via JSON. |
index.php |
Updates OAuth demo script to persist credentials as JSON. |
.gitignore |
Adds scratch project path and normalizes ignore entries. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Member
Author
|
Oh someone else already did this and on the same day lol. Closing switching to other one. |
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
saloonphp/saloonfrom^2.0to^4.0, applying all breaking changes from the v2→v3 and v3→v4 migration guidesAccessTokenAuthenticator::serialize()/unserialize()(CVE security fix) with JSON-based credential storageallowBaseUrlOverrideto requests using full URLs inresolveEndpoint()(SSRF protection now opt-in in v4)Breaking Changes
restoreExistingOAuthConnection()now acceptsAccessTokenAuthenticatorinstead of a serialized stringSaloon v4 removed
AccessTokenAuthenticator::serialize()and::unserialize()to fix an insecure deserialization CVE. You must now store the token properties individually and construct the authenticator yourself.Before (v2):
After (v4):
restoreExistingOAuthConnectionWithCodeVerification()— same changeBefore (v2):
After (v4):
refreshToken()— same changeBefore (v2):
After (v4):
Test plan
🤖 Generated with Claude Code