Artifacts: each incoming artifact is matched to the first unused stored artifact of the same kind and source. It keeps that artifact's id, uploaded file (stored_path), ingest record and credentials.
Scan config:PATCH takes a ScanConfigUpdate whose fields are all optional, and only the fields it names change. "Enable opt-in scans" no longer removes the issue tracker.
Tracker and pentest credentials inside a sent block behave as before (#302).
A field cannot be cleared by sending null. No client did that.
New module api/handlers/target_input.rs holds the input types and merge rules. It replaces seal_scan_config_credentials.
Dashboard
Wizard: for a git repository, a password field "Zugangstoken (nur für private Repositories)" and an optional username. The staged list and review show "Token gesetzt".
Target editor:
"Token gesetzt" or "Token wird beim Speichern entfernt";
a new-token field and a remove button per git repository;
a token field when adding one.
Editor fix: it now keeps a PLC project's plc_format. It sent none before, so every edit reset a .projectarchive to PLCopen XML.
Verification
Unit tests (agent):
a token is stored sealed;
editing keeps the token and the upload;
a token can be replaced or cleared;
enabling a scan keeps the tracker and its token.
Integration test against a local MongoDB (tests/credentials.rs): create with a token → editor-style PATCH (no token) → enable a scan. The git token and tracker token are unchanged in storage, and no response contains either. All 4 credential tests pass.
Dashboard unit test: has_token is never sent, and a token is sent only when it changes. 39 lib tests pass.
clippy with the CI flags (agent; dashboard server/web); fmt.
Not yet tried against a real private repository. Planned for the staging dry run with a Gitea PAT.
Closes #303, closes #304. Part of the pilot P0 (#338), item D. **Stacked on #345.**
## #303: a git token for a private repository
- `ArtifactInput` (create, add, `PATCH` artifacts) takes optional `token` and `username`.
- The token is sealed with `SecretBox` as `enc:v1:` and never returned; responses keep `auth.method = "token"`, so the UI can say "token set".
- A value replaces the token, an empty string removes it, and leaving it out keeps it.
- The clone uses the stored username, or `x-access-token`.
## #304: edits keep what the client cannot send
- **Artifacts:** each incoming artifact is matched to the first unused stored artifact of the same kind and source. It keeps that artifact's id, uploaded file (`stored_path`), ingest record and credentials.
- **Scan config:** `PATCH` takes a `ScanConfigUpdate` whose fields are all optional, and only the fields it names change. "Enable opt-in scans" no longer removes the issue tracker.
- Tracker and pentest credentials inside a sent block behave as before (#302).
- A field cannot be cleared by sending `null`. No client did that.
- New module `api/handlers/target_input.rs` holds the input types and merge rules. It replaces `seal_scan_config_credentials`.
## Dashboard
- **Wizard:** for a git repository, a password field "Zugangstoken (nur für private Repositories)" and an optional username. The staged list and review show "Token gesetzt".
- **Target editor:**
- "Token gesetzt" or "Token wird beim Speichern entfernt";
- a new-token field and a remove button per git repository;
- a token field when adding one.
- **Editor fix:** it now keeps a PLC project's `plc_format`. It sent none before, so every edit reset a `.projectarchive` to PLCopen XML.
## Verification
- Unit tests (agent):
- a token is stored sealed;
- editing keeps the token and the upload;
- a token can be replaced or cleared;
- enabling a scan keeps the tracker and its token.
- Integration test against a local MongoDB (`tests/credentials.rs`): create with a token → editor-style `PATCH` (no token) → enable a scan. The git token and tracker token are unchanged in storage, and no response contains either. All 4 credential tests pass.
- Dashboard unit test: `has_token` is never sent, and a token is sent only when it changes. 39 lib tests pass.
- clippy with the CI flags (agent; dashboard `server`/`web`); fmt.
- Not yet tried against a real private repository. Planned for the staging dry run with a Gitea PAT.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
#303: no API path stored credentials on an artifact, so a private
repository could not be cloned. Artifact inputs (create, add, update) now
take an optional `token` and `username`; the token is sealed with
SecretBox, never returned, and can be replaced (a value) or removed (an
empty string). Left out, it is kept.
#304: editing a target rebuilt every artifact from its input and dropped
the git token, the uploaded file and the ingest record; enabling a scan
replaced the whole scan config and dropped the issue tracker. An edited
artifact now keeps what its stored counterpart (same kind and source)
holds, and a scan-config update changes only the fields it names.
Dashboard: a token (and optional username) field for git repositories in
the wizard and the target editor, "token set" where one is stored, and a
remove button. The editor also keeps a PLC project's format; it sent none,
which reset a .projectarchive to PLCopen XML on every edit.
Tests: unit tests for sealing, keeping, replacing and clearing a token,
keeping an upload across an edit, and a scan-config merge; an integration
test (MongoDB) that renames a target and enables a scan and finds both
the git token and the tracker token still stored.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #303, closes #304. Part of the pilot P0 (#338), item D. Stacked on #345.
#303: a git token for a private repository
ArtifactInput(create, add,PATCHartifacts) takes optionaltokenandusername.SecretBoxasenc:v1:and never returned; responses keepauth.method = "token", so the UI can say "token set".x-access-token.#304: edits keep what the client cannot send
stored_path), ingest record and credentials.PATCHtakes aScanConfigUpdatewhose fields are all optional, and only the fields it names change. "Enable opt-in scans" no longer removes the issue tracker.null. No client did that.api/handlers/target_input.rsholds the input types and merge rules. It replacesseal_scan_config_credentials.Dashboard
plc_format. It sent none before, so every edit reset a.projectarchiveto PLCopen XML.Verification
tests/credentials.rs): create with a token → editor-stylePATCH(no token) → enable a scan. The git token and tracker token are unchanged in storage, and no response contains either. All 4 credential tests pass.has_tokenis never sent, and a token is sent only when it changes. 39 lib tests pass.server/web); fmt.🤖 Generated with Claude Code
https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
792a60cd9fto827980e532