Skip to content

Docker Proxy Read-Only Mode Enhancement #14

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

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

Conversation

thomasleveil
Copy link
Contributor

@thomasleveil thomasleveil commented Apr 15, 2025

Overview

This PR enhances the Docker proxy feature by implementing proper read-only mode restrictions while maintaining full functionality. It ensures that in read-only mode, only GET requests are allowed, preventing any modifications to the Docker environment.

Changes

  • Always enable Docker proxy feature regardless of read-only mode setting
  • Add validation to ensure only GET requests are allowed when in read-only mode
  • Improve request validation order by checking HTTP method before environment ID

Implementation Details

  • Modified internal/mcp/docker.go to:
    • Remove conditional feature registration based on read-only mode
    • Add HTTP method validation before environment ID check
    • Implement read-only mode restriction for non-GET requests

Related Issues

@deviantony
Copy link
Member

A few things about this PR:

  • All things related to Dockerfile should not be in this PR, I'm happy to discuss the use case/need for a Docker container on a separate issue
  • Even though the change to filter requests is applied to the handler, there is no test coverage for this. The PR description has some notes about testing but nothing is implemented here.

@thomasleveil
Copy link
Contributor Author

Thank you for the review and sorry for the docker commit. It was not meant to be part of the PR. I will clean this up

- Always enable Docker proxy feature regardless of read-only mode

- Add validation to ensure only GET requests are allowed in read-only mode

- Improve validation order by checking HTTP method before environment ID
@thomasleveil thomasleveil force-pushed the feat/docker-proxy-read-only branch from 423919f to e9f5692 Compare April 15, 2025 22:10
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.

dockerProxy -read-only mode
2 participants