-
Notifications
You must be signed in to change notification settings - Fork 46
Consolidate strict mode validation into strict_mode_validation.go #3492
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,13 +5,13 @@ | |||||||||||||
| // This file contains general-purpose validation functions that apply across the entire | ||||||||||||||
| // workflow system. For domain-specific validation (e.g., strict mode, package validation, | ||||||||||||||
| // expression safety), see the corresponding domain files: | ||||||||||||||
| // - strict_mode.go: Security and strict mode validation | ||||||||||||||
| // - pip.go: Python package validation | ||||||||||||||
| // - npm.go: NPM package validation | ||||||||||||||
| // - strict_mode_validation.go: Security and strict mode validation | ||||||||||||||
| // - pip_validation.go: Python package validation | ||||||||||||||
| // - npm_validation.go: NPM package validation | ||||||||||||||
| // - docker_validation.go: Docker image validation | ||||||||||||||
|
Comment on lines
+9
to
+11
|
||||||||||||||
| // - pip_validation.go: Python package validation | |
| // - npm_validation.go: NPM package validation | |
| // - docker_validation.go: Docker image validation | |
| // - pip.go: Python package validation | |
| // - npm.go: NPM package validation | |
| // - docker.go: Docker image validation |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -42,26 +42,22 @@ This architecture balances maintainability with domain expertise, allowing valid | |||||
|
|
||||||
| Domain-specific validation is organized into separate files based on functional area: | ||||||
|
|
||||||
| #### 1. **Strict Mode Validation**: `strict_mode.go` and `validation_strict_mode.go` | ||||||
| #### 1. **Strict Mode Validation**: `strict_mode_validation.go` | ||||||
|
|
||||||
| **Location**: | ||||||
| - `pkg/workflow/strict_mode.go` (70 lines) - Main orchestrator | ||||||
| - `pkg/workflow/validation_strict_mode.go` (170 lines) - Individual validation functions | ||||||
| **Location**: `pkg/workflow/strict_mode_validation.go` (190 lines) | ||||||
|
|
||||||
| **Purpose**: Enforces security and safety constraints in strict mode | ||||||
|
|
||||||
| **Validation Functions**: | ||||||
| - `validateStrictMode()` - Main strict mode orchestrator (in `strict_mode.go`) | ||||||
| - `validateStrictPermissions()` - Refuses write permissions (in `validation_strict_mode.go`) | ||||||
| - `validateStrictNetwork()` - Requires explicit network configuration (in `validation_strict_mode.go`) | ||||||
| - `validateStrictMCPNetwork()` - Requires network config on custom MCP servers (in `validation_strict_mode.go`) | ||||||
| - `validateStrictBashTools()` - Refuses bash wildcard tools (in `validation_strict_mode.go`) | ||||||
| - `validateStrictMode()` - Main strict mode orchestrator | ||||||
| - `validateStrictPermissions()` - Refuses write permissions | ||||||
| - `validateStrictNetwork()` - Requires explicit network configuration | ||||||
| - `validateStrictMCPNetwork()` - Requires network config on custom MCP servers | ||||||
| - `validateStrictBashTools()` - Refuses bash wildcard tools | ||||||
|
|
||||||
| **Pattern**: Security policy enforcement with progressive validation | ||||||
|
|
||||||
| **Architecture**: The strict mode validation is split across two files for better organization: | ||||||
| - `strict_mode.go` contains the main orchestrator that coordinates validation | ||||||
| - `validation_strict_mode.go` contains the individual validation function implementations | ||||||
| **Architecture**: All strict mode validation logic is consolidated in a single file following the `*_validation.go` naming pattern used throughout the codebase | ||||||
|
||||||
| **Architecture**: All strict mode validation logic is consolidated in a single file following the `*_validation.go` naming pattern used throughout the codebase | |
| **Architecture**: All strict mode validation logic is consolidated in a single file following the `*_validation.go` naming convention |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The files
pip_validation.go,npm_validation.go, anddocker_validation.godon't exist in the codebase. The actual files containing validation logic arepip_validation.go(exists),npm_validation.go(exists), anddocker_validation.go(exists) for validation functions, but the extraction and some validation is inpip.go,npm.go, anddocker.go. This documentation should reference the actual existing files.