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 config to handle cors #658

Open
amarjeetanandsingh opened this issue May 3, 2024 · 0 comments
Open

Add config to handle cors #658

amarjeetanandsingh opened this issue May 3, 2024 · 0 comments
Labels
package New package

Comments

@amarjeetanandsingh
Copy link

amarjeetanandsingh commented May 3, 2024

Hi
I agree with the point mentioned in this comment that we should not allow the POST /package API from the browser by default as it modifies the system.

However, I am not very convinced with the approach we are taking to disable this feature from a browser.

Impact of no cors-

  • Difficult POC: We'll need NGINX or similar proxy servers to manipulate headers. This initially demands resources/time/effort which drops the motivation of the adoption of Piston.

Proposed Solution:

  • We can control the cors from the piston config, disabled by default(current behavior). However, we can discuss enabling it in docker-compose.dev.yml
  • In case we really want to be careful with the POST /packages API-
    • We can enable this feature(POST /packages endpoint) based on a config.
    • Or we decouple the system-impacting feature from user-facing endpoint list. we can provide a small script kind of tool to install a package manually inside /piston/packages dir.

In case we can conclude on this, I'll be happy to contribute to the implementation :-)

@amarjeetanandsingh amarjeetanandsingh added the package New package label May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package New package
Projects
None yet
Development

No branches or pull requests

1 participant