Skip to content

Commit

Permalink
feat(rest.network.configuration.provider): new rest api for network c…
Browse files Browse the repository at this point in the history
…onfiguration management (#4915)

* Added first structure of bundle

Signed-off-by: SimoneFiorani <[email protected]>

* Rebase branch on develop

Signed-off-by: SimoneFiorani <[email protected]>

* working apis, missing tests

Signed-off-by: SimoneFiorani <[email protected]>

* Added tests, update code with comments

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed formatter problem and duplications

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed general problems

Signed-off-by: SimoneFiorani <[email protected]>

* Fixed headers and conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Resolving conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Resolved all conflicts

Signed-off-by: SimoneFiorani <[email protected]>

* Added bundle configuration only in not-nn profiles

Signed-off-by: SimoneFiorani <[email protected]>

* fix: Deleted incorrectly named license files

---------

Signed-off-by: SimoneFiorani <[email protected]>
Co-authored-by: nicolatimeus <[email protected]>
  • Loading branch information
sfiorani and nicolatimeus authored Nov 17, 2023
1 parent 5a5a9b3 commit ee2c973
Show file tree
Hide file tree
Showing 24 changed files with 760 additions and 10 deletions.
1 change: 1 addition & 0 deletions kura/distrib/config/kura.build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ org.eclipse.kura.core.tamper.detection.version=1.4.0-SNAPSHOT
org.eclipse.kura.log.filesystem.provider.version=1.3.0-SNAPSHOT
org.eclipse.kura.rest.cloudconnection.provider.version=1.0.0-SNAPSHOT
org.eclipse.kura.rest.configuration.provider.version=1.3.0-SNAPSHOT
org.eclipse.kura.rest.network.configuration.provider.version=1.0.0-SNAPSHOT
org.eclipse.kura.rest.inventory.provider.version=1.0.0-SNAPSHOT
org.eclipse.kura.rest.command.provider.version=1.0.0-SNAPSHOT
org.eclipse.kura.rest.packages.provider.version=1.0.0-SNAPSHOT
Expand Down
7 changes: 7 additions & 0 deletions kura/distrib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,11 @@
<artifactId>org.eclipse.kura.rest.configuration.provider</artifactId>
<version>${org.eclipse.kura.rest.configuration.provider.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.kura</groupId>
<artifactId>org.eclipse.kura.rest.network.configuration.provider</artifactId>
<version>${org.eclipse.kura.rest.network.configuration.provider.version}</version>
</artifactItem>
<artifactItem>
<groupId>org.eclipse.kura</groupId>
<artifactId>org.eclipse.kura.rest.inventory.provider</artifactId>
Expand Down Expand Up @@ -834,6 +839,7 @@
<move file="target/plugins/org.eclipse.kura.log.filesystem.provider.jar" tofile="target/plugins/org.eclipse.kura.log.filesystem.provider_${org.eclipse.kura.log.filesystem.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.cloudconnection.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.cloudconnection.provider_${org.eclipse.kura.rest.cloudconnection.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.configuration.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.configuration.provider_${org.eclipse.kura.rest.configuration.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.network.configuration.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.network.configuration.provider_${org.eclipse.kura.rest.network.configuration.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.inventory.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.inventory.provider_${org.eclipse.kura.rest.inventory.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.command.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.command.provider_${org.eclipse.kura.rest.command.provider.version}.jar" />
<move file="target/plugins/org.eclipse.kura.rest.packages.provider.jar" tofile="target/plugins/org.eclipse.kura.rest.packages.provider_${org.eclipse.kura.rest.packages.provider.version}.jar" />
Expand Down Expand Up @@ -2552,6 +2558,7 @@
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.provider_${org.eclipse.kura.rest.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.cloudconnection.provider_${org.eclipse.kura.rest.cloudconnection.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.configuration.provider_${org.eclipse.kura.rest.configuration.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.network.configuration.provider_${org.eclipse.kura.rest.network.configuration.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.inventory.provider_${org.eclipse.kura.rest.inventory.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.command.provider_${org.eclipse.kura.rest.command.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
<copy file="${project.build.directory}/plugins/org.eclipse.kura.rest.packages.provider_${org.eclipse.kura.rest.packages.provider.version}.jar" todir="${project.build.directory}/staging/target-definition/equinox_3.16.0/repository/plugins" />
Expand Down
22 changes: 22 additions & 0 deletions kura/distrib/src/main/ant/build_equinox_distrib.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@

<!-- Rest bundles config -->
<antcall target="rest-config" />

<!-- Rest network configuration bundle config -->
<antcall target="rest-network-config" />

<!-- Asset bundles config -->
<antcall target="asset-config" />
Expand Down Expand Up @@ -781,6 +784,8 @@ fi]]>
<antcall target="camel-jar" />

<antcall target="rest-jar" />

<antcall target="rest-network-config-jar" />

<antcall target="asset-jar" />

Expand Down Expand Up @@ -1335,6 +1340,14 @@ fi]]>
value=", reference:file:${kura.install.dir}/${kura.symlink}/${plugins.folder}/org.eclipse.kura.request.handler.jaxrs_${org.eclipse.kura.request.handler.jaxrs.version}.jar@4" />
</propertyfile>
</target>

<target name="rest-network-config" unless="is.nn">
<propertyfile
file="${project.build.directory}/${build.output.name}/config.ini">
<entry key="osgi.bundles" operation="+"
value=", reference:file:${kura.install.dir}/${kura.symlink}/${plugins.folder}/org.eclipse.kura.rest.network.configuration.provider_${org.eclipse.kura.rest.network.configuration.provider.version}.jar@4:start" />
</propertyfile>
</target>

<target name="deployment-hooks-config">
<propertyfile
Expand Down Expand Up @@ -1450,6 +1463,15 @@ fi]]>
prefix="${build.output.name}/${plugins.folder}" />
</zip>
</target>

<target name="rest-network-config-jar" unless="is.nn">
<zip destfile="${project.build.directory}/${build.output.name}.zip"
update="true">
<zipfileset
file="${project.build.directory}/plugins/org.eclipse.kura.rest.network.configuration.provider_${org.eclipse.kura.rest.network.configuration.provider.version}.jar"
prefix="${build.output.name}/${plugins.folder}" />
</zip>
</target>

<target name="deployment-hooks-jar">
<zip destfile="${project.build.directory}/${build.output.name}.zip"
Expand Down
2 changes: 2 additions & 0 deletions kura/distrib/src/main/resources/common/Kura_Emulator.launch
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,10 @@
<setEntry value="org.eclipse.kura.rest.asset.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.cloudconnection.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.configuration.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.network.configuration.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.identity.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.inventory.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.identity.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.command.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.position.provider@default:default"/>
<setEntry value="org.eclipse.kura.rest.provider@default:default"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
<esf:value>[{"name":"kura.user.admin","credentials":{"kura.password":"jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.appadmin","credentials":{"kura.password":"3hPckF8Zc+IF3pVineBvck3zJERUl8itosySULE1hpM="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.netadmin","credentials":{"kura.password":"3PgDKAMCxgRWBHiT1dEBS97bPqt7xckgdwrADJiDoWg="},"properties":{"kura.need.password.change":"true"}}]</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="groups.config" type="String">
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.cloudconnection"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.system"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.network.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.system"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
</esf:property>
</esf:properties>
</esf:configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@
<esf:value>[{"name":"kura.user.admin","credentials":{"kura.password":"jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.appadmin","credentials":{"kura.password":"3hPckF8Zc+IF3pVineBvck3zJERUl8itosySULE1hpM="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.netadmin","credentials":{"kura.password":"3PgDKAMCxgRWBHiT1dEBS97bPqt7xckgdwrADJiDoWg="},"properties":{"kura.need.password.change":"true"}}]</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="groups.config" type="String">
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.cloudconnection"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.network.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
</esf:property>
</esf:properties>
</esf:configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
<esf:value>[{"name":"kura.user.admin","credentials":{"kura.password":"jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.appadmin","credentials":{"kura.password":"3hPckF8Zc+IF3pVineBvck3zJERUl8itosySULE1hpM="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.netadmin","credentials":{"kura.password":"3PgDKAMCxgRWBHiT1dEBS97bPqt7xckgdwrADJiDoWg="},"properties":{"kura.need.password.change":"true"}}]</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="groups.config" type="String">
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.cloudconnection"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.network.configuration"},{"name":"kura.permission.rest.identity"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
</esf:property>
</esf:properties>
</esf:configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
<esf:value>[{"name":"kura.user.admin","credentials":{"kura.password":"jGl25bVBBBW96Qi9Te4V37Fnqchz/Eu4qB9vKrRIqRg="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.appadmin","credentials":{"kura.password":"3hPckF8Zc+IF3pVineBvck3zJERUl8itosySULE1hpM="},"properties":{"kura.need.password.change":"true"}},{"name":"kura.user.netadmin","credentials":{"kura.password":"3PgDKAMCxgRWBHiT1dEBS97bPqt7xckgdwrADJiDoWg="},"properties":{"kura.need.password.change":"true"}}]</esf:value>
</esf:property>
<esf:property array="false" encrypted="false" name="groups.config" type="String">
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.cloudconnection"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
<esf:value>[{"name":"kura.permission.kura.admin","basicMembers":["kura.user.admin"]},{"name":"kura.permission.kura.cloud.connection.admin","basicMembers":["kura.user.appadmin","kura.user.netadmin"]},{"name":"kura.permission.kura.device","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.maintenance"},{"name":"kura.permission.kura.network.admin","basicMembers":["kura.user.netadmin"]},{"name":"kura.permission.kura.packages.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.kura.wires.admin","basicMembers":["kura.user.appadmin"]},{"name":"kura.permission.rest.assets"},{"name":"kura.permission.rest.command"},{"name":"kura.permission.rest.configuration"},{"name":"kura.permission.rest.network.configuration"},{"name":"kura.permission.rest.network.configuration"},{"name":"kura.permission.rest.inventory"},{"name":"kura.permission.rest.keystores"},{"name":"kura.permission.rest.network.status"},{"name":"kura.permission.rest.position"},{"name":"kura.permission.rest.tamper.detection"},{"name":"kura.permission.rest.wires.admin"}]</esf:value>
</esf:property>
</esf:properties>
</esf:configuration>
Expand Down
Loading

0 comments on commit ee2c973

Please sign in to comment.