Skip to content

Preserve host-provided Durable management URL query parameters - #632

Open
Naiyuan Tian (nytian) wants to merge 3 commits into
devfrom
nytian/management-url
Open

Naiyuan Tian (nytian) wants to merge 3 commits into
devfrom
nytian/management-url

Conversation

@nytian

Copy link
Copy Markdown
Contributor

Summary

  • Preserve host-provided management URLs, including keyed and key-free URLs.
  • Restrict instance-ID substitution to the first occurrence so query values remain unchanged.
  • Document host-controlled key exclusion and add compatibility regression tests.

Key exclusion is controlled only by the extension's httpSettings.excludeManagementKeyFromUrls option, which defaults to false. No Python-specific flag is introduced. Existing response shapes and authentication behavior are preserved; callers using key-free HTTP URLs must supply an independently obtained key through x-functions-key.

Validation

  • 308 core tests passed; SDK lint passed.
  • 24 packaged integration configurations passed across Azure Storage, MSSQL, Netherite, and DTS.
  • Optional OpenAI-agent tests remain blocked by dependency-feed authentication.

Related: Azure/azure-functions-durable-extension#3600

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Replacing only the first URL-wide occurrence can alter the authority or an unrelated path prefix while leaving the instance-ID placeholder unresolved, so substitution must target only the instance-ID path segment.

1 open issue
What changed in this PR

Updates the Durable Functions Python client’s management-link handling to preserve host-provided query parameters, including management keys, while retaining host control over key exclusion.

Changes:

  • Replaces origin-wide string substitution with scheme-and-authority updates.
  • Limits instance-ID substitution to the first match.
  • Documents key-free URL authentication and adds compatibility tests for URL preservation, payload independence, and local RPC behavior.
File Description
tests/​models/​test_http_management_compatibility.py Adds regression coverage for keyed and key-free URLs, response payloads, and RPC calls.
azure/​durable_functions/​models/​DurableOrchestrationClient.py Updates origin rewriting and placeholder substitution; documents key-free authentication.
azure/​durable_functions/​models/​DurableOrchestrationBindings.py Documents host ownership of URL query parameters and management-key inclusion.

Review effort: Balanced

Comment on lines 239 to +240
payload[key] = payload[key].replace(
self._orchestration_bindings.management_urls["id"], instance_id)
self._orchestration_bindings.management_urls["id"], instance_id, 1)
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