Skip to content

Commit f8739db

Browse files
authored
Merge pull request #508 from RADAR-base/release-2.4.3
release-2.4.3
2 parents 323ac87 + 53f8b12 commit f8739db

File tree

8 files changed

+95
-12
lines changed

8 files changed

+95
-12
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Snyk scheduled test
2+
on:
3+
schedule:
4+
- cron: '0 2 * * 1'
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
security:
11+
runs-on: ubuntu-latest
12+
env:
13+
REPORT_FILE: test.json
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Run Snyk to check for vulnerabilities
18+
uses: snyk/actions/gradle-jdk17@master
19+
env:
20+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
21+
with:
22+
args: --all-projects --configuration-matching='^runtimeClasspath$' --json-file-output=${{ env.REPORT_FILE }} --severity-threshold=high --policy-path=$PWD/.snyk
23+
24+
- name: Report new vulnerabilities
25+
uses: thehyve/report-vulnerability@master
26+
if: success() || failure()
27+
with:
28+
report-file: ${{ env.REPORT_FILE }}
29+
env:
30+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/snyk.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Snyk test
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
security:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
12+
- name: Run Snyk to check for JDK vulnerabilities
13+
uses: snyk/actions/gradle-jdk17@master
14+
env:
15+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
16+
with:
17+
args: --all-projects --configuration-matching="^runtimeClasspath$" --fail-on=upgradable --org=radar-base --policy-path=.snyk --severity-threshold=high

.snyk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
2+
version: v1.25.0
3+
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
4+
ignore:
5+
patch: {}
6+
exclude:
7+
global:
8+
- scripts/requirements.txt

build.gradle

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'pmd'
33
id 'io.gatling.gradle' version '3.9.2.1'
44
id 'com.github.johnrengelman.shadow' version '8.1.0'
5-
id 'org.springframework.boot' version "3.0.4"
5+
id 'org.springframework.boot' version '3.2.10'
66
id 'org.openjfx.javafxplugin' version '0.0.13'
77
id("com.github.ben-manes.versions") version "0.46.0"
88
}
@@ -14,7 +14,7 @@ apply plugin: 'io.spring.dependency-management'
1414
apply plugin: 'scala'
1515

1616
group = 'org.radarbase'
17-
version = '2.4.2'
17+
version = '2.4.3'
1818

1919
java {
2020
toolchain {
@@ -32,14 +32,15 @@ bootJar {
3232
}
3333

3434
ext {
35-
springBootVersion = '2.6.6'
35+
springBootVersion = '3.2.10'
3636
springVersion = '6.0.6'
37-
springOauth2Version = "2.5.1.RELEASE"
37+
springOauth2Version = "2.5.2.RELEASE"
38+
springOauth2AutoconfigureVersion = "2.6.8"
3839
springDocVersion = '2.2.0'
3940
lombokVersion = '1.18.26'
4041
junit5Version = '5.9.2'
4142
radarSpringAuthVersion = '1.2.1'
42-
springSecurityVersion = '6.0.2'
43+
springSecurityVersion = '6.0.5'
4344
hibernateValidatorVersion = '8.0.0.Final'
4445
minioVersion = '8.5.10'
4546
}
@@ -63,7 +64,7 @@ dependencies {
6364
implementation('org.springframework.boot:spring-boot-starter-actuator')
6465
implementation('org.springframework.boot:spring-boot-starter-mail')
6566
implementation group: "org.springframework.security", name: "spring-security-config", version: springSecurityVersion
66-
implementation('org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:' + springBootVersion)
67+
implementation('org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:' + springOauth2AutoconfigureVersion)
6768
implementation('org.springframework.security.oauth:spring-security-oauth2:' + springOauth2Version)
6869
runtimeOnly("org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion")
6970
implementation("io.minio:minio:$minioVersion")
@@ -74,7 +75,7 @@ dependencies {
7475
//runtimeOnly('org.springframework.boot:spring-boot-devtools')
7576
runtimeOnly('org.hsqldb:hsqldb')
7677
runtimeOnly('org.liquibase:liquibase-core:4.20.0')
77-
runtimeOnly(group: 'org.postgresql', name: 'postgresql', version: '42.5.4')
78+
runtimeOnly(group: 'org.postgresql', name: 'postgresql', version: '42.5.5')
7879

7980

8081
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
@@ -83,7 +84,17 @@ dependencies {
8384
annotationProcessor "org.springframework:spring-context-indexer:$springVersion"
8485

8586
// FCM Admin SDK
86-
implementation 'com.google.firebase:firebase-admin:9.1.1'
87+
implementation('com.google.firebase:firebase-admin:9.3.0') {
88+
// Possibly remove these constraints when a newer version of firebase-adkon is available.
89+
constraints {
90+
implementation('com.google.protobuf:protobuf-java:3.25.5') {
91+
because 'Provided version of protobuf has security vulnerabilities'
92+
}
93+
implementation('com.google.protobuf:protobuf-java-util:3.25.5') {
94+
because 'Provided version of protobuf has security vulnerabilities'
95+
}
96+
}
97+
}
8798

8899
// AOP
89100
runtimeOnly group: 'org.springframework', name: 'spring-aop', version: springVersion
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.radarbase.appserver.config;
2+
3+
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
4+
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
5+
import org.springframework.context.annotation.Configuration;
6+
7+
@Configuration
8+
@ConditionalOnProperty(value = "radar.notification.email.enabled", havingValue = "false", matchIfMissing = true)
9+
@EnableAutoConfiguration(exclude = {
10+
org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration.class,
11+
org.springframework.boot.autoconfigure.mail.MailSenderValidatorAutoConfiguration.class
12+
})
13+
public class MailAutoconfigureExcludeConfig { }

src/main/java/org/radarbase/appserver/config/TokenVerifierPublicKeyConfig.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class TokenVerifierPublicKeyConfig {
3838
* so subsequent calls to this method will return the same object.
3939
*
4040
* @return The initialized configuration object based on the contents of the configuration file
41-
* @throws RuntimException If there is any problem loading the configuration
41+
* @throws RuntimeException If there is any problem loading the configuration
4242
*/
4343
public static TokenVerifierPublicKeyConfig readFromFileOrClasspath() {
4444
String customLocation = System.getenv(LOCATION_ENV);
@@ -81,4 +81,8 @@ public String getResourceName() {
8181
return resourceName;
8282
}
8383

84+
public void setResourceName(String resourceName) {
85+
this.resourceName = resourceName;
86+
}
87+
8488
}

src/main/java/org/radarbase/appserver/dto/protocol/NotificationProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ public class NotificationProtocol {
4545
private LanguageText body;
4646

4747
@JsonProperty("email")
48-
private EmailNotificationProtocol email;
48+
private EmailNotificationProtocol email = new EmailNotificationProtocol();
4949
}
5050

src/test/java/org/radarbase/appserver/repository/UserRepositoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
import static org.radarbase.appserver.controller.RadarUserControllerTest.FCM_TOKEN_1;
2929
import static org.radarbase.appserver.controller.RadarUserControllerTest.TIMEZONE;
3030

31+
import java.sql.SQLIntegrityConstraintViolationException;
3132
import java.time.Instant;
3233
import jakarta.persistence.PersistenceException;
3334

34-
import org.hibernate.exception.ConstraintViolationException;
3535
import org.junit.jupiter.api.BeforeEach;
3636
import org.junit.jupiter.api.Test;
3737
import org.junit.jupiter.api.extension.ExtendWith;
@@ -145,6 +145,6 @@ public void whenInsertWithExistingFcmToken_thenThrowException() {
145145
entityManager.flush();
146146
});
147147

148-
assertEquals(ConstraintViolationException.class, ex.getCause().getClass());
148+
assertEquals(SQLIntegrityConstraintViolationException.class, ex.getCause().getClass());
149149
}
150150
}

0 commit comments

Comments
 (0)