GithubHelp home page GithubHelp logo

de4a's People

Contributors

andreasjberg avatar antosuna avatar aosunacab avatar daffydukk avatar danieldecastrop avatar eduardomorenoalcazar avatar hhberdon avatar pablopeique avatar phax avatar zigac-medius avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

de4a's Issues

Unclosed streams in class DOMUtils

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;
		}
	}

IDK Api uses wrong RegEx

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]:.+

Overcomplicated code

https://github.com/de4a-wp5/de4a/blob/d47997f6deda975bc61f036432c1494e96ae3276/de4a-connector/src/main/java/eu/de4a/connector/api/manager/ResponseManager.java#L107

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?

Buildtime character encoding not set

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

DOMUtils is using system charset

Method documentToByte uses the system charset when converting a string to a byte[]. This will have undefined behaviour. Use StandardCharsets.UTF_8 instead.

Use more specific class names.

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.

Domibus JAXB stuff is commited

Hi, please use target/generated-sources for the Domibus XSD stuff instead of src/main/java and remove the committed classes.

Api Mappings hidden away

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.

Character encoding in some files

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

Make the H2 Console optional

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/*)

How is it guaranteed that the right response is returned

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.