Repository navigation
[BREAKING] FEAT: Require a name when the API registers a target (part 16) - #4068
Open
varunj-msft wants to merge 341 commits into
Open
varunj-msft wants to merge 341 commits into
varunj-msft wants to merge 341 commits into
Conversation
The dialog asks for a registry name and suggests one, saves the target by default, and creates a Temporary target only when it can't be saved, saying why before it is created. The Targets table labels each target Saved, From configuration or Temporary.
# Conflicts: # pyrit/registry/registry_recipe_restore.py
# Conflicts: # tests/unit/registry/test_instance_registry.py
The dialog keeps the type's own reasons from the type list and gets the rest from POST /api/targets/saveability, which runs create's checks and the library's save checks without building or saving anything, so the warning and the save share one policy. The Entra ID endpoint message shows on the Endpoint URL field after it loses focus.
Saved-entry storage failures now pass their traceback through redact_urls, and code scanning flags the scheme pattern as slow on a long run of letters. A scheme is short, so bounding it keeps the match linear.
… a saveability answer once its request goes away The private-target test now controls the debounce clock, so a slow run can't check the values chosen before Only me.
…s, and auth mode only
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
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/targetswithregisterleft on (the default) and nonameregistered the target under a generatedcompat_<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.name, or it gets a 422 ("name is required when register=true"). A request with"register": falsestill needs none.compat_<hex>fallback and its LEGACY notes are removed.What stays the same: a request with
"register": falsestill needs no name, and the GUI isn't affected because it always sends one. A private copy (source) is never registered, so it needs no name either: one sent withregisterleft on still gets "source requires register=false", which says what to change.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.