Repository navigation
DOC: Describe the backend input validation and trust boundary - #3342
Open
varunj-msft wants to merge 5 commits into
Open
varunj-msft wants to merge 5 commits into
varunj-msft wants to merge 5 commits into
Conversation
Document what the backend checks before using request values, and the intentional exceptions under the model that API callers are trusted operators.
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
Adds an "Input Validation and Trust Boundary" section to
pyrit/backend/README.md, after "Request Limits". It lists what the backend checks before it uses request values: request limits, component parameters, file values and blob URLs, the configuration routes and target settings that need an administrator, and the HTTP target upload folder. It says who counts as an API caller and an administrator in Entra and local mode, and lists the intentional exceptions under the model that API callers are trusted operators: network destinations, server credentials used by targets created without a key, shared registered components, prompt content, stored file types, unauthenticatedGET /api/media, trusted initializers, and the parameters that may name local folders.It covers behavior added in #3050, #3061, #3172, #3173, #3174, #3212, and #3247, along with older backend behavior that was not written down. Scoping server credentials for caller-chosen endpoints is tracked separately; this PR only documents the current behavior.
Tests and Documentation
Documentation only.
pytest -n 4 --dist=loadfile tests/unit/backend/test_authentication_policy.py tests/unit/backend/test_auth_middleware.py tests/unit/backend/test_auth_route.py tests/unit/backend/test_configuration_routes.py tests/unit/backend/test_converter_service.py tests/unit/backend/test_mappers.py tests/unit/backend/test_media_persistence.py tests/unit/backend/test_media_route.py tests/unit/backend/test_scorer_routes.py tests/unit/backend/test_scorer_service.py tests/unit/backend/test_target_service.py: 696 passed, 4 skipped.No JupyText changes.