Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(embedded): add missing GUEST_TOKEN_HEADER_NAME to bootstrap data #28932

Merged
merged 3 commits into from
Jun 6, 2024

Conversation

hexcafe
Copy link
Contributor

@hexcafe hexcafe commented Jun 4, 2024

SUMMARY

There's a discrepancy between our backend configuration and frontend implementation for GUEST_TOKEN_HEADER_NAME.

We allow customization of GUEST_TOKEN_HEADER_NAME in the backend configuration.
However, this configuration is not being passed to the frontend.

As a result, the ability to customize the header name in the frontend is currently not functional.

function setupGuestClient(guestToken: string) {
setupClient({
guestToken,
guestTokenHeaderName: bootstrapData.config?.GUEST_TOKEN_HEADER_NAME,
unauthorizedHandler: guestUnauthorizedHandler,
});
}

bootstrap_data = {
"common": common_bootstrap_payload(),
"embedded": {
"dashboard_id": embedded.dashboard_id,
},
}

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.66%. Comparing base (76d897e) to head (3414f78).
Report is 272 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #28932       +/-   ##
===========================================
+ Coverage   60.48%   83.66%   +23.17%     
===========================================
  Files        1931      518     -1413     
  Lines       76236    37463    -38773     
  Branches     8568        0     -8568     
===========================================
- Hits        46114    31344    -14770     
+ Misses      28017     6119    -21898     
+ Partials     2105        0     -2105     
Flag Coverage Δ
hive 48.94% <100.00%> (-0.23%) ⬇️
javascript ?
mysql 77.23% <100.00%> (?)
postgres 77.34% <100.00%> (?)
presto 53.54% <100.00%> (-0.27%) ⬇️
python 83.66% <100.00%> (+20.17%) ⬆️
sqlite 76.79% <100.00%> (?)
unit 59.02% <100.00%> (+1.39%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@john-bodley john-bodley added the review:checkpoint Last PR reviewed during the daily review standup label Jun 4, 2024
@john-bodley
Copy link
Member

Thanks for the fix @hexcafe. Per here it seems like the frontend is expecting said header.

Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @hexcafe you'll have to run tox -e pre-commit locally in order to fix the formatting.

@github-actions github-actions bot removed the embedded label Jun 5, 2024
@john-bodley john-bodley removed the review:checkpoint Last PR reviewed during the daily review standup label Jun 5, 2024
@suddjian
Copy link
Member

suddjian commented Jun 6, 2024

Sorry for this oversight, thanks for the fix :)

@suddjian suddjian merged commit 5c9a794 into apache:master Jun 6, 2024
35 checks passed
@hexcafe
Copy link
Contributor Author

hexcafe commented Jun 6, 2024

@john-bodley @suddjian Thank you for merging this PR. Could we backport this patch to version 4.0? It could be beneficial for future users of version 4.0 who need to embed the dashboard.

@michael-s-molina michael-s-molina added the v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch label Jun 13, 2024
michael-s-molina pushed a commit that referenced this pull request Jun 13, 2024
@mistercrunch mistercrunch added 🍒 4.0.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Jul 24, 2024
irublev pushed a commit to HighviewPower/superset that referenced this pull request Oct 29, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS v4.0 Label added by the release manager to track PRs to be included in the 4.0 branch 🍒 4.0.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants