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): Ensure guest token is passed to log endpoint #20647

Merged
merged 2 commits into from
Jul 8, 2022

Conversation

jfrag1
Copy link
Member

@jfrag1 jfrag1 commented Jul 7, 2022

SUMMARY

Currently when using embedding a dashboard, calls to the /log/ endpoint return a 401 response. This is because navigator.sendBeacon was not sending the guest token used for authentication in the way that SupersetClient does.

This PR will ensure the guest token is included so that event logging works for embedded dashboards.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

  1. Embed a dashboard
  2. Perform actions that trigger calls to /log/
  3. See that these calls succeed with a 200 response

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

@codecov
Copy link

codecov bot commented Jul 8, 2022

Codecov Report

Merging #20647 (2bc4942) into master (e1a918f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #20647   +/-   ##
=======================================
  Coverage   66.81%   66.81%           
=======================================
  Files        1753     1753           
  Lines       65806    65810    +4     
  Branches     7001     7001           
=======================================
+ Hits        43966    43973    +7     
+ Misses      20056    20053    -3     
  Partials     1784     1784           
Flag Coverage Δ
javascript 51.96% <100.00%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
.../superset-ui-core/src/connection/SupersetClient.ts 100.00% <100.00%> (ø)
...rset-ui-core/src/connection/SupersetClientClass.ts 100.00% <100.00%> (ø)
...perset-frontend/src/middleware/loggerMiddleware.js 78.04% <100.00%> (+8.81%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1a918f...2bc4942. Read the comment docs.

@pull-request-size pull-request-size bot added size/M and removed size/S labels Jul 8, 2022
@jfrag1 jfrag1 force-pushed the jfrag1/fix-embedded-logging branch from 5acf225 to 2bc4942 Compare July 8, 2022 19:23
@lilykuang lilykuang merged commit dfab521 into apache:master Jul 8, 2022
@jfrag1 jfrag1 deleted the jfrag1/fix-embedded-logging branch July 8, 2022 22:30
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 8, 2022
…0647)

* Pass guest token to sendBeacon

* Add tests

(cherry picked from commit dfab521)
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 12, 2022
…0647)

* Pass guest token to sendBeacon

* Add tests

(cherry picked from commit dfab521)
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Jul 12, 2022
…0647)

* Pass guest token to sendBeacon

* Add tests

(cherry picked from commit dfab521)
akshatsri pushed a commit to charan1314/superset that referenced this pull request Jul 19, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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 preset:2022.27 size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants