feat: Admin Decomposition Phase D — pre-processing steps for domain routes (#88)#129
Merged
feat: Admin Decomposition Phase D — pre-processing steps for domain routes (#88)#129
Conversation
… domain routes (#88) Add three new pipeline step types for request pre-processing: - step.validate_path_param: validates path parameters exist and match format (UUID) - step.validate_pagination: validates/normalises page/limit query params with defaults - step.validate_request_body: parses JSON body and validates required fields Update admin/config.yaml with pre-processing steps on key domain routes: - GET /executions: pagination validation before delegate - GET /executions/{id}: UUID format validation after path param extraction - GET /executions/{id}/steps: ID validation + pagination validation - POST /dlq/{id}/retry: path parse, UUID validation, rate limiting before delegate - POST /dlq/{id}/discard: path parse, UUID validation, rate limiting before delegate - POST /engine/reload: rate limiting (5 req/min) + audit logging before delegate - POST /engine/validate: request body validation (requires config field) before delegate Register all three new step types in the pipelinesteps plugin alongside existing generic step types. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements Phase D+ of the admin config decomposition by adding three new pre-processing pipeline step types (step.validate_path_param, step.validate_pagination, step.validate_request_body) and applying them to 7 domain routes in the admin API configuration.
Changes:
- Three new pipeline step types registered in the
pipelinestepsplugin for input validation before delegation - Pre-processing steps added to engine management routes (body validation, rate limiting, audit logging)
- Pre-processing steps added to execution query routes (UUID validation, pagination validation)
- Pre-processing steps added to DLQ command routes (UUID validation, rate limiting)
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
plugins/pipelinesteps/plugin.go |
Registered three new step types and updated plugin description/manifest |
plugins/pipelinesteps/plugin_test.go |
Updated test expectations to reflect 16 total step factories |
module/pipeline_step_validate_path_param.go |
Implemented path parameter validation with UUID format checking |
module/pipeline_step_validate_path_param_test.go |
Comprehensive tests for path parameter validation |
module/pipeline_step_validate_pagination.go |
Implemented pagination query parameter validation with defaults |
module/pipeline_step_validate_pagination_test.go |
Comprehensive tests for pagination validation |
module/pipeline_step_validate_request_body.go |
Implemented JSON body parsing and required field validation |
module/pipeline_step_validate_request_body_test.go |
Comprehensive tests for request body validation |
admin/config.yaml |
Added pre-processing steps to 7 admin routes (engine validate/reload, executions list/get/steps, DLQ retry/discard) |
plugins/api/plugin.go |
Formatting change (multi-line constructor for newWorkflowRegistry) |
module/query_handler_test.go |
Removed trailing blank line |
module/command_handler_test.go |
Removed trailing blank line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase D+ of the admin config decomposition (issue #88): adds pre-processing pipeline steps before delegation for key domain routes.
New Pipeline Step Types
Three new config-driven pipeline step types registered in the
pipelinestepsplugin:step.validate_path_paramstep.validate_paginationpage/limitquery params with configurable defaults and maxstep.validate_request_bodyUpdated Admin Routes
Pre-processing steps added before delegation on 7 routes:
Execution routes (admin-queries):
GET /executions— pagination validation (max 100, default 20)GET /executions/{id}— UUID format validation on path paramGET /executions/{id}/steps— UUID validation + pagination validationDLQ routes (admin-commands):
POST /dlq/{id}/retry— path param parse → UUID validation → rate limit (30/min)POST /dlq/{id}/discard— path param parse → UUID validation → rate limit (30/min)Engine routes (admin-commands):
POST /engine/reload— rate limit (5/min, burst 2) → audit log before delegatePOST /engine/validate— request body validation (requiresconfigfield)Testing
go test ./...)golangci-lint runreports 0 issuesCloses #88