Skip to content

Commit

Permalink
Merge pull request #288 from com-pas/upgrade-websocket
Browse files Browse the repository at this point in the history
Using new websocket version of validation
  • Loading branch information
Dennis Labordus authored Nov 24, 2022
2 parents dc95956 + f1e60b4 commit 62639a8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Build with Maven (Pull Request)
if: ${{ github.event_name == 'pull_request' }}
run: ./mvnw -s custom_maven_settings.xml -B -Pjvm-image clean verify
run: ./mvnw -s custom_maven_settings.xml -B -Pnative-image clean verify
- name: Build with Maven (Push)
if: ${{ github.event_name == 'push' }}
run: ./mvnw -s custom_maven_settings.xml -B clean verify
2 changes: 1 addition & 1 deletion .github/workflows/release-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy with Maven to GitHub Packages and Docker Hub
run: ./mvnw -B -s custom_maven_settings.xml -Pjvm-image,release clean deploy
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
Expand Down Expand Up @@ -52,7 +53,9 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
}

@OnMessage
public void onCreateMessage(Session session, CreateWsRequest request, @PathParam(TYPE_PATH_PARAM) String type) {
public void onCreateMessage(Session session,
@Valid CreateWsRequest request,
@PathParam(TYPE_PATH_PARAM) String type) {
LOGGER.info("Message (create) from session {} for type {}.", session.getId(), type);

String who = jsonWebToken.getClaim(userInfoProperties.who());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
Expand Down Expand Up @@ -45,7 +46,7 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {

@OnMessage
public void onGetMessage(Session session,
GetWsRequest request,
@Valid GetWsRequest request,
@PathParam(TYPE_PATH_PARAM) String type) {
LOGGER.info("Message (get) from session {} for type {}.", session.getId(), type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
Expand Down Expand Up @@ -46,7 +47,7 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {

@OnMessage
public void onGetVersionMessage(Session session,
GetVersionWsRequest request,
@Valid GetVersionWsRequest request,
@PathParam(TYPE_PATH_PARAM) String type) {
LOGGER.info("Message from session {} for type {}.", session.getId(), type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.websocket.*;
import javax.websocket.server.PathParam;
import javax.websocket.server.ServerEndpoint;
Expand Down Expand Up @@ -52,7 +53,8 @@ public void onOpen(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
}

@OnMessage
public void onUpdateMessage(Session session, UpdateWsRequest request,
public void onUpdateMessage(Session session,
@Valid UpdateWsRequest request,
@PathParam(TYPE_PATH_PARAM) String type) {
LOGGER.info("Message (update) from session {} for type {}.", session.getId(), type);

Expand Down
3 changes: 0 additions & 3 deletions app/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ quarkus.log.level = INFO
quarkus.log.category."org.lfenergy.compas.scl.data".level = INFO

# Add scanning these dependencies for scanning, also used by native compilation.
quarkus.index-dependency.hibernate-validator.group-id=org.hibernate.validator
quarkus.index-dependency.hibernate-validator.artifact-id=hibernate-validator

quarkus.index-dependency.websocket-commons.group-id = org.lfenergy.compas.core
quarkus.index-dependency.websocket-commons.artifact-id = websocket-commons

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ SPDX-License-Identifier: Apache-2.0
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
<sonarqube-plugin.version>3.2.0</sonarqube-plugin.version>

<compas.core.version>0.11.0</compas.core.version>
<compas.core.version>0.12.0</compas.core.version>

<quarkus.platform.version>2.14.1.Final</quarkus.platform.version>
<jaxb-impl.version>2.3.7</jaxb-impl.version>
Expand Down

0 comments on commit 62639a8

Please sign in to comment.