Commit Graph

44 Commits

Author SHA1 Message Date
Avgustin Marinov
9c86729a68 [#1393,#1008] Switch to Eclipse v2.0 license (#1427)
Switching license from EPL v1 to v2. Following
https://www.eclipse.org/legal/epl-2.0/faq.php#h.tci84nlsqpgw

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-09-14 11:03:20 +03:00
Avgustin Marinov
acff82f60f Small security improvements (#1412)
Typos fixed

Disables empty string gateway token for sure. Test if the gateway token is not empty string ecplicitly.
Empty string is the default value and if accepted could be a security vulnerability (e.g. enabling gateway token
authentication and using empty string as token). According to https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4
the header value shall not have trailing spaces and the http server shall already have trimmed them. So if execution passes
start with "GatewayToken " then token shall not be empty. But but let's check anyway

In UI first set key then enable the gateway token authentication. Otherwise the key might be left empty (default). This however
shall not be really problem since (because of token trimming) the empty token will be rejected anyway.

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-08-16 14:25:17 +03:00
Stanislav Trailov
f0db69473c Enforce decoding in authentication check (#1362)
* Enforce decoding in authentication check
+Enforce decoding of controllerId when authentication is performed for the reverse proxy use case
* Remove unused imports

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Switch approach to decode retrieved values from map

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Remove unused imports

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Style improve

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Move logic to separate class

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Remove TODO comment

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

* Hide public constructor in Util class

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>

---------

Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>
2023-06-01 09:11:39 +02: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
Florian Ruschbaschan
41922b6dca Feature/remove junit5 leftovers (#1097)
* Migrate JUnit4 leftovers to JUnit5

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

* Fix method name typos

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

* Avoid unnecessary Mockito stubbings

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

* Replace assertThrows by assertThatExceptionOfType, fix test TODO

Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>
2021-03-22 10:37:31 +01: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
Dominic Schabel
9c5360e59d JUnit5 support (#1063)
* First preparation for JUnit5

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

* Exclusion of JUnit5 removed

Signed-off-by: Dominic Schabel <dominic.schabel@bosch.io>
2021-02-12 08:22:26 +01:00
Ammar Bikic
165f6e0435 Change to proper versioning
Signed-off-by: Ammar Bikic <ammar.bikic@bosch.io>
2020-11-03 09:59:21 +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
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
ac931ec8fa Master now on 0.3 2018-06-11 15:57:15 +02: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
66feae2756 DosFilter can be disabled. (#561)
* DosFilter can be disabled.

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

* Moved filters our of security core.

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

* Move caffeine dependency.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2017-07-13 12:52:00 +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
92dd6a1a0e Modular hawkBit (#378)
* Cleaned up component scan
* More flexibility for hawkBit micro services
* Introduce spring boot starters
* Eclipse Jetty as hawkBit default
* Fixed links as prep for wiki removal

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-12-13 12:29:21 +01:00
Dennis Melzer
866bc72114 Feature horizontal scalability (#305)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-11-03 15:53:53 +01: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
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)
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
Kai Zimmermann
2f415c4839 Merge pull request #274 from bsinno/fix_dialog_window_must_not_close_after_save_if_duplicate_exists
Fix for the dialog window must not close after save if duplicate exists.
2016-09-01 11:37:58 +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
kaizimmerm
ff500d3bd7 Started migration for Boot 1.3 and Security 4.1
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
2016-08-24 09:38:53 +02:00
Michael Hirsch
f3b472bcd2 Merge branch 'master' into Feature_Improve_Code_Quality
Conflicts:
	hawkbit-core/src/main/java/org/eclipse/hawkbit/api/ArtifactUrlHandlerProperties.java
	hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerService.java
	hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageHandlerServiceTest.java
	hawkbit-repository/src/main/java/org/eclipse/hawkbit/eventbus/CacheFieldEntityListener.java
	hawkbit-security-core/src/main/java/org/eclipse/hawkbit/security/SystemSecurityContext.java
	hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/artifacts/details/ArtifactBeanQuery.java


Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-07-25 10:08:24 +02:00
Kai Zimmermann
13f9791891 Removed JPA dependencies from runtime. Test only now.
Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
2016-05-31 20:50:22 +02:00
Kai Zimmermann
f2e13b8d22 Split into separate maven modules.
Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
2016-05-25 17:43:57 +02:00
SirWayne
79d604ca0b Some clean code refactorings
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
2016-05-19 17:28:45 +02:00
Michael Hirsch
df1d4c5a20 Merge branch 'master' into
Download_server_supports_download_through_HTTP_and_HTTPs

Conflicts:
	hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationKey.java


Signed-off-by: Michael Hirsch <michael.hirsch@bosch-si.com>
2016-04-05 11:58:27 +02:00
Kai Zimmermann
7d3d4f1fd4 Fixed broken test. 2016-03-29 15:37:07 +02:00
Kai Zimmermann
f33a8c37e8 Corrected expected exception checks in tests 2016-03-29 13:43:18 +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
a4cc3df092 Fix test properties
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
2016-03-09 15:36:59 +01:00
SirWayne
ed97031faf Merge branch 'master' into
feature_MECS-86_tenant_specific_polling_configuration

Conflicts:
	hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java
	hawkbit-core/src/main/java/org/eclipse/hawkbit/tenancy/configuration/TenantConfigurationKey.java
	hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentfication.java
	hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpControllerAuthentficationTest.java
	hawkbit-repository/src/test/resources/application-test.properties


Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
2016-03-09 13:29:40 +01:00
Nonnenmacher Fabian (INST-ICM/BSV-AS)
9646e1eabc Fixed review findings 2016-03-04 12:34:39 +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
Kai Zimmermann
204fe1fd18 Created TODOs for missing descriptions 2016-02-23 20:53:21 +01:00
Kai Zimmermann
7f2a9d1ed2 Features harmonised, more test descriptions 2016-02-23 09:57:18 +01:00
Kai Zimmermann
b1f753b291 Upgrade to 0.2 release train
0.2. development starts in parallel to the preparation for first
eclipse release 0.1
2016-01-26 11:34:39 +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