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

Allow project manager to write files #9483

Merged
merged 6 commits into from
Mar 21, 2024

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Mar 19, 2024

Pull Request Description

close #9360

Changelog:

  • add: --filesystem-write-path {path} command allowing to write bytes from stdin to the provided path

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed, the GUI was tested when built using ./run ide build.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 19, 2024
@4e6 4e6 self-assigned this Mar 19, 2024
Copy link
Contributor

@hubertp hubertp left a comment

Choose a reason for hiding this comment

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

Slightly worried about security concerns of this one. But this question probably relates to other endpoints as well

#### Parameters

```typescript
echo 'Hello World!' | project-manager --filesystem-write-path {path}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe against path traversal attacks? Can path be relative or absolute or both? I don't think we check if the user can call ../../.. etc in the path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The OS is responsible for checking the permissions when the process tries to access the filesystem. In this case, we allow writing to any file that has appropriate permissions.
We don't expose this endpoint to the running project-manager process through JSON-RPC protocol. This and other filesystem-related methods can only be called through the command line.

@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Mar 21, 2024
@mergify mergify bot merged commit aff7fb8 into develop Mar 21, 2024
41 checks passed
@mergify mergify bot deleted the wip/db/9360-allow-project-manager-to-write-files branch March 21, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow project manager to write files
2 participants