Skip to content

Commit d5d0416

Browse files
author
Dennis Labordus
committed
Small issues and fixes.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent f090abb commit d5d0416

14 files changed

+36
-16
lines changed

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ public Uni<SclValidateResponse> validateSCL(@PathParam(TYPE_PATH_PARAM) SclFileT
4141
new SclValidatorEventRequest(type, request.getSclData()))
4242
.onItem().transform(Message::body);
4343
}
44-
}
44+
}

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/SclValidatorServerEndpoint.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import org.lfenergy.compas.scl.validator.rest.v1.event.SclValidatorEventRequest;
1010
import org.lfenergy.compas.scl.validator.rest.v1.model.SclValidateRequest;
1111
import org.lfenergy.compas.scl.validator.rest.v1.websocket.SclValidateRequestDecoder;
12+
import org.lfenergy.compas.scl.validator.rest.v1.websocket.SclValidateRequestEncoder;
13+
import org.lfenergy.compas.scl.validator.rest.v1.websocket.SclValidateResponseDecoder;
1214
import org.lfenergy.compas.scl.validator.rest.v1.websocket.SclValidateResponseEncoder;
1315
import org.slf4j.Logger;
1416
import org.slf4j.LoggerFactory;
@@ -25,8 +27,8 @@
2527
@Authenticated
2628
@ApplicationScoped
2729
@ServerEndpoint(value = "/compas-scl-validator/validate-ws/v1/{" + TYPE_PATH_PARAM + "}",
28-
decoders = SclValidateRequestDecoder.class,
29-
encoders = SclValidateResponseEncoder.class)
30+
decoders = {SclValidateRequestDecoder.class, SclValidateResponseDecoder.class},
31+
encoders = {SclValidateRequestEncoder.class, SclValidateResponseEncoder.class})
3032
public class SclValidatorServerEndpoint {
3133
private static final Logger LOGGER = LoggerFactory.getLogger(SclValidatorServerEndpoint.class);
3234

@@ -59,4 +61,4 @@ public void onError(Session session, @PathParam(TYPE_PATH_PARAM) String type, Th
5961
public void onClose(Session session, @PathParam(TYPE_PATH_PARAM) String type) {
6062
LOGGER.debug("Closing session {} for type {}.", session.getId(), type);
6163
}
62-
}
64+
}

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/event/SclValidatorEventHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import java.io.IOException;
1414

1515
/**
16-
* Event Handler used by the Websockets implementation to execute the validation asynchronized.
16+
* Event Handler used to execute the validation asynchronized.
1717
*/
1818
@ApplicationScoped
1919
public class SclValidatorEventHandler {

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/websocket/SclValidateRequestDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ public SclValidateRequest decode(String message) {
4242
public void destroy() {
4343
// do nothing.
4444
}
45-
}
45+
}

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/websocket/SclValidateRequestEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ public String encode(SclValidateRequest request) {
3939
public void destroy() {
4040
// do nothing.
4141
}
42-
}
42+
}

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/websocket/SclValidateResponseDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ public SclValidateResponse decode(String message) {
4242
public void destroy() {
4343
// do nothing.
4444
}
45-
}
45+
}

app/src/main/java/org/lfenergy/compas/scl/validator/rest/v1/websocket/SclValidateResponseEncoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ public String encode(SclValidateResponse response) {
3939
public void destroy() {
4040
// do nothing.
4141
}
42-
}
42+
}

app/src/main/resources/application.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ compas.validator.nsdoc.directory = /data/nsdoc
77
compas.validator.temp.directory = /data/temp
88

99
quarkus.http.cors = false
10-
# Set s the extra context for all RestEasy API Calls, for Websockets this needs to be included in the path.
10+
# Sets the extra context for all RestEasy API Calls, for Websockets this needs to be included in the endpoint itself.
1111
quarkus.http.root-path = /compas-scl-validator
1212
quarkus.http.limits.max-body-size = 150M
1313

@@ -39,7 +39,7 @@ mp.jwt.verify.audiences = ${JWT_VERIFY_CLIENT_ID:scl-validator}
3939
smallrye.jwt.path.groups = ${JWT_GROUPS_PATH:resource_access/scl-validator/roles}
4040

4141
quarkus.http.auth.permission.deny-default.paths=/*
42-
quarkus.http.auth.permission.deny-default.policy=permit
42+
quarkus.http.auth.permission.deny-default.policy=deny
4343

4444
quarkus.http.auth.permission.allow-quarkus-services.paths=/compas-scl-validator/q/health/live,/compas-scl-validator/q/health/ready,/compas-scl-validator/q/openapi
4545
quarkus.http.auth.permission.allow-quarkus-services.policy=permit

app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/event/SclValidatorEventHandlerTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
14
package org.lfenergy.compas.scl.validator.rest.v1.event;
25

36
import io.smallrye.mutiny.helpers.test.UniAssertSubscriber;
@@ -83,4 +86,4 @@ void validateWebsocketsEvent_WhenCalled_ThenExpectedCallsAreMade() throws IOExce
8386
verify(request, times(1)).getType();
8487
verify(request, times(1)).getSclData();
8588
}
86-
}
89+
}

app/src/test/java/org/lfenergy/compas/scl/validator/rest/v1/event/SclValidatorEventRequestTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
14
package org.lfenergy.compas.scl.validator.rest.v1.event;
25

36
import com.openpojo.reflection.impl.PojoClassFactory;

0 commit comments

Comments
 (0)