Skip to content

[BREAKING] FEAT: Require a name when the API registers a target (part 16) - #4068

Open
varunj-msft wants to merge 260 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Require-Target-Name
Open

varunj-msft wants to merge 260 commits into
microsoft:mainfrom
varunj-msft:varunj-msft/13178-Require-Target-Name

Conversation

@varunj-msft

@varunj-msft varunj-msft commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

Part 16 of saving Registry entries across restarts. A side branch stacked on part 9 (#4027); nothing builds on it. This PR's own changes: varunj-msft/PyRIT@varunj-msft/13178-Save-From-Registry...varunj-msft/13178-Require-Target-Name

Design: 4.8 Names. Where every part fits: PR map.

This is one of the changes for saving Registry entries across restarts. Until the earlier PRs merge, the diff here also shows their changes.

POST /api/targets with register left on (the default) and no name registered the target under a generated compat_<hex> name. That fallback was marked LEGACY until targets required a name. Scorers already require one to register, and saved targets need one, so targets now match.

  • A request that registers a target must include name, or it gets a 422 ("name is required when register=true"). A request with "register": false still needs none.
  • The compat_<hex> fallback and its LEGACY notes are removed.
  • The tests and the e2e specs that created targets without a name now send one. The backend README says so.

What stays the same: a request with "register": false still needs no name, and the GUI isn't affected because it always sends one.

Breaking change: an API caller that relied on the generated name now gets a 422. To migrate, add "name": "<registry name>" to the request. The GUI always sends a name, so it isn't affected.

# Conflicts:
#	pyrit/prompt_target/azure_blob_storage_target.py
# Conflicts:
#	frontend/e2e/explicit-targets.seeded.spec.ts
#	frontend/src/components/Config/CreateTargetDialog.test.tsx
#	frontend/src/components/Config/CreateTargetDialog.tsx
The runtime status keeps its short summary. The restore log now also lists each field's full location
and message, escaped, without the stored values, and with URL credentials removed. Credentials are
removed before a location is shortened, so the summary can't keep part of one either.
# Conflicts:
#	pyrit/registry/registry_recipe_storage.py

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants