Commit Graph

42 Commits

Author SHA1 Message Date
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
Stefan Behl
cf67467fb5 Execute rollouts and auto assignments in the correct user context (#1100)
* Execute rollouts and auto assignments in correct user context

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

* Fix PR review findings

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

* Cleanup usage of lenient

Signed-off-by: Stefan Behl <stefan.behl@bosch.io>
2021-04-15 12:23:14 +02:00
Dominic Schabel
81defa10a6 Migration to JUnit5 as default test runtime (#1082)
* Migrate tests to JUnit5

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

* REST docs tests migrated to JUnit5

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

* Migrated security and UI tests to JUnit5

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

* Migrated management tests to JUnit5

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

* Reflecting changes from JUnit5 migration

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

* Fix RabbitMQ test detection

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

* Drop support for JUnit4

Signed-off-by: Dominic Schabel <dominic.schabel@bosch.io>
2021-03-15 13:40:40 +01:00
Ammar Bikic
28b65a290d Update Spring Boot to 2.3.2
-Update Spring Cloud to Hoxton.SR7
-Replace ResourceSupport by RepresentationModel (Spring Hateoas 1.0)
-Replace ControllerLinkBuilder by WebMvcLinkBuilder (Spring Hateoas 1.0)
-Move getId() from Identifiable to BaseEntity (Spring Hateoas 1.0)
-Remove hamcrest.Factory
-Use static Sort.by reference
-Place http security anyRequest().authenticated()
-Replace MockMvcRequestBuilders.fileUpload by MockMvcRequestBuilders.multipart
-Deprecate MEDIA_TYPE_CBOR_UTF8
-Replace MEDIA_TYPE_CBOR_UTF8 by MEDIA_TYPE_CBOR in tests
-Replace HAL_JSON_UTF8 by HAL_JSON in tests
-Replace APPLICATION_JSON_UTF8 by APPLICATION_JSON in tests
-Use org.mockito.junit.MockitoJUnitRunner
-Remove overridden dependency versions
-Removing not needed comments in pom.xml
-Downgrade flyway-core to be MySQL 5.6 compatible
-Add maven-site-plugin since it was removed with spring-boot 2.3
-Set servlet encoding properties
-Introducing Test that verifies the charset inside the content-type of a response
-Add @DirtiesContext to CorsTest and ContentTypeTest
-Add content-type mockmvc test with adapted mockmvc config
-Move encoding.force property to test class
-Switch expected and actual parameter values in content-type test
-Delete deprecated content-type test with TestRestTemplate
-Exclude JUnit5 from spring-boot-starter-test
-Upgrade allure-junit4 to 2.13.5
-Add aspectjweaver 1.9.6 to surefire test execution
-Add flyway-core version to property
-Use getRequiredLink() within MgmtBaseEntity.getId()

Signed-off-by: Ammar Bikic <ammar.bikic@bosch.io>
2020-10-02 18:11:18 +02:00
Nazife Basbaz
fde0cbdf16 fix bug: change sql-query in localArtifactRepository (#820)
Also-by: Nazife Basbaz <nazife.basbaz@bosch-si.com>
Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>
2019-06-05 16:07:07 +02:00
Dominic Schabel
c88e7bb06e Sonar issues fixed
Signed-off-by: Dominic Schabel <dominic.schabel@bosch-si.com>
2019-05-23 19:48:34 +02:00
Kai Zimmermann
f9a7194fd5 Fix JavaDoc syntax errors. Add check to circle build. (#791)
* Fix JavaDoc syntax errors. Add check to circle build.

* One more code error

* Added missing tags.
2019-02-01 10:31:40 +01:00
Kai Zimmermann
d52a720480 Spring Boot 2.0 (#721)
* Migration to Boot 2.0.

Signed-off-by: Kai Zimmermann <kai.zimmermann@microsoft.com>
2019-01-31 07:29:27 +01:00
Stefan Klotz
d09ca7be05 Migrate to Allure 2 (#749)
Add allure 2.7.0 dependency; change class references of Description, Features, Stories

Signed-off-by: Stefan Klotz <stefan.klotz@bosch-si.com>
2018-10-25 18:18:37 +02:00
Kai Zimmermann
428e3af2bc hawkBit rest docs (management & DDI API) (#688)
* hawkBit REST docs.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fiy gitignore.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Add to website.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Switch to generated docs.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix typos.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Review findings.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Otimizations.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Revert accidental checkin.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Add security link.
2018-05-24 16:10:01 +02:00
Kai Zimmermann
8d644aa35d Fix missing lower case in header based auth. (#628)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2018-02-06 10:58:31 +01:00
Kai Zimmermann
61c862d296 Security header filter support additional separator and is case (#625)
insensitive.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2018-02-05 11:59:20 +01:00
Kai Zimmermann
5d774dc70a Anonymous download activated does not result in general DDI anonymous (#616)
* Fix unintended anonymous access in DDI API.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix test.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix ant matcher.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-12-19 17:53:17 +01:00
Kai Zimmermann
5a6fc37a15 Remove DMF API dependency from security integration (#604)
* Dmf security token out of API.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Allow to override dispatching routines.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* TargetAssign event is bulk ready.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Completed Javadoc.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* readibility and fix serialization bug.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix sonar issue.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Simplify artifact management usage.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-12-07 15:55:09 +01:00
Kai Zimmermann
edae83a1b5 Complete repository refactoring - method renaming (#575)
* Split Tag management

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Repo method naming schame applied.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* findAll returns slice instead of page.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Complete javadoc.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Allow null values again.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Readability improvements.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Forgot a method.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fixed broken completed filter.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-09-22 08:22:41 +02:00
Kai Zimmermann
67a4677ef6 Split repository API for module and DS management. Refactor utility usage (#524)
* Split DS management and reduce util usage.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Split sw module and type management.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Sonar issues.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Make sonar listen to the exception!

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Register both beans.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Split JPA implementations.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Revert user details change.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix compilation errors.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix bean queries. Fix image path.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Document preferred utility usage.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix exmaples and revert unintended checkin.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Code cleanup.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Typos, readibility.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Remove unused reference.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Rollouts cache delete aware.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix rolloutgroup delete event.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Add new RolloutGroupDeletedEvent event

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-06-01 06:28:59 +02:00
kaizimmerm
806491d9b5 Rename DMF model classes to avoid name clashes with the repository.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-05-16 16:57:07 +02:00
Kai Zimmermann
804522f966 hawkBit repository uses Optional on single entity find/get requests (#435)
* Repo returns optionals.
* Improved exception handling for collection usage in repo queries.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-02-16 10:09:14 +01:00
Kai Zimmermann
feb3369858 Custom Tenant configuration. (#395)
* Tenant configuration configurable.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-12-23 07:19:46 +01:00
kaizimmerm
43511ed63e Fixed test.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-10-13 09:17:24 +02:00
Kai Zimmermann
c4faf4b5af Merge pull request #297 from bsinno/feature_multi_known_hashes_for_issuer_hash_based_auth
Feature multi known hashes for issuer hash based auth
2016-10-13 06:09:21 +02:00
Dominik Herbst
05cebdba54 Used HeaderAuthentication for getPreAuthenticatedPrincipal. Improved test
quality.

Signed-off-by: Dominik Herbst <dominik.herbst@bosch-si.com>
2016-10-12 15:43:39 +02:00
Dominik Herbst
97ab881d6e Code improvements
Signed-off-by: Dominik Herbst <dominik.herbst@bosch-si.com>
2016-10-05 12:46:21 +02:00
Kai Zimmermann
5c53bef164 Configurable download URL generation (#296)
Configurable download URL generation.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-09-28 09:18:03 +02:00
Marcel Mager (INST-IOT/ESB)
7176f93ca4 Fix code smells.
Signed-off-by: Marcel Mager (INST-IOT/ESB) <Marcel.Mager@bosch-si.com>
2016-09-23 10:11:36 +02:00
Marcel Mager (INST-IOT/ESB)
54c4c8c481 Review fixes of code quality.
Signed-off-by: Marcel Mager (INST-IOT/ESB) <Marcel.Mager@bosch-si.com>
2016-09-22 16:02:27 +02:00
Marcel Mager (INST-IOT/ESB)
a0c5915ce6 Reduce cyclomatic complexity by extracting method
Signed-off-by: Marcel Mager (INST-IOT/ESB) <Marcel.Mager@bosch-si.com>
2016-09-22 14:22:01 +02:00
Marcel Mager (INST-IOT/ESB)
5215580cd7 Fix code review findings:
* adapt return type of #getPreAuthenticatedPrincipal to the
#getPreAuthenticatedCredentials return type (both Object)
* #splitMultiHash returns list instead of array

Signed-off-by: Marcel Mager (INST-IOT/ESB) <Marcel.Mager@bosch-si.com>
2016-09-22 14:21:59 +02:00
Marcel Mager (INST-IOT/ESB)
0ccd458585 Add support for multiple hashes in Issuer hash based authentication
Signed-off-by: Marcel Mager (INST-IOT/ESB) <Marcel.Mager@bosch-si.com>
2016-09-22 14:21:55 +02:00
Melanie Retter
4d47a86285 Fix typo
Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
2016-08-24 14:26:46 +02:00
Michael Hirsch
68a87490c6 Merge pull request #170 from bsinno/fix_remove_special_coap_auth_token
remove special coap-auth-token filter for coap-downloads
2016-05-11 14:09:18 +02:00
Kai Zimmermann
2c5969b080 Fixed a few spellings 2016-05-02 18:07:23 +02:00
Michael Hirsch
9be6aa6e18 remove special coap-auth-token filter for coap-downloads
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-04-28 14:12:07 +02:00
Michael Hirsch
e033e8718c unit tests for ControllerPreAuthenticatedAnonymousDownloadTest
Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-03-29 11:12:42 +02:00
Michael Hirsch
1cb7519ace add security and filters for anonymous download via http and amqp
requests

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-03-23 16:17:53 +01:00
Michael Hirsch
cdac7185c4 fix typo of class TenantSecurityToken and handle authentication message
based on FileResource not only on SHA1 hash

Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-03-23 10:23:35 +01:00
SirWayne
6d12e62d58 Fix missing run as secruity context for header filter
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
2016-03-15 10:02:48 +01:00
Fabian Nonnenmacher
2be4922615 Added System Security Context as attribute to AbstractControllerAuthenticationFilter
This is necessary, because the tenant configuration methods are only accessable with specific permissions.
With the SystemSecurityContext methods can be executed as SystemRunner and therefor we can set permissions.

* updated the chaine of condtructors to set the context in the filter class
* added SystemRunner permission to TenantConfigurationManagement
* Autowired the system context to AMQP and HTTP controller

Signed-off-by: Nonnenmacher Fabian <fabian.nonnenmacher@bosch-si.com>
2016-02-29 13:18:58 +01:00
Fabian Nonnenmacher
6cef6aed1a Moved tenant configuration functions to new management class
- moved fucntions to TenantConfigurationManagement, for better function capseling
- updated references
- updated references in tests, tests were succesfully

Signed-off-by: Nonnenmacher Fabian <fabian.nonnenmacher@bosch-si.com>
2016-02-29 13:15:40 +01:00
Fabian Nonnenmacher
07fce42469 Changed return type of SystemManagement.getConfigurationValue()
* changed Return type to wrapper object, adding additional meta data stored in the database
* updated all calls of this method
* updated function calls in tests
* verified correct execution of correspending tests

Signed-off-by: Nonnenmacher Fabian <fabian.nonnenmacher@bosch-si.com>
2016-02-29 13:15:03 +01:00
Kai Zimmermann
64deaeea3c Remove swagger and minor feature extensions and bug fixes
- Various Bug fixes and improvements
- Management API extended
- Swagger removed
- Guava Upgraded to 19
2016-01-21 13:42:38 +01:00
Kai Zimmermann
7497ab61ed Initial check in accordance with Parallel IP 2016-01-21 13:18:55 +01:00