Skip to content

Commit

Permalink
Merge pull request #90 from RADAR-base/release-0.5.16
Browse files Browse the repository at this point in the history
Release 0.5.16
  • Loading branch information
blootsvoets authored Feb 20, 2023
2 parents 35c56cb + 65249a5 commit 8af51f3
Show file tree
Hide file tree
Showing 27 changed files with 250 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ indent_size = 2
indent_size = 4

[*.{kt,kts}]
disabled_rules = no-wildcard-imports
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_allow_trailing_comma = true
ktlint_standard_no-wildcard-imports = disabled
6 changes: 4 additions & 2 deletions .github/workflows/scheduled_snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1027.0
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
Expand All @@ -31,13 +31,15 @@ jobs:
run: >
snyk test
--configuration-matching='^runtimeClasspath$'
--fail-on=upgradable
--json-file-output=${{ env.REPORT_FILE }}
--org=radar-base
--policy-path=$PWD/.snyk
- name: Report new vulnerabilities
uses: thehyve/report-vulnerability@master
if: success() || failure()
with:
report-file: ${{ env.REPORT_FILE }}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ failure() }}
6 changes: 3 additions & 3 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ on:
pull_request:
branches:
- main

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
with:
snyk-version: v1.1027.0
snyk-version: v1.1032.0

- uses: actions/setup-java@v3
with:
Expand All @@ -26,6 +27,5 @@ jobs:
run: >
snyk test
--configuration-matching='^runtimeClasspath$'
--fail-on=upgradable
--org=radar-base
--severity-threshold=high
--policy-path=$PWD/.snyk
9 changes: 7 additions & 2 deletions .snyk
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.22.1
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744:
- '*':
reason: Not using Kotlin Files interface
expires: 2022-12-13T08:35:54.696Z
expires: 2023-12-13T08:35:54.696Z
created: 2022-03-14T08:35:54.706Z
SNYK-JAVA-ORGYAML-3152153:
- '*':
reason: Only using YAML for the configuration loading
expires: 2023-12-22T09:56:56.796Z
created: 2023-02-20T09:56:56.804Z
patch: {}
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM gradle:7.5-jdk17 as builder
FROM --platform=$BUILDPLATFORM gradle:8.0-jdk17 as builder

RUN mkdir /code
WORKDIR /code
ENV GRADLE_USER_HOME=/code/.gradlecache \
GRADLE_OPTS=-Djdk.lang.Process.launchMechanism=vfork
GRADLE_OPTS="-Djdk.lang.Process.launchMechanism=vfork -Dorg.gradle.vfs.watch=false"

COPY build.gradle.kts settings.gradle.kts gradle.properties /code/

RUN gradle downloadDependencies copyDependencies startScripts --no-watch-fs
RUN gradle downloadDependencies copyDependencies startScripts

COPY src/ /code/src

RUN gradle jar --no-watch-fs
RUN gradle jar

FROM eclipse-temurin:17-jre

Expand All @@ -37,7 +37,7 @@ ENV JAVA_OPTS="" \

COPY --from=builder /code/build/scripts/* /usr/bin/
COPY --from=builder /code/build/third-party/* /usr/lib/
COPY --from=builder /code/build/libs/radar-gateway-*.jar /usr/lib/
COPY --from=builder /code/build/libs/*.jar /usr/lib/

USER 101

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# RADAR-Gateway

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/79b2380112c5451181367ae16e112025)](https://www.codacy.com/app/RADAR-base/RADAR-Gateway?utm_source=github.com&utm_medium=referral&utm_content=RADAR-base/RADAR-Gateway&utm_campaign=Badge_Grade)

REST Gateway to the Apache Kafka, similar to the REST Proxy provided by Confluent. In addition, it does authentication and authorization, content validation and decompression if needed. It is available as a [docker image](https://hub.docker.com/r/radarbase/radar-gateway).

## Configuration
Expand Down
22 changes: 15 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.time.Duration

Expand All @@ -13,7 +15,7 @@ plugins {

description = "RADAR Gateway to handle secured data flow to backend."
group = "org.radarbase"
version = "0.5.15"
version = "0.5.16"

repositories {
mavenCentral()
Expand Down Expand Up @@ -90,11 +92,17 @@ dependencies {
integrationTestImplementation("org.radarbase:radar-commons-testing:$radarCommonsVersion")
}

val jvmTargetVersion = 17

tasks.withType<JavaCompile> {
options.release.set(jvmTargetVersion)
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "17"
apiVersion = "1.7"
languageVersion = "1.7"
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(jvmTargetVersion.toString()))
apiVersion.set(KotlinVersion.KOTLIN_1_8)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
}
}

Expand Down Expand Up @@ -127,7 +135,7 @@ application {
"-Dcom.sun.management.jmxremote.local.only=false",
"-Dcom.sun.management.jmxremote.port=9010",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false"
"-Dcom.sun.management.jmxremote.ssl=false",
)
}

Expand Down Expand Up @@ -188,5 +196,5 @@ tasks.withType<DependencyUpdatesTask> {
}

tasks.wrapper {
gradleVersion = "7.5.1"
gradleVersion = "8.0.1"
}
26 changes: 13 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ org.gradle.jvmargs=-Xmx3072m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF
kotlin.code.style=official
dockerComposeStopContainers=true

kotlinVersion=1.7.20
ktlintVersion=0.45.2
ktlintPluginVersion=11.0.0
dockerComposeVersion=0.16.9
dependencyUpdatesVersion=0.43.0
kotlinVersion=1.8.10
ktlintVersion=0.48.2
ktlintPluginVersion=11.2.0
dockerComposeVersion=0.16.11
dependencyUpdatesVersion=0.45.0

okhttp3Version=4.10.0
radarJerseyVersion=0.9.1
radarJerseyVersion=0.9.2
radarCommonsVersion=0.15.0
radarSchemasVersion=0.8.1
jacksonVersion=2.14.0
slf4jVersion=2.0.3
radarSchemasVersion=0.8.2
jacksonVersion=2.14.2
slf4jVersion=2.0.6
log4j2Version=2.19.0
lzfseVersion=0.1.1
radarAuthVersion=0.8.1
avroVersion=1.11.1
kafkaVersion=7.3.0-ce
confluentVersion=7.3.0
kafkaVersion=7.3.1-ce
confluentVersion=7.3.1

mockitoKotlinVersion=4.0.0
junitVersion=5.9.1
mockitoKotlinVersion=4.1.0
junitVersion=5.9.2
grizzlyVersion=4.0.0
hamcrestVersion=2.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,24 @@ class KafkaTopicsTest {
url("$MANAGEMENTPORTAL_URL/oauth/token")
addHeader("Authorization", Credentials.basic(MP_CLIENT, ""))
post(
FormBody.Builder()
.add("username", ADMIN_USER)
.add("password", ADMIN_PASSWORD)
.add("grant_type", "password")
.build()
FormBody.Builder().run {
add("username", ADMIN_USER)
add("password", ADMIN_PASSWORD)
add("grant_type", "password")
build()
},
)
}

val tokenUrl = httpClient.call(Status.OK, "tokenUrl") {
addHeader("Authorization", BEARER + clientToken)
url(
MANAGEMENTPORTAL_URL.toHttpUrl()
.newBuilder("api/oauth-clients/pair")!!
.addEncodedQueryParameter("clientId", REST_CLIENT)
.addEncodedQueryParameter("login", USER)
.addEncodedQueryParameter("persistent", "false")
.build()
MANAGEMENTPORTAL_URL.toHttpUrl().newBuilder("api/oauth-clients/pair")!!.run {
addEncodedQueryParameter("clientId", REST_CLIENT)
addEncodedQueryParameter("login", USER)
addEncodedQueryParameter("persistent", "false")
build()
},
)
}

Expand All @@ -67,10 +68,11 @@ class KafkaTopicsTest {
url("$MANAGEMENTPORTAL_URL/oauth/token")
addHeader("Authorization", Credentials.basic(REST_CLIENT, ""))
post(
FormBody.Builder()
.add("grant_type", "refresh_token")
.add("refresh_token", refreshToken)
.build()
FormBody.Builder().run {
add("grant_type", "refresh_token")
add("refresh_token", refreshToken)
build()
},
)
}
}
Expand All @@ -86,7 +88,7 @@ class KafkaTopicsTest {
ObservationKey.getClassSchema(),
PhoneAcceleration.getClassSchema(),
ObservationKey::class.java,
PhoneAcceleration::class.java
PhoneAcceleration::class.java,
)

val time = System.currentTimeMillis() / 1000.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fun main(args: Array<String>) {
ConfigLoader.loadConfig<GatewayConfig>(
listOf(
"gateway.yml",
"/etc/radar-gateway/gateway.yml"
"/etc/radar-gateway/gateway.yml",
),
args,
).withDefaults()
Expand Down
Loading

0 comments on commit 8af51f3

Please sign in to comment.