fix(tests): apply user edits when creating test from template
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled
The form captured name/description/platform/procedure/tool edits but never sent them — the created test always used the raw template values. - TestTemplateInstantiate schema: add optional override fields (name, description, platform, procedure_text, tool_used) - create_test_from_template service: accept *_override kwargs; use override value when provided, fall back to template value - Router: pass all override fields from payload to service - Frontend API createTestFromTemplate: accept overrides object, spread into body - TestFromTemplateForm: pass all form state values as overrides Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,17 @@ class TestTemplateSummary(BaseModel):
|
||||
|
||||
|
||||
class TestTemplateInstantiate(BaseModel):
|
||||
"""Payload to create a real test from an existing template."""
|
||||
"""Payload to create a real test from an existing template.
|
||||
|
||||
Optional override fields take precedence over the template values when provided.
|
||||
"""
|
||||
|
||||
template_id: uuid.UUID
|
||||
technique_id: str # accepts both UUID and MITRE ID (e.g. "T1059.001")
|
||||
|
||||
# User-editable overrides (if omitted the template value is used)
|
||||
name: str | None = None
|
||||
description: str | None = None
|
||||
platform: str | None = None
|
||||
procedure_text: str | None = None
|
||||
tool_used: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user