Skip to content

Conversation

@c-bata
Copy link
Member

@c-bata c-bata commented Sep 12, 2025

Contributor License Agreement

This repository (optuna-dashboard) and Goptuna share common code.
This pull request may therefore be ported to Goptuna.
Make sure that you understand the consequences concerning licenses and check the box below if you accept the term before creating this pull request.

  • I agree this patch may be ported to Goptuna by other Goptuna contributors.

Reference Issues/PRs

None

What does this implement/fix? Explain your changes.

@c-bata c-bata changed the title Enable rehypeRaw plugin only when specifying --allow-unsafe Introduce --allow-unsafe option and set CSP header Sep 17, 2025
@c-bata c-bata marked this pull request as ready for review September 17, 2025 02:39
Copy link
Member

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

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

The overall direction looks good to me 👍 I just left two comments.

</Box>
</Box>
{renderIframe()}
{llmEnabled && renderIframe()}
Copy link
Member

Choose a reason for hiding this comment

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

I think it’s a good call not to invoke renderIframe() when the LLM isn’t enabled. It might also be a good idea to take this opportunity to fix the part that calls renderIframe() of useTrialFilterQuery.

else:
# CSP header
if llm_provider is not None:
script_src_str = "script-src 'self' 'unsafe-inline' 'unsafe-eval'"
Copy link
Member

Choose a reason for hiding this comment

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

Do you think there's a way to avoid specifying discouraged unsafe-inline or unsafe-eval? But I also realize fixing this could be a lot of work, so not spending that effort right now would also be a reasonable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you for your review!

I tried removing 'unsafe-inline', but it caused the CSS to break completely, likely due to the way MUI handles styling. The 'unsafe-eval' directive was intentionally included because the LLM integration relies on evaluating JavaScript functions.

@c-bata c-bata force-pushed the allow-unsafe-option branch from 266da87 to 5909c17 Compare October 17, 2025 08:40
@c-bata
Copy link
Member Author

c-bata commented Oct 17, 2025

@porink0424 Thank you for your review. I applied your suggestion in ae575d5. Please take a look again.

Copy link
Member

@porink0424 porink0424 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@c-bata c-bata merged commit aeabbfa into optuna:main Oct 20, 2025
19 checks passed
@c-bata c-bata deleted the allow-unsafe-option branch October 20, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants