[CC-3981] Fix Paypage requests broken by internal keyClassMap leaking into serialized payload - #236
Open
Ryouzanpaku wants to merge 3 commits into
Open
[CC-3981] Fix Paypage requests broken by internal keyClassMap leaking into serialized payload#236Ryouzanpaku wants to merge 3 commits into
Ryouzanpaku wants to merge 3 commits into
Conversation
…eaking into serialized payload exposeProperties() filtered properties by visibility only, so a protected static lookup table was picked up by reflection and sent to the API. Exclude static properties in the base class and tighten keyClassMap's visibility to private since it is only used internally. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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
Paypage(V2) requests were failing because the internal$keyClassMapstatic lookup table was being serialized into the outgoing API request body.AbstractUnzerResource::exposeProperties()to select properties viaReflectionClass::getProperties(ReflectionProperty::IS_PROTECTED), which filters purely on visibility and does not exclude static properties.Paypage::$keyClassMap(protected static) was picked up and exposed alongside real instance properties.exposeProperties()now skips anyisStatic()property, so no static property (on any resource, present or future) can leak into a request again. Additionally tightenedPaypage::$keyClassMaptoprivateas defense-in-depth, since it is only used internally within the class.protected staticproperty, soPaypagewas the only resource affected.Jira: CC-3981
Dependencies
None.