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

Add generated caller filename hash as clientside callback namespace. #3161

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Feb 12, 2025

Fix for https://github.com/plotly/dash-embedded/issues/87

Generate hash from the clientside_callback caller filename to use as namespace, this will make it unique instead of modifying the namespace in dash-embedded.

# Generate the hash from the caller filename.
caller = get_caller_name()
module = importlib.import_module(caller)
namespace = hashlib.sha256(module.__file__.encode("utf-8")).hexdigest()
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

@gvwilson gvwilson added feature something new P1 needed for current cycle labels Feb 13, 2025
@T4rk1n
Copy link
Contributor Author

T4rk1n commented Feb 13, 2025

Repeating from dash-embedded thread, the inline scripts are added to the scripts tag on the index but that is not recommended for security purpose and doesn't allow caching. We need to bring the functionality on embedded that created a new route for the inline scripts and added it to the scripts to load.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants