de4a-eu / de4a Goto Github PK
View Code? Open in Web Editor NEWDE4A WP5 Connector
License: Apache License 2.0
DE4A WP5 Connector
License: Apache License 2.0
Again the exception is caught and logged but operations continue afterwards. In this case two null values could be added to the responseWrapper property. Is this intended behaviour? Seems strange to return a response containing null values? In my opinion nothing should be returned or an error
FileUtils
empaquetarZip
ClienteWS
ClienteWSAuthenticator
to be continued
There is a hard coded password in the file https://github.com/de4a-wp5/de4a/blob/d47997f6deda975bc61f036432c1494e96ae3276/de4a-connector/src/main/java/eu/de4a/connector/as4/domibus/soap/ClienteWSAuthenticator.java
Since all the comments are in Spanish I don't know what the password and username is used for either.
Please ensure, that all the GZIP streams etc. are properly closed, as in
public static Document decodeCompressed(byte[] data) {
try {
byte[] decoded = Base64.decodeBase64(data);
GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(decoded));
byte[] targetArray = IOUtils.toByteArray(gis);
return DOMUtils.byteToDocument(targetArray);
} catch (Exception | MessageException e) {
logger.error("Error decoding compressed", e);
return null;
}
}
The regular expression iso6523-actorid-upis::[0-9][0-9][0-9][0-9]:[A-Z0-9]{1,15}
in IdkAp.provisionGet
is invalid. Please switch to
iso6523-actorid-upis::[0-9][0-9][0-9][0-9]:.+
I read this as IFF there is no id to be found in the evaluatorRequestRepository null will be returned. Then the evaluatorRequestDataRepository is checked for what is stored related to the received id which in this case can be null and if that List is empty you throw an exception. Would it not be easier and a lot more readable to use .orElseThrow on the first line instead of returning null?
Also, can we guarantee that there is absolutely no chance that we will have a value in the evaluatorRequestDataRepository that is not linked to null?
Cannot find anywhere that build time character encoding is set (I could have missed this somewhere):
This means that builds are platform dependant and could pose deployment problems on other platforms/machines than the actual build system. Fix
Two for-loops? This can (and should) be refactored to one
Method documentToByte
uses the system charset when converting a string to a byte[]. This will have undefined behaviour. Use StandardCharsets.UTF_8
instead.
Class names like Client
or MessageFactory
are not so super, because they are very generic and a developer doesn't see quickly when "client" or "message factory" it is. This holds true for many names.
When implementing Interface methods please also annotate the methods with Override
This method takes a list of files but ONLY cares about the first found. Is this actually intended behaviour? What if there are 10 files in the list? How do we know they are not all needed?
If no, than we could also remove the AMQP dependencies from the POM
Overriding methods should also annotate the parameters with the correct annotations. This goes for all methods in this class
https://github.com/de4a-wp5/de4a/blob/d47997f6deda975bc61f036432c1494e96ae3276/pom.xml#L67
The toop connector is used as compiled code dependency which is a security issue. On top of this it has previously created build problems as well as library transitivity problems which will probably happen again.
Hi, please use target/generated-sources
for the Domibus XSD stuff instead of src/main/java
and remove the committed classes.
The RequestController and ResponseController api mappings are defined with annotations in the RequestApi and ResponseApi interfaces. In my understanding the annotation definition of that mapping is typically either defined on the specific method definitions or in a separate XML file. Defining it on interfaces only used for those two specific classes remove the convenience of annotation based definition in keeping all the information together. Making the mappings feel hidden away and making the code hard to read. If there is too much to use the annotations in the code file itself, would it not be better to use the XML method of defining the mappings instead.
The named method ialCanonicalEvidenceTypeIdCountryCodeGet
is missing a few return
statements.
So instead of
new ResponseEntity<>(HttpStatus.BAD_REQUEST);
I assume it should read
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
Some files are still stored in another character encoding than UTF-8 which can create issues for other platforms than Windows. Fix
Using a solution like the above sets how all files in the project are treated by different editors on different platforms basically removing this problem project-wide
In order to make configurable REST api methods accessed by the Connector, it would be better extract that configuration to application.properties
The DE4AKafkaClient should probably be configured correctly from the start to make this an easy deployment for the pilots. They should only have to set the enabled flag to true or false and change the topic to reflect there country or some such like de4a-se-egovlab
The connector-mock has a good example, and the pom and code here, and usage
As the H2 Console is a powerful tool, an option should be added to disable this feature, as it may cause problems in security aware environments (mapping WebServlet
onto /h2-console/*
)
In class ClienteWS
field ENDPOINT_SERVER_TEST_DOMIBUS
This method is overly complicated and logically very hard to follow. Improve by refactoring to several smaller methods
May we delete it?
An exception is caught and logged. But operations continue afterwards. Is this intended behavior? It seems somewhat unorthodox to just continue processing responses when there is an exception. Maybe document the intention of the method and why
From reading the code, I get the impression that new requests and responses are put into an in memory database. And requests to the connector are served by reading from this database.
Say two requests are made with the same MessageID. How does the Connector guarantee that the right response is returned?
Only Java runtime classes may derive from "Throwable".
Why would we need this "Mock data type" in the real Connector? Who should exchange this?
When using BDXRClientReadOnly
you can retrieve all the SMP data according to the predefined rules. No need to re-implement this
Usually that should be part of the generated code in target/generated-sources
E.g. in class AS4MessageProcessorSPICustom
the ToopKafkaClient
is used directly. At least all places in DE4A code should use the DE4AKafkaClient
Windows specific paths in file
https://github.com/de4a-wp5/de4a/blob/d47997f6deda975bc61f036432c1494e96ae3276/de4a-connector/src/main/resources/log4j2.xml
It hides the code
field of ApiException
On my machine I am still having character encoding issues on the IDK swagger ui.
See if this setting fixes the issue
The method Conf.sslContext
should limit the network access to TLS 1.2 or hogher for security reasons.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.