Skip to content

Python: preserve path case in OpenAPI allowed URLs - #14693

Open
Eduard van Valkenburg (eavanvalkenburg) wants to merge 1 commit into
microsoft:mainfrom
eavanvalkenburg:sk-path-case-incident
Open

Eduard van Valkenburg (eavanvalkenburg) wants to merge 1 commit into
microsoft:mainfrom
eavanvalkenburg:sk-path-case-incident

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation and Context

OpenAPI allowed base URLs can include a path prefix. URL paths are case-sensitive, so path-prefix matching must preserve case while the existing scheme, host, port, and slash-boundary behavior remains unchanged.

No linked issue.

Description

  • Compare allowed URL paths without lowercasing them.
  • Keep case-insensitive scheme and host matching and effective-port comparison.
  • Add validator coverage for matching paths, descendants, case variants, and prefix controls.
  • Add GET and POST runner coverage that verifies authentication and request dispatch only occur for matching path case.

Validation:

  • cd python && uv run --python 3.12 pytest -q tests/unit/connectors/openapi_plugin/test_server_url_validator.py tests/unit/connectors/openapi_plugin/test_openapi_runner.py tests/unit/connectors/openapi_plugin/test_sk_openapi.py - passed.
  • cd python && uv run --python 3.12 pre-commit run -a - passed.
  • cd python && uv run --python 3.12 pytest tests/unit - not completed; collection stopped because the local environment does not include optional connector dependencies.

Contribution Checklist

Copilot AI balanced review requested due to automatic review settings October 30, 2026 15:02
@semantic-kernel-automation semantic-kernel-automation Bot added the python Pull requests for the Python Semantic Kernel label Oct 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change to case-sensitive allowed-base-URL path matching.

No open issues 🎉

What changed in this PR

This PR makes Python OpenAPI allowed-base-URL path matching case-sensitive while preserving existing scheme, host, effective-port, and slash-boundary behavior.

Changes:

  • Remove lowercasing from exact-path and path-prefix comparisons.
  • Add validator coverage for matching paths, descendants, case mismatches, and prefix boundaries.
  • Add GET and POST coverage confirming rejected paths block both authentication and request dispatch.
File Description
python/​tests/​unit/​connectors/​openapi_plugin/​test_server_url_validator.py Tests case-sensitive path matching and prefix boundaries.
python/​tests/​unit/​connectors/​openapi_plugin/​test_openapi_runner.py Tests authentication and dispatch behavior for matching and mismatched path case.
python/​semantic_kernel/​connectors/​openapi_plugin/​server_url_validator.py Preserves path case during allowed-URL comparisons.

Review effort: Balanced

This branch was successfully deployed

1 active deployment
github-app-auth — c4c20b62 Deployed Oct 30, 2026 by eavanvalkenburg via add_label #29510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants