Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/auto-label-area.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Auto-label area

on:
issues:
types: [opened]

permissions:
issues: write

jobs:
add-area-label:
runs-on: ubuntu-latest
steps:
- name: Add area label
uses: actions/github-script@v7
with:
script: |
const AREA_LABEL = "area:java-functions";
const labels = context.payload.issue.labels.map(l => l.name);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.issue.number,
labels: [AREA_LABEL],
});
}
5 changes: 0 additions & 5 deletions .swarm/run/original-prompt.md

This file was deleted.

8 changes: 0 additions & 8 deletions .swarm/run/rounds/round-1/manifest.json

This file was deleted.

15 changes: 0 additions & 15 deletions .swarm/run/rounds/round-1/planning/design-document.md

This file was deleted.

34 changes: 0 additions & 34 deletions .swarm/run/rounds/round-1/planning/plan.json

This file was deleted.

10 changes: 0 additions & 10 deletions .swarm/tasks/add-grpc-transport-tests/task.md

This file was deleted.

21 changes: 0 additions & 21 deletions .swarm/tasks/expose-functions-uri/result.json

This file was deleted.

10 changes: 0 additions & 10 deletions .swarm/tasks/expose-functions-uri/task.md

This file was deleted.

20 changes: 0 additions & 20 deletions .swarm/tasks/select-grpc-transport-from-uri/result.json

This file was deleted.

10 changes: 0 additions & 10 deletions .swarm/tasks/select-grpc-transport-from-uri/task.md

This file was deleted.

24 changes: 12 additions & 12 deletions eng/ci/templates/java-versions.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
variables:
# Linux JDK Versions
JDK8_LINUX_VERSION: '482'
JDK8_LINUX_BUILD: '08'
JDK11_LINUX_VERSION: '11.0.30'
JDK17_LINUX_VERSION: '17.0.18'
JDK21_LINUX_VERSION: '21.0.10'
JDK25_LINUX_VERSION: '25.0.2'
JDK8_LINUX_VERSION: '492'
JDK8_LINUX_BUILD: '09'
JDK11_LINUX_VERSION: '11.0.31'
JDK17_LINUX_VERSION: '17.0.19'
JDK21_LINUX_VERSION: '21.0.11'
JDK25_LINUX_VERSION: '25.0.3'

# Windows JDK Versions
JDK8_WINDOWS_VERSION: '482'
JDK8_WINDOWS_BUILD: '08'
JDK11_WINDOWS_VERSION: '11.0.30'
JDK17_WINDOWS_VERSION: '17.0.18'
JDK21_WINDOWS_VERSION: '21.0.10'
JDK25_WINDOWS_VERSION: '25.0.2'
JDK8_WINDOWS_VERSION: '492'
JDK8_WINDOWS_BUILD: '09'
JDK11_WINDOWS_VERSION: '11.0.31'
JDK17_WINDOWS_VERSION: '17.0.19'
JDK21_WINDOWS_VERSION: '21.0.11'
JDK25_WINDOWS_VERSION: '25.0.3'
12 changes: 12 additions & 0 deletions es-metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
schemaVersion: 1.0.0
providers:
- provider: InventoryAsCode
version: 1.0.0
metadata:
isProduction: true
accountableOwners:
service: e8fdf03b-44f7-48d3-8653-a744c922a342
routing:
defaultAreaPath:
org: azfunc
path: internal\Azure Functions
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<jupiter.version>5.9.1</jupiter.version>
<mockito-core.version>4.11.0</mockito-core.version>
<appinsights.agents.version>3.7.6</appinsights.agents.version>
<grpc.version>1.75.0</grpc.version>
<grpc.version>1.81.0</grpc.version>
</properties>
<licenses>
<license>
Expand Down Expand Up @@ -75,7 +75,7 @@
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.25.5</version>
<version>3.25.8</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
Expand Down Expand Up @@ -147,7 +147,7 @@
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.1</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.25.5:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:3.25.8:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
<protoSourceRoot>${basedir}/src/main/azure-functions-language-worker-protobuf/src/proto</protoSourceRoot>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.microsoft.azure.functions.worker;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.Locale;
import java.util.logging.*;
import javax.annotation.*;

Expand Down Expand Up @@ -162,10 +162,6 @@ public String getFunctionsUri() {
return this.uri;
}

public String getUri() {
return this.getFunctionsUri();
}

@Override
public boolean logToConsole() {
return this.logToConsole;
Expand All @@ -190,17 +186,44 @@ private boolean isCommandlineValid() {

private String parseUri(String uri) throws ParseException {
try {
URL url = new URL(uri);
url.toURI();
this.host = url.getHost();
this.port = url.getPort();
URI parsedUri = new URI(uri);
String host = parsedUri.getHost();
String scheme = parsedUri.getScheme();
int port = parsedUri.getPort();

if (scheme == null || scheme.isEmpty()) {
throw new IllegalArgumentException("URI scheme is missing");
}

switch (scheme.toLowerCase(Locale.ROOT)) {
case "http":
if (port == -1) {
port = 80;
}
break;
case "https":
if (port == -1) {
port = 443;
}
break;
default:
throw new IllegalArgumentException("Unsupported URI scheme");
}

if (host == null || host.isEmpty()) {
throw new IllegalArgumentException("URI host is missing");
}

if (port < 1 || port > 65535) {
throw new IndexOutOfBoundsException("port number out of range");
}

this.host = host;
this.port = port;
return uri;
} catch (MalformedURLException | URISyntaxException | IndexOutOfBoundsException e) {
} catch (URISyntaxException | IllegalArgumentException | IndexOutOfBoundsException e) {
throw new ParseException(String.format(
"Error parsing URI \"%s\". Please provide a valid URI", uri));
"Error parsing URI \"%s\". Please provide a valid http or https URI", uri));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.microsoft.azure.functions.worker;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.function.*;
import java.util.logging.*;
import javax.annotation.*;
import javax.annotation.PostConstruct;

import io.grpc.*;
import io.grpc.stub.*;
Expand Down Expand Up @@ -146,35 +144,11 @@ private synchronized void send(String requestId, MessageHandler<?, ?> marshaller
private final Map<StreamingMessage.ContentCase, Supplier<MessageHandler<?, ?>>> handlerSuppliers;
private final ClassLoaderProvider classPathProvider;

static boolean useTransportSecurity(@Nullable String functionsUri) {
if (functionsUri == null) {
return false;
}

String scheme = parseFunctionsUriScheme(functionsUri);
switch (scheme.toLowerCase(Locale.ROOT)) {
case "http":
return false;
case "https":
return true;
default:
throw new IllegalArgumentException(String.format(
"Unsupported functions URI scheme \"%s\" in functions URI \"%s\". Only http and https are supported.",
scheme, functionsUri));
}
}

private static String parseFunctionsUriScheme(String functionsUri) {
try {
String scheme = new URI(functionsUri).getScheme();
if (scheme == null || scheme.isEmpty()) {
throw new IllegalArgumentException(String.format(
"Unsupported functions URI \"%s\". Only http and https are supported.", functionsUri));
}
return scheme;
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(String.format(
"Error parsing functions URI \"%s\". Please provide a valid http or https URI.", functionsUri), ex);
}
/**
* @param functionsUri Host endpoint URI, or null for legacy startup args that only provide host and port.
*/
static boolean useTransportSecurity(String functionsUri) {
return functionsUri != null
&& functionsUri.regionMatches(true, 0, "https://", 0, "https://".length());
}
}
Loading