#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