Editing a target's artifacts or scan config must not drop stored credentials #304

Closed
opened 2026-09-21 16:04:54 +00:00 by sharang · 0 comments
Owner

Found while doing #260 (PR #302).

1. PATCH /targets/{id} with artifacts rebuilds every artifact from ArtifactInput. That drops each artifact's auth (and stored_path/content_hash for uploads). The dashboard's target editor always sends artifacts.

2. The dashboard's enable_target_scans PATCHes scan_config with only enabled_scans. That removes the issue tracker (and pentest) config, because scan_config is replaced wholesale.

#302 already keeps a credential that a PATCH leaves out, but only when the enclosing block (issue_tracker, pentest) is sent.

Change:

  • Match incoming artifacts to stored ones (by kind and source) and keep their auth and stored file.
  • Make scan_config updates merge per field instead of replacing the whole config.

Acceptance: renaming a target, or enabling a scan from the dashboard, leaves its git token, tracker config and uploaded files intact. Add a test for each.

Found while doing #260 (PR #302). **1.** `PATCH /targets/{id}` with `artifacts` rebuilds every artifact from `ArtifactInput`. That drops each artifact's `auth` (and `stored_path`/`content_hash` for uploads). The dashboard's target editor always sends `artifacts`. **2.** The dashboard's `enable_target_scans` PATCHes `scan_config` with only `enabled_scans`. That removes the issue tracker (and pentest) config, because `scan_config` is replaced wholesale. #302 already keeps a *credential* that a PATCH leaves out, but only when the enclosing block (`issue_tracker`, `pentest`) is sent. **Change:** - Match incoming artifacts to stored ones (by kind and source) and keep their auth and stored file. - Make `scan_config` updates merge per field instead of replacing the whole config. **Acceptance:** renaming a target, or enabling a scan from the dashboard, leaves its git token, tracker config and uploaded files intact. Add a test for each.
sharang added this to the Production MVP milestone 2026-09-21 16:04:54 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#304