eclipse-basyx / basyx-databridge

Eclipse Public License 2.0
11 stars 18 forks source link

Add parameters "allowedSecurityPolicies" and refactoring #243

Closed BlackRose01 closed 1 year ago

BlackRose01 commented 1 year ago

I refactored the file, so that further parameters can better implemented and automated. I also added the parameter for allowed security policies.

Issue: #241

FrankSchnicke commented 1 year ago

Thank you very much for this contribution! However, the CI fails at the moment. Can you take a look at it?

BlackRose01 commented 1 year ago

Sure. Is there any toolchain I need to setup on my local machine because when I try to pack/install the project from the root folder (mvn clean package, mvn clean install) then I get an error from the core Module. The HealthCheckTest responseServiceUnavailableWhenServiceIsUnhealthy failed because of org.apache.http.conn.HttpHostConnectException: Connect to 0.0.0.0:8085 [/0.0.0.0] failed: Connection timed out: connect``. The configuration comes from the classHealthCheckUtils``.

FrankSchnicke commented 1 year ago

I can't replicate this issue on my end, mvn clean install is working as expected. Is there maybe something running in the background on the same port?

Alternatively, you can install the DataBridge with skipped test (mvn install -DskipTests) and then run mvn install only in the OPC UA project.

BlackRose01 commented 1 year ago

Thank you for the information. When I skip all tests and then eexecute the test everything is working. I already found the error. The configration map is not filled. So I have to look why and fix this.

BlackRose01 commented 1 year ago

It is working now. The problem was that GSON does not support attribute-fine deserialization without a deserializer. So I implemented a deserializer which maps all variables parameters, like security, pollingInterval, keyStore, etc., to a map and will dynamically joined. The uri opcua parameters are now wrapped in a JSON object in the consumer JSON file. So the fixed and the variable part are separated and can be parsed easily.

BlackRose01 commented 1 year ago

Just for completeness: The parameters for Apache Camel - Milo can be found here Apache Camel - Milo Component

FrankSchnicke commented 1 year ago

Thanks a lot! I just have one small remark: Due to moving the requestedPublishingInterval into the parameters map, configuration files for the previous versions would break. Would it be possible to adapt the custom deserializer so that it checks if this value is provided in the old way, and if yes, use this value for configuration?

BlackRose01 commented 1 year ago

You're welcome. I will update the deserializer

BlackRose01 commented 1 year ago

The update is now live

FrankSchnicke commented 1 year ago

Much appreciated 👍