Skip to content

Commit f8fcfb2

Browse files
author
Rob Tjalma
committed
Merge branch 'develop' into dependabot/maven/junit-jupiter.version-5.8.1
Signed-off-by: Rob Tjalma <[email protected]>
2 parents 08a85c3 + 1de7124 commit f8fcfb2

File tree

19 files changed

+94
-38
lines changed

19 files changed

+94
-38
lines changed

.github/workflows/build-project.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up JDK 1.11
18-
uses: actions/[email protected].0
18+
uses: actions/[email protected].1
1919
with:
2020
distribution: 'zulu'
2121
java-version: '11'
2222
- name: Create custom Maven Settings.xml
23-
uses: whelk-io/maven-settings-xml-action@v18
23+
uses: whelk-io/maven-settings-xml-action@v20
2424
with:
2525
output_file: custom_maven_settings.xml
2626
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
2727
- name: Build with Maven
28-
run: ./mvnw -s custom_maven_settings.xml -B clean verify
28+
run: ./mvnw -s custom_maven_settings.xml -B clean verify -Pnative

.github/workflows/release-project.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ jobs:
2424
shell: bash
2525
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
2626
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
27-
- name: Set up JDK 11
28-
uses: actions/[email protected].0
27+
- name: Set up JDK 1.11
28+
uses: actions/[email protected].1
2929
with:
3030
distribution: 'zulu'
3131
java-version: '11'
3232
- name: Create custom Maven Settings.xml
33-
uses: whelk-io/maven-settings-xml-action@v18
33+
uses: whelk-io/maven-settings-xml-action@v20
3434
with:
3535
output_file: custom_maven_settings.xml
3636
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
@@ -39,6 +39,6 @@ jobs:
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
- name: Deploy with Maven to GitHub Packages and Docker Hub
42-
run: ./mvnw -B -s custom_maven_settings.xml -Prelease clean deploy
42+
run: ./mvnw -B -s custom_maven_settings.xml -Prelease,native clean deploy
4343
env:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sonarcloud-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
- name: Set up JDK 11
20-
uses: actions/[email protected].0
20+
uses: actions/[email protected].1
2121
with:
2222
distribution: 'zulu'
2323
java-version: '11'
@@ -34,7 +34,7 @@ jobs:
3434
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
3535
restore-keys: ${{ runner.os }}-m2
3636
- name: Create custom Maven Settings.xml
37-
uses: whelk-io/maven-settings-xml-action@v18
37+
uses: whelk-io/maven-settings-xml-action@v20
3838
with:
3939
output_file: custom_maven_settings.xml
4040
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ Below environment variable(s) can be used to configure the connection to BaseX,
8383
| BASEX_USERNAME | basex.username | Username under which the application logs in. | admin |
8484
| BASEX_PASSWORD | basex.password | Password of the username used above. | admin |
8585

86-
Below environment variable(s) can be used to configure which claims are used to fill the UserInfo response.
87-
88-
| Environment variable | Java Property | Description | Example |
89-
| -------------------------------- | ------------------------------ | --------------------------------------------- | ---------------- |
90-
| USERINFO_NAME_CLAIMNAME | compas.userinfo.name.claimname | The Name of the user logged in. | name |
91-
| USERINFO_WHO_CLAIMNAME | compas.userinfo.who.claimname | The Name of the user used in the Who History. | name |
86+
Below environment variable(s) can be used to configure which claims and information are used to fill the UserInfo
87+
response.
88+
89+
| Environment variable | Java Property | Description | Example |
90+
| -------------------------------- | ------------------------------- | ----------------------------------------------------------- | ---------------- |
91+
| USERINFO_NAME_CLAIMNAME | compas.userinfo.name.claimname | The Name of the user logged in. | name |
92+
| USERINFO_WHO_CLAIMNAME | compas.userinfo.who.claimname | The Name of the user used in the Who History. | name |
93+
| USERINFO_SESSION_WARNING | compas.userinfo.session.warning | Number of minutes a Session Warning can be displayed. | 20 |
94+
| USERINFO_SESSION_EXPIRES | compas.userinfo.session.expires | Number of minutes a Session Expires to display in Frontend. | 30 |
9295

9396
## Security
9497

app/pom.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ SPDX-License-Identifier: Apache-2.0
1818
<packaging>jar</packaging>
1919

2020
<properties>
21-
<quarkus.platform.version>2.2.3.Final</quarkus.platform.version>
21+
<quarkus.platform.version>2.3.0.Final</quarkus.platform.version>
22+
23+
<quarkus.container-image.group>lfenergycompas</quarkus.container-image.group>
24+
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
2225
</properties>
2326

2427
<dependencyManagement>
@@ -50,7 +53,7 @@ SPDX-License-Identifier: Apache-2.0
5053
</dependency>
5154
<dependency>
5255
<groupId>org.lfenergy.compas.core</groupId>
53-
<artifactId>rest-commons</artifactId>
56+
<artifactId>jaxrs-commons</artifactId>
5457
</dependency>
5558

5659
<dependency>
@@ -156,7 +159,9 @@ SPDX-License-Identifier: Apache-2.0
156159

157160
<properties>
158161
<quarkus.package.type>native</quarkus.package.type>
159-
<quarkus.native.container-build>true</quarkus.native.container-build> <!-- Allows for creating a Linux executable without GraalVM being installed -->
162+
<!-- Allows for creating a Linux executable without GraalVM being installed -->
163+
<quarkus.native.container-build>true</quarkus.native.container-build>
164+
<quarkus.native.additional-build-args>-H:ReflectionConfigurationFiles=reflection-config.json</quarkus.native.additional-build-args>
160165
</properties>
161166

162167
<build>
@@ -202,8 +207,6 @@ SPDX-License-Identifier: Apache-2.0
202207
<properties>
203208
<!-- Properties only used for publishing a native docker image (default to Docker Hub) -->
204209
<quarkus.container-image.build>true</quarkus.container-image.build>
205-
<quarkus.container-image.group>lfenergycompas</quarkus.container-image.group>
206-
<quarkus.container-image.name>compas-scl-data-service</quarkus.container-image.name>
207210
<quarkus.container-image.push>true</quarkus.container-image.push>
208211
<quarkus.container-image.additional-tags>latest</quarkus.container-image.additional-tags>
209212
</properties>

app/src/main/docker/Dockerfile.jvm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
4242

4343
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
4444
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
45+
ENV JAVA_MAX_MEM_RATIO="70"
4546
# We make four distinct layers so if there are application changes the library layers can be re-used
4647
COPY --chown=1001 target/quarkus-app/lib/ /deployments/lib/
4748
COPY --chown=1001 target/quarkus-app/*.jar /deployments/

app/src/main/docker/Dockerfile.legacy-jar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
4242

4343
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
4444
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
45+
ENV JAVA_MAX_MEM_RATIO="70"
4546
COPY target/lib/* /deployments/lib/
4647
COPY target/*-runner.jar /deployments/app.jar
4748

app/src/main/java/org/lfenergy/compas/scl/data/rest/UserInfoProperties.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@ public interface UserInfoProperties {
1313

1414
@WithName("who.claimname")
1515
String who();
16+
17+
@WithName("session.warning")
18+
int sessionWarning();
19+
20+
@WithName("session.expires")
21+
int sessionExpires();
1622
}

app/src/main/java/org/lfenergy/compas/scl/data/rest/exception/CompasNoDataFoundExceptionHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0
44
package org.lfenergy.compas.scl.data.rest.exception;
55

6-
import org.lfenergy.compas.core.rest.model.ErrorResponse;
6+
import org.lfenergy.compas.core.jaxrs.model.ErrorResponse;
77
import org.lfenergy.compas.scl.data.exception.CompasNoDataFoundException;
88

99
import javax.ws.rs.core.Response;

app/src/main/java/org/lfenergy/compas/scl/data/rest/v1/CompasCommonResource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public UserInfoResponse getUserInfo(@HeaderParam("Authorization") String authHea
6666

6767
var response = new UserInfoResponse();
6868
response.setName(jsonWebToken.getClaim(userInfoProperties.name()));
69+
response.setSessionWarning(userInfoProperties.sessionWarning());
70+
response.setSessionExpires(userInfoProperties.sessionExpires());
6971
return response;
7072
}
7173
}

0 commit comments

Comments
 (0)