Honor secure Functions host URIs in Java worker#1
Conversation
Agent-Logs-Url: https://github.com/larohra/azure-functions-java-worker/sessions/db76de91-28a8-4391-b3a2-d8796d6725e4 Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
Agent-Logs-Url: https://github.com/larohra/azure-functions-java-worker/sessions/db76de91-28a8-4391-b3a2-d8796d6725e4 Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
Agent-Logs-Url: https://github.com/larohra/azure-functions-java-worker/sessions/db76de91-28a8-4391-b3a2-d8796d6725e4 Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
| } | ||
|
|
||
| @Test | ||
| public void legacyPlaintextTransportStillWorks() throws Exception { |
There was a problem hiding this comment.
Implemented in f7e6bc4. I updated GrpcTransportTest to scope azure.functions.worker.java.skip.testing with an AutoCloseable (SkipTestingScope) so each test restores the original property value and avoids cross-test leakage. No UI changes were made in this PR, so there is no UI screenshot to provide.
There was a problem hiding this comment.
@copilot this is the feedback - These tests set the global system property azure.functions.worker.java.skip.testing but never restore/clear it. Since surefire runs tests in the same JVM by default, this can leak into other tests and make the suite order-dependent. Consider capturing the original value and restoring it in a finally block (or via a small AutoCloseable/JUnit extension similar to TrustStoreScope).
Can you address it please
Agent-Logs-Url: https://github.com/larohra/azure-functions-java-worker/sessions/bc5fc454-8077-4ad5-b568-3befc6ceb14c Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Auto-detected new Java versions from Microsoft OpenJDK releases. This PR was automatically generated by the Java version check pipeline. Pipeline Run: 20260504.1 Co-authored-by: Azure Functions Java Worker Bot <azfunc-java-worker-bot@microsoft.com>
* Add es-metadata.yml to schema 1.0.0 * Update area path to internal\Azure Functions
|
@copilot can you address these comments - Azure#872 (comment) and Azure#872 (comment) |
I can’t access those two Azure PR discussion links from this environment right now. Please paste the exact comment text (or screenshots) for Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Agent-Logs-Url: https://github.com/larohra/azure-functions-java-worker/sessions/f12a179d-bf43-486b-b716-cf4f837012ff Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
Summary
JavaWorkerClientalways buildsManagedChannelBuilder.forAddress(...).usePlaintext(), so the Java worker ignores the already-parsed--functions-uriand can never join a secure host/worker gRPC channel.Findings
functions-uri, plus fallback to legacy args, butJavaWorkerClientwas not updated; this looks like an old assumption that became a gap once URI-based startup existed.functions-uriuseshttps, the worker should build a TLS gRPC channel and fail if handshake, certificate, or hostname validation fails. OnlyhttpURIs, or legacy startup that supplies just host+port, should continue to use plaintext.httpand legacy host+port launches keep their current behavior. The only observable behavior change is that a previously ignored or misconfiguredhttpsendpoint will stop connecting insecurely and instead fail closed.mvn testcurrently passes (63 tests, 0 failures/errors/skips). Repo CI also runs build plus emulated, docker, and end-to-end matrices, but there is no direct secure gRPC transport coverage.Plan
functions-urithroughIApplicationin a compatibility-safe way.JavaWorkerClientchoose transport from the URI scheme:https=> TLS with no plaintext downgrade,httpor legacy host+port => plaintext.mvn test.