Repository navigation
Preserve host-provided management URL query strings - #313
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change moving management authentication from URL query strings to required headers.
No open issues 🎉
What changed in this PR
This PR moves Durable Functions management authentication from URL query strings to requiredHeaders, reducing system-key exposure in HTTP access logs. Polling clients must now send the returned headers; existing constructor signatures and gRPC operations remain unchanged.
Changes:
- Generate key-free management URLs and convert legacy
codeparameters intox-functions-keyheader metadata. - Use key-free
Locationheaders and addCache-Control: no-storeto check-status responses. - Add regression coverage and update E2E callers to send authentication headers.
| File | Description |
|---|---|
endtoendtests/src/test/java/com/functions/EndToEndTests.java |
Sends required headers to validated management endpoints and checks key-free URLs. |
azurefunctions/src/test/java/com/microsoft/durabletask/azurefunctions/HttpManagementPayloadTest.java |
Tests legacy-key conversion, header precedence, immutability, and empty queries. |
azurefunctions/src/test/java/com/microsoft/durabletask/azurefunctions/DurableClientContextTest.java |
Tests binding credentials, context isolation, key-free locations, and no-store responses. |
azurefunctions/src/main/java/com/microsoft/durabletask/azurefunctions/HttpManagementPayload.java |
Separates authentication headers from management URLs while preserving the existing constructor. |
azurefunctions/src/main/java/com/microsoft/durabletask/azurefunctions/DurableClientContext.java |
Passes binding headers into payloads and updates check-status response headers. |
Review effort: Balanced
andystaples
left a comment
There was a problem hiding this comment.
The core change looks correct and backward compatible. HttpManagementPayload now handles a null, empty, or ?-prefixed binding query without producing a trailing ?, &, or ?null. URLs are unchanged when a query is present, and Location now reuses the payload's status URI. A few items should be addressed before merge (non-blocking):
- PR description is out of date. It still describes returning the key through
requiredHeaders/x-functions-key, addingCache-Control: no-storeresponses, and a breaking change for polling clients. The final diff does none of these, and the tests now assert thatrequiredHeadersandCache-Controlare absent. The SDK now passes through whateverrequiredQueryStringParametersthe host provides, and key exclusion is controlled by the host'shttpSettings.excludeManagementKeyFromUrlsopt-in (default off). That makes this non-breaking for existing apps. The validation notes (45 module tests, E2E 31/36 with entity timeouts) also look like they describe the earlier revision. - CHANGELOG entry is missing. The checklist box is checked, but
## Unreleasedonly contains the blob-payload entries. - Docs don't cover the opt-in. The README sample still shows
?code=in every management URL. That's accurate for the default, but there's no mention that enablingexcludeManagementKeyFromUrlsremovescodeand that callers must then supply the system key via thex-functions-keyheader. The "do not require documentation changes" box is also unchecked with no linked doc issue.
andystaples
left a comment
There was a problem hiding this comment.
Thanks for the updates. The code, tests, CHANGELOG, and README changes look good, and CI is green. Approving with two non-blocking nits:
- PR description: The description still reflects an earlier version of the change. It mentions
requiredHeaders/x-functions-keybeing returned by the SDK,Cache-Control: no-store, a breaking change for polling clients, and the earlier validation counts. Please update it to describe the current behavior: query parameters from the host pass through unchanged, key exclusion is an opt-in host setting, and the default behavior is unchanged. The documentation checkbox can also be checked now that the README covers the opt-in. - Opt-in CI tracking: See the inline note on the README.
| The repository's CI currently tests the default mode. An authenticated opt-in CI | ||
| leg is tracked as a follow-up in the E2E workflow until the released host extension |
There was a problem hiding this comment.
Nit: this says the authenticated opt-in CI leg is tracked as a follow-up, but I couldn't find an issue or workflow TODO for it. Could you open an issue and link it here (or in the PR description)? Alternatively, drop the tracking reference from the user-facing README and keep it in the issue.
Issue describing the changes in this PR
Preserve host-provided Durable Functions management URL query parameters and handle null, empty, or
?-prefixed binding queries without extra URL separators. Keep the existingLocationheader consistent with the payload's status URL.Key exclusion is controlled only by the host's
httpSettings.excludeManagementKeyFromUrlsopt-in, which defaults tofalse. No Java-specific flag is introduced. Existing applications retain their URL authentication behavior. This SDK does not extract keys, returnrequiredHeaders, or introduce new cache headers. HTTP callers using key-free URLs must supply an independently obtained key throughx-functions-key.Update compatibility tests, the changelog, and module documentation. Scope E2E credential/origin/redirect handling to authenticated management requests.
Pull request checklist
CHANGELOG.mdAdditional information
.\gradlew.bat :azurefunctions:check :endtoendtests:testClasses -PprotoBranch=3145f9337fca9de57d2f89a6ff6f07150d34f1c2 --offline --no-daemon --console=plain- passed: 47 Functions module unit tests, static checks, and E2E compilation.