Skip to content

[fix][star-rating] stop the by-id widget lookups returning internal fields (24.05) - #7922

Open
ar2rsawseen wants to merge 1 commit into
release.24.05from
backport/feedback-widget-by-id-internal-fields-2405
Open

[fix][star-rating] stop the by-id widget lookups returning internal fields (24.05)#7922
ar2rsawseen wants to merge 1 commit into
release.24.05from
backport/feedback-widget-by-id-internal-fields-2405

Conversation

@ar2rsawseen

Copy link
Copy Markdown
Member

[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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant