docs: correct cookie forwarding behavior for app plugins - #2889
Open
gluefactory wants to merge 1 commit into
Open
gluefactory wants to merge 1 commit into
gluefactory wants to merge 1 commit into
Conversation
Grafana stopped forwarding cookies to app plugin backends in #88663, but the app plugin authentication guide still told readers their app could read forwarded cookies and showed a snippet looping over req.Cookies(). The allow-list is only populated from data source settings, so an app always receives an empty Cookie header. Replace the section with the actual behavior and point readers at the supported alternatives for identifying the calling user and for calling the Grafana API. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
gluefactory
marked this pull request as ready for review
September 17, 2026 17:36
gluefactory
requested review from
ashharrison90 and
eledobleefe
and removed request for
a team
September 17, 2026 17:36
This branch has not been deployed
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.
What this PR does / why we need it:
The "Work with cookies" section of the app plugin authentication guide states that an app plugin can read cookies forwarded by Grafana, and shows a snippet looping over
req.Cookies(). That hasn't been true since grafana/grafana#88663 removed cookie forwarding for app plugins.In
cookies_middleware.go, the allowed-cookie list is only populated insideif pCtx.DataSourceInstanceSettings != nil, so for an app it stays empty andClearCookieHeaderstrips theCookieheader fromQueryData,CallResource, andCheckHealthrequests. Following the current docs gives you an empty slice with no error or warning.This replaces the section with the actual behavior, plus pointers to the supported alternatives for identifying the calling user and for calling the Grafana API.
Which issue(s) this PR fixes:
Fixes #2874
Notes:
The issue's suggested text links to
app-with-service-accountandapp-with-rbacin grafana-plugin-examples; both 404 (that repo currently hasapp-basicandapp-with-backend), so I've linked the in-repo guidesuse-a-service-account.mdandimplement-rbac-in-app-plugins.mdinstead.Verified
backend.PluginConfigFromContextand thebackend.Userfields (Login,Name,Email,Role) against grafana-plugin-sdk-gomain, andX-Grafana-Idagainst this repo's RBAC guide.npm run docs:buildpasses, which withonBrokenLinks/onBrokenAnchorsset tothrowconfirms every link in the new text resolves.🤖 Generated with Claude Code