diff --git a/.github/workflows/publish-to-maven.yml b/.github/workflows/publish-to-maven.yml index e3f06c1..1eded8b 100644 --- a/.github/workflows/publish-to-maven.yml +++ b/.github/workflows/publish-to-maven.yml @@ -1,4 +1,4 @@ -# This workflow will publish AMaaS Java SDK to Maven Central with OSSRH +# This workflow will publish AMaaS Java SDK to Maven Central via Central Publisher Portal name: Java with Maven @@ -16,8 +16,8 @@ jobs: uses: actions/setup-java@v3 with: java-version: '8' - distribution: 'adopt' - server-id: ossrh + distribution: 'temurin' + server-id: central server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} @@ -38,6 +38,6 @@ jobs: run: | mvn -B clean ${{env.PACK_CMD}} env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index cefd105..5cfeb31 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -17,7 +17,7 @@ jobs: uses: actions/setup-java@v3 with: java-version: '8' - distribution: 'adopt' + distribution: 'temurin' - name: Run unit tests run: | diff --git a/Dockerfile b/Dockerfile index 48fabcd..4f9b3f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build stage -FROM openjdk:8-jdk-bullseye@sha256:c25fa22ba2961758802ea63bc4622999a305086405d9d03b065925da00cb8bb6 as build_env +FROM eclipse-temurin:8-jdk@sha256:3b1808f3745f1bbbb3611a4f774a0a8940af9de318f1d725e49e2ea8fbc176e6 as build_env ARG BUILD_VERSION ARG PACK_CMD=package @@ -9,7 +9,7 @@ RUN useradd -m su-amaas # Dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ - maven=3.6.3-5 \ + maven \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/VERSION b/VERSION index dc1e644..9c6d629 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 +1.6.1 diff --git a/pom.xml b/pom.xml index 69bfa78..0571a5c 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,12 @@ - + 4.0.0 com.trend file-security-java-sdk - 1.6.0 + 1.6.1 file-security-java-sdk https://github.com/trendmicro/tm-v1-fs-java-sdk @@ -33,8 +34,8 @@ - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + central + https://central.sonatype.com/api/v1/publisher/deployments/ @@ -86,13 +87,16 @@ grpc-netty 1.73.0 - io.netty* + + io.netty + * + io.netty netty-all - 4.1.121.Final + 4.2.6.Final io.grpc @@ -111,7 +115,7 @@ - + @@ -252,14 +256,14 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central + true + true diff --git a/src/main/java/com/trend/cloudone/amaas/AMaasClient.java b/src/main/java/com/trend/cloudone/amaas/AMaasClient.java index 87fc8e2..5e763b4 100644 --- a/src/main/java/com/trend/cloudone/amaas/AMaasClient.java +++ b/src/main/java/com/trend/cloudone/amaas/AMaasClient.java @@ -190,6 +190,24 @@ private ManagedChannel buildChannelWithProxy(final String target, final ProxyCon builder.usePlaintext(); } + final int keepAliveTimeSecs = 60; + final int keepAliveTimeoutSecs = 5; + final int connectTimeoutMs = 30000; + + builder + .keepAliveTime(keepAliveTimeSecs, TimeUnit.SECONDS) + .keepAliveTimeout(keepAliveTimeoutSecs, TimeUnit.SECONDS) + .keepAliveWithoutCalls(true) // Keep connection alive even when idle + .withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeoutMs); + + log( + Level.FINE, + "Configured keep-alive: time={0}s, timeout={1}s, connectTimeout={2}ms", + keepAliveTimeSecs, + keepAliveTimeoutSecs, + connectTimeoutMs + ); + // Configure proxy if needed String proxyUrl = proxyConfig.getProxyUrl(target); if (proxyUrl != null) { @@ -255,16 +273,6 @@ public NioSocketChannel newChannel() { setProxyAuthenticator(proxyConfig); } } - - // Set connection timeout for proxy connections - final int keepAliveTimeSecs = 30; - final int keepAliveTimeoutSecs = 10; - final int connectTimeoutMs = 30000; // 30 seconds - - builder.keepAliveTime(keepAliveTimeSecs, TimeUnit.SECONDS); - builder.keepAliveTimeout(keepAliveTimeoutSecs, TimeUnit.SECONDS); - builder.keepAliveWithoutCalls(true); - builder.withOption(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeoutMs); } /**