Skip to content

Implement Upload and Download for fileserver example#186

Open
emcfarlane wants to merge 2 commits into
mainfrom
ed/fileserver-upload-download
Open

Implement Upload and Download for fileserver example#186
emcfarlane wants to merge 2 commits into
mainfrom
ed/fileserver-upload-download

Conversation

@emcfarlane

Copy link
Copy Markdown
Collaborator

Implements the Upload (client-streaming) and Download (server-streaming) RPCs defined in content.proto for the example.

Closes #175. Thanks to @scbizu for the original contribution and motivation. This takes the same idea and simplifies the implementation using os.Root (Go 1.24+).

Uses os.Root to confine all file access to the served directory,
preventing path traversal. Implements the Upload (client-streaming)
and Download (server-streaming) RPCs defined in content.proto.

Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@emcfarlane emcfarlane requested a review from jhump March 5, 2026 21:51
Signed-off-by: Edward McFarlane <emcfarlane@buf.build>
@scbizu

scbizu commented Mar 6, 2026

Copy link
Copy Markdown

Thank you @emcfarlane for sharing me the os.Root 's consideration and implementation, learned a lot about the fs safety 👍.

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