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 Kedro-viz embedded as an IFrame #1658

Merged
merged 6 commits into from
Dec 5, 2023
Merged

Conversation

rashidakanchwala
Copy link
Contributor

@rashidakanchwala rashidakanchwala commented Nov 28, 2023

Description

In response to issue #1348, which required the addition of security headers to demo.kedro.org, we implemented a solution in PR #1355. This solution involved adding security headers to the FastAPI application which results in all instances of kedro-viz, whether hosted or local, having these security headers. Having the security headers introduced a limitation where kedro-viz could not be used as an IFrame, affecting functionalities like %run_viz that embed kedro-viz in an iframe.

To address this, the current ticket introduces a conditional approach. We will add security headers only if the environment variable ADD_SECURITY_HEADER is set to true. This modification will be implemented in the Dockerfile when creating the docker image for the demo project. This image will then be uploaded to an EC2 instance and deployed using Lightsail.

QA notes

I've conducted local tests and confirmed that security headers are no longer being added. Additionally, I tested this by creating a Docker image of the demo-project. In this scenario, the security headers are present and functioning as expected.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

Signed-off-by: Rashida Kanchwala <rashida.kanchwala@quantumblack.com>
Signed-off-by: Rashida Kanchwala <rashida.kanchwala@quantumblack.com>
Signed-off-by: Rashida Kanchwala <rashida.kanchwala@quantumblack.com>
@rashidakanchwala rashidakanchwala added the Python Pull requests that update Python code label Nov 28, 2023
rashidakanchwala and others added 2 commits November 29, 2023 11:12
Signed-off-by: Rashida Kanchwala <rashida.kanchwala@quantumblack.com>
@rashidakanchwala rashidakanchwala marked this pull request as ready for review November 30, 2023 15:29
@rashidakanchwala rashidakanchwala requested review from ravi-kumar-pilla and jitu5 and removed request for tynandebold November 30, 2023 15:29
Copy link
Contributor

@ravi-kumar-pilla ravi-kumar-pilla left a comment

Choose a reason for hiding this comment

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

Awesome !! Looks good to me and works well with local and jupyter notebook %run_viz line magic.

Copy link
Contributor

@jitu5 jitu5 left a comment

Choose a reason for hiding this comment

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

LGTM!

@rashidakanchwala rashidakanchwala merged commit c0536f2 into main Dec 5, 2023
17 checks passed
@rashidakanchwala rashidakanchwala deleted the fix/viz-as-iframe branch December 5, 2023 09:50
This was referenced Dec 18, 2023
rashidakanchwala added a commit that referenced this pull request Dec 19, 2023
Release 7.0.0

Major features and improvements

Upgrade to React 18. (Migrate to React 18 #1652)
Change CLI command to run Kedro-viz tokedro viz run. (Change 'Kedro Viz' to 'Kedro Viz Run' #1671)
Add deploy command to the CLI using kedro viz deploy for sharing Kedro-viz on AWS. (AWS focussed CLI implementation for Shareable Viz  #1661)
Add support for kedro==0.19and kedro-datasets==2.0. (Fix bug on kedro viz --load-file #1677)
Drop support for python=3.7. (Remove support for Python 3.7 #1660)
Drop support for kedro==0.17.x. (Drop Kedro 17  #1669)
Bug fixes and other changes
Fix modular pipelines breaking when collapsed on the flowchart. (Fix modular pipelines breaking when collapsed.  #1651)
Display hosted URL in CLI while launching Kedro viz. (Display hosted URL in CLI while launching kedro viz #1644)
Fix Kedro-viz display on Jupyter notebooks. (Fix Kedro-viz embedded as an IFrame #1658)
Fix zoom issues on the flowchart. (Flowchart doesn't automatically reset the zoom when actions are performed. #1672)
Fix bug on kedro-viz run --load-file. (Fix bug on kedro viz --load-file #1677)
Fix bug on adding timestamps to shareable-viz. (_#1679)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants