[fix][star-rating] stop the by-id widget lookups returning internal fields (24.05) - #7922
Open
ar2rsawseen wants to merge 1 commit into
Open
Conversation
…ields /o/feedback/multiple-widgets-by-id and /o/feedback/widget look a widget up by _id and return the stored document as it is. The app-scoped /feedback/widgets, serving the same rendering purpose, projects to the fields a widget needs and then deletes cohortID with the comment "no need to return more data than needed". The two by-id lookups did neither, so an anonymous caller holding a widget id also received targeting, the audience segmentation query, and cohortID. Both now exclude those two fields. Excluded rather than allow-listed on purpose. These endpoints render every widget type, so an allow-list drawn from the rating-only projection would drop what surveys and nps need, and the caller is an sdk already deployed in the field. Naming the two internal fields cannot break rendering. Left alone deliberately: the endpoints stay anonymous. They exist to be called by the web sdk with no session and no app_id to scope by, so requiring authentication or an app_key would stop widgets rendering. The nfd counter ping is also unchanged, for the same reason as the earlier decision about timesShown. Related: the write routes of this plugin were bound to their app in #7622. This is the read half of the same shape. Co-Authored-By: Claude Opus 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.
[fix][star-rating] stop the by-id widget lookups returning internal fields
/o/feedback/multiple-widgets-by-id and /o/feedback/widget look a widget up by _id
and return the stored document as it is. The app-scoped /feedback/widgets, serving
the same rendering purpose, projects to the fields a widget needs and then deletes
cohortID with the comment "no need to return more data than needed". The two by-id
lookups did neither, so an anonymous caller holding a widget id also received
targeting, the audience segmentation query, and cohortID.
Both now exclude those two fields.
Excluded rather than allow-listed on purpose. These endpoints render every widget
type, so an allow-list drawn from the rating-only projection would drop what surveys
and nps need, and the caller is an sdk already deployed in the field. Naming the two
internal fields cannot break rendering.
Left alone deliberately: the endpoints stay anonymous. They exist to be called by
the web sdk with no session and no app_id to scope by, so requiring authentication
or an app_key would stop widgets rendering. The nfd counter ping is also unchanged,
for the same reason as the earlier decision about timesShown.
Related: the write routes of this plugin were bound to their app in #7622. This is