Commit Graph

750 Commits

Author SHA1 Message Date
Sebastian Firsching
41922bfa0c Adapt rel value in properties files
Signed-off-by: Sebastian Firsching <sebastian.firsching@bosch-si.com>
2023-06-20 09:08:05 +02:00
Shruthi Manavalli Ramanna
0759fd80b0 Added support for cdn download url for mgmt API and tests
Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
2023-06-02 19:09:31 +02:00
Stefan Behl
328ded7406 Fix RSQLUtilityTest (#1351) 2023-04-20 08:48:39 +02:00
Stefan Behl
5d0a9c0f1d Remove dependency net._01001111:jlorem (#1350)
* Remove dependency jlorem
* Minor optimization
* Minor optimization
2023-04-19 15:22:06 +02:00
Stefan Behl
a2fd46c732 Initial commit (#1345) 2023-04-06 16:47:45 +02:00
Michael Herdt
fbda9764b1 Fix circular rollout dependencies (#1337)
* Do some refactoring to fix dependencies between rollout management, executor and evaluator beans.
* Move rollout retrieving in same transaction as execution.
* Do some refactoring. Extend logging and exception handling.
* Remove unnecessary transactional and validation annotations.
* remove catching never thrown bean
* Fix new rollout handling API
2023-04-03 09:13:00 +02:00
Stefan Behl
4a3a79aa6b Migration to Spring Boot 2.7.10 (#1320)
* Initial commit
* Fix compile breaks
* Fix hibernate config
* Fix hibernate config
* Fix failing tests
* Improve logging
* Improve logging
* Fix Sonar issues
* Remove BusProperties
* Add BusProperties bean back in
* Fix JPA workaround
* Fix CVE-2021-22044
* Fix test failures
* Fix PR review findings
* Fix CVEs
* Remove H2 version downgrade, fix schema migration, enable legacy mode
* Downgrade Vaadin back to 8.14.3
* Fix EventPublisherHolder
* Fix RemoteTenantAwareEvent
* Fixed EventPublisherAutoConfiguration
* New version of spring-hateoas requires links to be expanded (Mgmt API)
* New version of spring-hateoas requires links to be expanded (Mgmt API)
* Fix PR review findings
* Fix PR review findings
* Fix PR review findings
* Update README.md
* MariaDB Java Client downgrade to maintain compatibility with AWS Aurora
* Temporarily disable RSQL test that depends on DB collation type
* Upgrade to boot 2.7.10
* Upgrade snakeyaml to 1.33
* Upgrade Spring Security OAuth2 to version 5.7.7
* Remove obsolete exclusion of junit-vintage-engine
* Upgrade jackson-bom to 2.14.2
2023-03-28 07:16:25 +02:00
Bondar Bogdan
5baf65c1f0 Added assignment quota error UI extractor (#1278)
* added assignment quota error UI extractor
* Verify amount of effected assignments instead of overall result count.

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
Co-authored-by: Michael Herdt <Michael.Herdt@bosch.com>
2023-03-23 11:43:20 +01:00
Ahmed Sayed
090db6fd7b Speedup build: introduced SharedSqlTestDatabase and DisposableSqlTestDatabase junit extensions (#1218)
* fixed PostgreSql migration scripts
* introduces SharedSqlTestDatabaseExtension and DisposableSqlTestDatabaseExtension
* Add cause msg to JUnitTestLoggerExtension

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>
Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>
Co-authored-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>
2023-03-09 07:30:22 +01:00
Shruthi Manavalli Ramanna
92256ed787 Fix the wildcard search and add additional junit on software module (#1327)
* fix the wildcard search and add additional junit on software module
* remove unwanted line of code
* Altered the test class to check the jenkins build
* trying other umlout characters as well
* fixed the jenkins issue and reverted all jenkins related changes
* Fixed PR comments
* Fixed PR comments
* made the variable final
* removed the unwanted uppercase conversion

Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
2023-03-08 15:22:51 +01:00
Martin Böh
108622879d jpa/tests: fix flaky findMessagesByActionStatusId test (#1325)
Signed-off-by: Martin Böh <contact@martb.dev>
2023-02-27 14:31:08 +01:00
Michael Herdt
35b57f991f Fix sub entity attribute formatting (#1326)
* Fix formatting of the sub entity attribute by verifying the formatting against the sub entity attributes list of the related parent property enum.
* Verify action API by target property filter
2023-02-27 14:23:03 +01:00
Michael Herdt
06fc4fb6d2 Make exposed CORS headers configurable (#1322)
* Prevent losing headers (like CORS related ones) when resetting the response headers due to artifact stream.

* add comment

* Extend CORS tests to verify provided header.
2023-02-23 14:16:42 +01:00
Zygmunt Krynicki
a64c2bc28e Fix several typos (#1314)
Those were discorvered while casually browsing the source code in an IDE.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
2023-02-01 15:24:34 +01:00
Michael Herdt
21f1569881 Support user consent flow (#1293)
* Introduce user consent flow
* Add permissions to confirmation management
* rename from consent to confirmation
* Reformat code. Remove unused imports. Change and add permission checks when configuring auto-confirmation.
* Do not include null values for DDI confirmation base endpoint
* fix confirmation required checkbox id
* Remove unused import. Fix consume/produce type of new API's.
* Change term processing to proceeding when activating user consent flow
* Align formatting and extend integration test cases for DMF and DDI.
* Extend DMF test cases to consider auto-confirmation
* Refactor action management to fix problem of handling action status updates on closed actions.
* remove unsupported validation
* use new confirmation api for DMF. Extend test cases.,
* Remove unnecessary fields.
* Extend API documentation for DDI and MGMT API.
* adapt ddi api docs adoc file
* Fixed the duplicate migration version for db files
* fix method to support confirmation
* Fixed PR comments
* Addressed PR comments
* Fixed after merge compilation issue
* Fixed after merge compilation issue
* Fix failing tests in MgmtRolloutResourceTest
* Fixed the permissions issue reflected by integration tests
* Added back the missing line of code lost during merge
* Fix the failing test on Jenkins

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>
Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>
Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
Signed-off-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
Co-authored-by: Shruthi Manavalli Ramanna <shruthimanavalli.ramanna@bosch-si.com>
2023-01-25 12:11:05 +01:00
Stefan Klotz
7e53c16ea6 fix compile error (#1310)
Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
2023-01-12 14:12:35 +01:00
Dimitar Shterev
2db45a4cc5 Trigger next rollout group - backend and management API implementatio… (#1294)
* Trigger next rollout group - backend and management API implementations. Backend and management API tests.
* Trigger next rollout group - Fixed resource documentation test.
* Trigger next rollout group - Fixed resource documentation test.
* add rest docs
* Trigger next rollout group - UI changes. New button for trigger next rollout group in rollout view.
* add error test for rest api
* Trigger next rollout group - Added test for triggering next group for all rollout states.
* add confirm
* fix test
* replace DB calls
* fix translation
* fix error message

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>
Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
Co-authored-by: Stefan Klotz <stefan.klotz@bosch.io>
2023-01-12 13:22:09 +01:00
Markus Block
ed1e7d8da2 Adding last action status code in view Rolloutgroup targets (#1295)
* added column action status code to RolloutGroupTarget view, currently bug too many rows
* changed JPA query to return also action status code
* added repository tests
* additional checks in tests
* improved jpa query to retrieve targets of rollout group
* added new property lastActionStatusCode to action for performance reasons
* added new property lastActionStatusCode to action for performance reasons
* adapted test cases
* fixing build problems on MAC with asciidoctor
* added testcase to ensure action status code is stored on action
* setting min push size to this value reduces multiple calls to the db
* renamed properties for consistency
* incorporated code review remarks
2023-01-12 12:53:23 +01:00
Stefan Behl
d7796121d1 Add resource collection /rest/v1/actions to Management REST API (#1299)
* Initial commit

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Added filtering by RSQL

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>

* Support for filtering actions by distribution set, target, rollout

* Added REST docs

* Fixed REST docs

* Introduce a config property which allows to disable the actions endpoint

* Introduce representation mode parameter

* Adapt REST docs

* Incorporate review findings

* Adapt REST docs

* Improve unit tests

* Minor improvements

* Fix REST docs

* Fix REST docs

* Fix PR review findings

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>
2023-01-10 17:19:05 +01:00
Stefan Klotz
28d90c3754 Exclude soft deleted entities from findByRsql result for all entities (#1297)
* exclude soft deleted SMs and SM types from findByRsql result

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* add tests

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* clean up code

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
2022-12-21 16:16:53 +01:00
Michael Herdt
0e4eb111f2 Add db migration script of action status code for POSTRESQL databases. (#1291)
Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2022-10-26 11:17:38 +02:00
Markus Block
60e33afca4 Enable sorting in tables (#1279)
* provided infrastructure to enable sorting in grids
* Fixed sorting in RolloutGroupTarget
* fixed sorting with pinning and assigned SoftwareModules
* Added sorting for columns createdBy, createdAt, lastModifiedBy and lastModifiedAt
* Adapted status columns to be sortable
* fixed unit tests
* fixing sonar findings
* making Sonar happy
* added testcases for management classes regarding sorting
* added testcases for management classes regarding sorting
* using name for element ids in DOM
* incorporated code review remarks

Signed-off-by: Markus Block <markus.block@bosch-si.com>
2022-09-30 09:54:17 +02:00
Michael Herdt
ea5a3b3d30 Adapt cancel flow (#1274)
* Adapt assignment events to communicate mass cancel operations within one event.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix edge cases identified by test failures. Adapt tests and reduce amount of published cancel events.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix license header

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Refactor visibility of methods in assignment strategy classes. Avoid having empty action status messages.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix api docs

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
Co-authored-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-09-21 17:04:08 +02:00
Michael Herdt
5e963f8308 Introduce action status scoped custom code (#1277)
* Allow providing a custom code with an action status feedback to give more fine grained device specific details.
* Add ddi rest docs for new optional status code value.
* Provide new code value via mgmt api. Fix review findings.
* Fix failing tests

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
Co-authored-by: Stefan Behl <stefan.behl@bosch.io>
2022-09-21 15:20:34 +02:00
Florian Ruschbaschan
32718676a4 Feature/java11 build (#1280)
* hawkBit on Java 11

Signed-off-by: Dominic Schabel <dominic.schabel@bosch.io>

* Preparing java 11 build

- Update eclipse-link maven plugin dependencies
- Fixing warnings, adopt to java-11 style

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Preparing java 11 build

- Fixing warnings, adapt to java-11 style
- Added since to deprecated

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing sonar warnings

- removed deprecated API

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing sonar warnings & failing test

- Added suppressWarning
- added WithSpringAuthorityRule to clean-up listener

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Compile warnings

- Test if final causes issues in tests

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Removed deprecated code

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Reverted changes

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Removed final as this causes invalid reflective access exceptions

- The eclipselink generated classes seem to modify the field directly
- update plugin version

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Upgrade eclipselink from 2.7.9 to 2.7.10

* Remove @deprecated endpoints from MgmtTargetTagResource

* Remove dependencies already defined in eclipselink-maven-plugin

* Try eclipselink 2.7.11-RC1

* Set project encoding to UTF-8

* Upgrade surefire and failsafe plugins to 3.0.0-M7

* Try fixed string instead of a random generated one

* Replace JsonBuilder by Jackson ObjectMapper usage

* Use JsonBuilder again

* Use APPLICATION_JSON_UTF8 instead of APPLICATION_JSON

* Try to replace com.vaadin.external.google:android-json by org.json:json

* Add debugging outputs

* Improve debugging outputs

* Improve debugging outputs

* Use Jackson instead of JsonBuilder

* Use Jackson instead of JsonBuilder 2nd part

* Use Spring json dependency

* Use eclipselink 2.7.11

* Fix RootControllerDocumentationTest

* Improve helper methods of AbstractDDiApiIntegrationTest

* Upgrade SpringBoot and SpringCloud versions

* Improve deprecation notice for 0.3.0M8

* Fix BaseAmqpServiceTest

* Fix SpecificationsBuilderTest

* Removed deprecated code

* Define maven-enforcer-plugin version

* Remove com.google.code.findbugs.jsr305

Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>

* Update circleci image to openjdk:openjdk:11.0.13-jdk-buster

Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>

* Fix javadoc generation and license check

Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>

* Fix review findings

Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>

Signed-off-by: Dominic Schabel <dominic.schabel@bosch.io>
Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>
Signed-off-by: Florian Ruschbaschan <florian.ruschbaschan@bosch.io>
Co-authored-by: Dominic Schabel <dominic.schabel@bosch.io>
Co-authored-by: Peter Vigier <Peter.Vigier@bosch.io>
Co-authored-by: Markus Block <markus.block@bosch-si.com>
2022-09-19 10:33:31 +02:00
Bondar Bogdan
537548defb Update jsoup (#1276)
* upgraded jsoup to 1.15.3
* removed deprecated safe html annotation
* added own valid string jsoup validator, disabled hibernate parallel method declaration constraint
* adapted valid string validator
* static method
* return invalid value in case of processing exception

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-09-05 15:49:38 +02:00
Dimitar Shterev
bc2f228edc Dmf batch support changes. (#1273)
* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Update hawkbit-dmf/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/integration/AmqpMessageDispatcherServiceIntegrationTest.java

Co-authored-by: Bondar Bogdan <36962546+bogdan-bondar@users.noreply.github.com>

* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Dmf batch support changes. Implement single batch message instead of multiple messages for assigment on multiple targets. Added system property to switch on/off.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

* Dmf batch support changes. Implement code review comments.

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>

Signed-off-by: Dimitar Shterev <dimitar.shterev@bosch.io>
Co-authored-by: Bondar Bogdan <36962546+bogdan-bondar@users.noreply.github.com>
2022-08-30 09:55:52 +02:00
Stefan Klotz
a8ab467ac5 add SystemSecurityContext (#1269)
Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
2022-08-08 13:59:02 +02:00
Michael Herdt
1682b526ef Make custom target filter table expandable (#1267)
* initial draft to maximize custom target filer table for better UX in case of long keys/names
* Set correct maximize icon identifier and fix problem with wrong db table structure.
* Remove unnecessary local variable.
* Fix db migration scripts
* Fix losing the target tag table when mac and minimizing target table.
* fixed minor styling, removed duplication

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2022-08-05 11:52:52 +02:00
Michael Herdt
5c95c4ce28 Provide API for auto assignment check for specific device (#1262)
* Extend the auto assign executor to execute a auto assignment check for a specific device.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* add tests and handle exceptions

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* add unit test

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* add Copyright header

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* fix Copyright header

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* add authorization

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* fix exception handling and authorization

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* renaming

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* Rename auto assignment functions

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

Co-authored-by: Stefan Klotz <stefan.klotz@bosch.io>
2022-07-12 15:47:38 +02:00
Michael Herdt
f0a7c2d07d Improve target management (#1260)
* Fix join type for targets with their assignedDs

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Override saveAll method and make use of it in the JpaTargetManagement

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Use unmodifiable list and flip transactional logic

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Initialize new list instead of an unmodifiable list.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Fix testdata factory

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2022-07-01 13:47:00 +02:00
Bondar Bogdan
f15cc690f0 improved debug logs for autoassignment (#1253)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-05-16 08:53:43 +02:00
Michael Herdt
59932b1d6f Extend event for entity events (#1250)
* Extend event information by it's first interface class and improve constructing the event by providing the directly only.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Check if entity interface is assignable from TenantAwareBaseEntity.

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2022-04-25 15:39:44 +02:00
Bondar Bogdan
527f7de6a8 Fix overdue timestamp calculation permission (#1235)
* fixed overdue timestamp calculation permission error

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* changed method visibility

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-03-25 16:00:18 +01:00
Bondar Bogdan
c9eafbbc26 Optimize UI queries (#1234)
* first iteration of query optimization for target and distribution set
* fixed type distribution set filter
* adapted all ui dataproviders to use repository count
* adapted test to not check target attributes within search query
* unified search behaviuor for ds and sm
* removed unneccessary count queries for some mgmt calls
* removed unneccessary type id proprty from ProxyDistributionSetInfo to minimize lazy fetches
* refactored mgmt classes
* removed duplication of name version filter
* fixed copy rollout compatibility check
* cleaned-up management left overs
* added index to rollouts table on tenant/status queries

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-03-23 09:08:56 +01:00
Natalia Kislicyn
681df6c1f1 Fix installedBase link in DDI base resource (#1232)
* add test for installedBase bug

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix for test scenario I

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add another test scenario for installedbase bug

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* add fix for scenario 2a+b

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2022-02-22 15:09:51 +01:00
Ahmed Sayed
949cd8cd8b Feature/speedup quota tests (#1125)
* reduce the number of created entities in tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* merged master

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* adapted target count

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed RolloutManagementTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>

* fixed flaky test ConcurrentDistributionSetInvalidationTest

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch.io>
2022-02-21 12:58:05 +01:00
Peter Vigier
44a85f20eb Feature/fix sonar warnings (#1226)
* Fixed sonar warnings

- "Cognitive Complexity"
- "Do not use replaceAll when not using a regex"
- java:S5869 - Character classes in regular expressions should not contain the same character twice
- Improved bad name
- Typos
- reduced code duplications
- Replaced hand-made wait-utility with Awaitility
- Log messages
- Duplicate code
- Typos
- Removed Thread.sleep, instead relaxed check condition
- Removed use of deprecated API
- Removed use of deprecated API
- Added supress-warnings as I do not see a better way to write the tests
- Removed Thread.sleep / redundant functionality to Awaitility
- Fixed other warnings (use isZero, isEmpty, hasToString)
- Removed/Reduced duplicate code
- Added generics
- Fixed asserts
- removed: field.setAccessible(true) actually should not be needed for public static fields!
- Too long constructor passes arguments in wrong order - how surprisingly...
- Clean-up use of varargs arguments
- Fixed regex
- Fixed typos and other minor stuff
- Making public constructors protected in abstract classes
- Swapped expected and asserted argument
- volatile not enough for syncing threads
- volatile not enough for syncing threads
- out-commented code
- Made regex not-greedy, added tests for verification
- Avoid exposure of thread-local member var

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixed Sonar warnings

* License header fix

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* License header fix #2

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing review findings

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>

* Fixing tests

- Fixed '&' usage in javadoc and typos
- Fixing some warnings

Signed-off-by: Peter Vigier <Peter.Vigier@bosch.io>
2022-01-31 21:59:46 +01:00
Robert Sing
cc3d36e442 set the JpaControllerManagement constructor public (#1227)
Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2022-01-31 11:36:13 +01:00
Natalia Kislicyn
69e6488004 DDI API: /controller/v1/{controllerid}/installedBase/{actionId} (#1220)
* installedBase DDI: initial impl + rest docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* refactor installedBase implementation

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* ddi installed base tests

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* restructure root controller rest docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix some java docs and formatting

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* don't add action history message when calling /installedBase

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix test after removing action history message

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2022-01-24 18:13:03 +01:00
Stefan Klotz
476d1c37ed Make entity object of event optional (#1209)
* explicitly return an optional entity by an event

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>

* fix assertions in tests

Signed-off-by: Stefan Klotz <stefan.klotz@bosch.io>
2021-12-08 11:28:01 +01:00
Bondar Bogdan
146735012a Artifact Encryption plug point (#1202)
* added ArtifactEncryption interface, injected it into SM creation UI module, added encryption metadata key generation upon SM creation, used encryptor during file upload

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* add default artifact encryption implementation based on gcm aes algorithm

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* changed ArtifactEncryptor interface to manage encryption secrets by itself

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* cleaned up stale code, fixed sonar

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* fixed software module encryption within transaction

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added artifact encryption secrets store

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* extended ArtifactEncryption interface to allow decryption, secrets store provides removeSecret, added missing javadocs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* intriduced DbArtifact interface, use EncryptionAwareDbArtifact for artifact decryption during download

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* introduced ArtifactEncryptionService to minimize duplications and unneccessary dependency injections

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* declared ArtifactEncryptionService as a bean

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added persistant encryption flag to software module

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* further adptations for encryption flag persistence

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added ArtifactEncryptionException, fixed encryption check in UI

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added encryption error handling

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* added encrypted flag to DDI/DMF, adapted exception handling

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* adapted rest docs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* Add test to verify artifact encryption is not given by default

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Add isEncrypted() to toString() of JpaSoftwareModule, fix typos

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Fix sql migration scripts

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* Calculate encrypted artifact size by subtract encryption size overhead

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>

* publish upload failed without waiting for interuption during UI file upload

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

* upgraded cron utils to 9.1.6

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>

Co-authored-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>
2021-11-18 09:07:05 +01:00
Robert Sing
f6c39a3589 fixed compatibility check bug (#1198)
* fixed compatibility check bug & improved testing

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review finding

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* reduced amount of targets in test

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-29 14:15:16 +02:00
Anand Kumar
70779d1ac7 Feature target type filter (#1197)
* Added Target type filter with drag and drop support

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Removed the unused enums and target type filter button class

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Resolved merge conflicts

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed java doc issue with the method link in the comment

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed the IN query overflow for target Type assignment

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>

* Fixed Review comments

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-10-27 15:24:09 +02:00
Robert Sing
dea6fa3ce6 Adapt UI for target type compatibility check (#1189)
* Added compatibility calls needed for UI

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* Adapted UI for target type compatibility checks

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* improved exception handling for incompatibility check

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added & fixed unit tests

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed merged conflicts

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed target type incompatibly specification

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* changed UI behaviour to close assignment popup in case of IncompatibleTargetTypeException

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* added unit test to validate incompatibly specification fix

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* fix potential null pointer

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* Fixed rolloutcopy by adding dsTypeId to ProxyDistributionSetInfo

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>

* suppressed warning

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-22 16:23:25 +02:00
Alexander Dobler
3621015f93 Specification and BaseRepositotyProvider improvements (#1182)
* Introduce custom base repository factory bean

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Simplify ordered DS service call by using specs

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Annotate getBaseRepoType interface as FunctionalInterface

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Use CustomBaseRepositoryFactory instead of static BaseClass

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Fix license headers

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>

* Add ordered specification back

Signed-off-by: Alexander Dobler <alexander.dobler3@bosch.io>
2021-10-21 15:46:13 +02:00
Virginijus Kandrotas
d80d0d6349 Implement target type CRUD UI operations (#1184)
* implement target type CRUD UI operations

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix licenses

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* code clean up

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* code clean up

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* refactor proxy target type

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* refactor proxy target type

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* update class description

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix review comments

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix sonar issue

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* fix showing assigned ds types

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>

* remove unused import

Signed-off-by: Virginijus Kandrotas <Virginijus.Kandrotas@bosch.io>
2021-10-21 15:18:39 +02:00
Natalia Kislicyn
d5661d2fe2 Support keywords in queries (#1193)
* support targettype as keyword in target-queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* support valid as keyword in distributionset-queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* remove targettype.id from filter queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* remove targettype.description from filter queries

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-20 13:13:24 +02:00
Markus Block
be3dfbf617 Ensure a '.' character is allowed to be used in target filter query for metadata key and attribute name (#1186)
* Adapted code to allow '.' inside of metadata key and attribute names


Signed-off-by: Markus Block <markus.block@bosch-si.com>

* added handling of corner cases

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Adapted metadata and attribute tests to check that dot is allowed

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed documentation

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* Allow usage of dot in key names for every map attribute, e.g. also for
metadata in distribution set

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed typo

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* adapted test key to ensure a dot can be used

Signed-off-by: Markus Block <markus.block@bosch-si.com>

* fixed typo

Signed-off-by: Markus Block <markus.block@bosch-si.com>
2021-10-18 10:51:04 +02:00
Natalia Kislicyn
745a0c6a10 Docu for target type endpoints in Target API (#1185)
* add assign/unassign type endpoints to target api docs

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix target type creation for api rest docs test

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* fix review comments: rename tests

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>

* adapt test to avoid failing when translated

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-15 16:22:20 +02:00