[v3-3-test] Mask list-shaped Variable values on deserialization (#70891) - #71069
Merged
Conversation
* Mask list-shaped Variable values on deserialization _mask_and_deserialize_variable dispatched on the top-level type of the deserialized value and handled only str and dict, so a Variable whose JSON is a list was returned with no masking applied to anything inside it. add_mask walks iterables itself, so the same list nested one level inside a dict was already masked -- only a top-level one was skipped. The list is passed under the variable's key rather than anonymously: elements have no key names of their own, so they follow the variable key's sensitivity, and a list of ordinary values such as region names is not added to the global pattern set. Dicts inside the list are still masked by their own key names. * Tighten the comments around Variable masking dispatch The rationale was spread across three sites saying the same thing; keep it at the branch where the decision is made. (cherry picked from commit b968192) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
7 tasks
vatsrahul1001
marked this pull request as ready for review
August 4, 2026 12:55
vatsrahul1001
pushed a commit
that referenced
this pull request
Aug 5, 2026
…) (#71069) * Mask list-shaped Variable values on deserialization _mask_and_deserialize_variable dispatched on the top-level type of the deserialized value and handled only str and dict, so a Variable whose JSON is a list was returned with no masking applied to anything inside it. add_mask walks iterables itself, so the same list nested one level inside a dict was already masked -- only a top-level one was skipped. The list is passed under the variable's key rather than anonymously: elements have no key names of their own, so they follow the variable key's sensitivity, and a list of ordinary values such as region names is not added to the global pattern set. Dicts inside the list are still masked by their own key names. * Tighten the comments around Variable masking dispatch The rationale was spread across three sites saying the same thing; keep it at the branch where the decision is made. (cherry picked from commit b968192) Co-authored-by: Jarek Potiuk <jarek@potiuk.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.
_mask_and_deserialize_variable dispatched on the top-level type of the
deserialized value and handled only str and dict, so a Variable whose JSON is a
list was returned with no masking applied to anything inside it. add_mask walks
iterables itself, so the same list nested one level inside a dict was already
masked -- only a top-level one was skipped.
The list is passed under the variable's key rather than anonymously: elements
have no key names of their own, so they follow the variable key's sensitivity,
and a list of ordinary values such as region names is not added to the global
pattern set. Dicts inside the list are still masked by their own key names.
The rationale was spread across three sites saying the same thing; keep it at
the branch where the decision is made.
(cherry picked from commit b968192)
Co-authored-by: Jarek Potiuk jarek@potiuk.com