Commit Graph

171 Commits

Author SHA1 Message Date
Avgustin Marinov
1be473b22c [#2845] Bump Spring boot to 4.x (#2941)
Notes:
1. (!) Eclipselink shall be migrated to 5.0 (in 4.0.8 there are incompatible classes, e.g EJBQueryImpl doesn't implement some newer methods). In the moment is with beta (5.0.0-B12) - JUST for testing!
2. (!) Ethlo plugin doesn't work with Eclipselink 5.0, it builds with Eclipselink 4.0.8 (could be a problem)
3. Dependencies - new starters, test starters changes, some dependencies refactoring
4. Auto-configs split - package changes, some properties classes changes
5. Spring nullable org.springframework.lang.Nullable/NonNull are depecated and replaced with jspcify -> org.jspecify.annotations.Nullable/NonNull (NullMarked)
6. Lombok config - adding lombok.addNullAnnotations=jspecify - to do not mess annotations
7. Distributed lock table changes - SP_LOCK table db migration
8. Spring Retry replaced with Spring Core Retry - does repace retry in hawkbit
9. Specifications -> added Update/Delete(/Predicate) Specifications and JpaSpecificationExecutor changed
10. HawkbitBaseRepositoryFactoryBean modified to register properly
11. Jackson - 2 -> 3, package migrations, finals are not deserialized by default(enable finals deserialization, consider make non-final), too ‘smart’ tries to set complex objects instead of using non args constructor (-> @JsonIgnore), some other default configs made

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2026-04-14 11:31:41 +03:00
Stanislav Trailov
ba3a08e560 Add Target Poll Event in Service Events (#2981)
* Add Target Poll Event in Service Events

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

* Target poll event to service event

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

---------

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
2026-03-27 10:18:37 +02:00
Avgustin Marinov
62c76311e5 Fix some compile warnings (#2919)
* Fix some compile warnings
* Some classes made final
* JPA entities made not serializable

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2026-02-11 14:05:46 +02:00
Stanislav Trailov
c33156b134 Multi-Asssignments feature removal (#2893)
* Multi-Asssignments feature removal

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

* fix some sonar findings

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

* fixes after review

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

---------

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
2026-02-04 16:59:09 +02:00
Avgustin Marinov
d55f1ffa10 Refactor @ApiResponses annotations (#2879)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2026-01-22 09:10:10 +02:00
Avgustin Marinov
6988f5eafb Fix nop cache using (especially for testing) (#2841)
+ fix flaky tests that requires no caches

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-12-01 13:53:08 +02:00
Avgustin Marinov
42384b7e31 Add AccessContext.asTenant and use where possible (#2838)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-11-27 16:27:56 +02:00
Avgustin Marinov
f6f62db0ad Refactor hawkbit core and security (#2833)
* Refactor hawkbit core and security

* improve access to the base core features - static
* thus easiear access
* and less boilerplate passing of instances

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Refactor context classes

* make JSON context serialization default

* AccessContext

* Split hawkbit-security-core to other modules and remove it

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-11-27 13:07:49 +02:00
Avgustin Marinov
20bb41c51c Move rollout executor related target management methods in executor (#2812)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-11-18 08:44:35 +02:00
Avgustin Marinov
7e4cc45315 Refactor maven modules (#2806)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-11-13 17:24:27 +02:00
Avgustin Marinov
d488ad6b5f Refactor caches (#2775) (#2777)
* TenantAwareCacheManager define CacheEvictEvent which could be used to evict entities in general way
* JpaTenantConfigurationManagement start using genera cache approach

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-28 14:13:53 +02:00
Avgustin Marinov
64bdced682 Tune/fix action cleanup tenant properties (#2782)
* actions.cleanup.onQuotaHit.percent -> action.cleanup.onQuotaHit.percent
* action.cleanup.enabled - removed - instead enabled / disable <=> expire < / >= 0
* action.cleanup.actionExpiry -> action.cleanup.auto.expiry and action.cleanup.auto.status - so both are under action.cleanup.auto, and differentiate from on quota hit
* auto db convert of props with one backward incompatibility - if you had action.cleanup.enabled=true and not set action.cleanup.actionExpiry (assuming default 30 days) - auto cleanup will be disabled
  you should set action.cleanup.auto.expiry=2592000000 in order to get the old behavior
* Note that if you have configured global action cleanup the properties are changed also this config you shall change manually

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-28 12:40:37 +02:00
Avgustin Marinov
98daa696de Refactor caches (#2775)
* added static usage of cache in order access it easier
* added mandatory (in hawkbit-core) registration - always tenant aware caches shall be used - hawkbit depends on it
* added per cache and tenant name configuration
* (not really realted to caches) but in order to be easier evicted entities after commit handlers are now statically accessed

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-24 16:42:40 +03:00
Stanislav Trailov
f1c3d0175e Action history cleanup/purge initial (#2728)
* Action history cleanup/purge initial

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

* apply changes after review

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

* fix hibernate build by annotating delete methods with transactional annotation

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

* changes after review and new test cases for new requirements

* accept 0 for keep last

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

* Fix ManagementSecurityTest

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

* apply object utils check

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

* fix for oldestAction deletion

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

* remove unused comment

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

* rename action ids variable

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

* Fix access control handling

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

---------

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
Co-authored-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-21 10:34:58 +03:00
Avgustin Marinov
b10955f3eb Remove System Management REST (#2761)
* the only non repository module using @PreAuthorize
* the only service for "sys admins" - it's a little bit out of scopes
* caches management is not supposed to be via REST
* delete tenant shall not be provided when we don't have create
* metrics shall be reported via metrics colectins services, or db

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-10-17 10:45:11 +03:00
Avgustin Marinov
a2929757d8 Encapsulate time overdue into VirtualPropertyResolver (#2704)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-29 13:14:40 +03:00
Avgustin Marinov
1919af4a9d Remove VirtualPropertyReplacer (#2701)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-26 17:17:38 +03:00
Avgustin Marinov
c20ee8bdf3 Fix fine-grained permissions config (#2688)
* disabled by default
* evaluaton context considers fine-grained only when acm is enabled

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-24 09:40:27 +03:00
Vasil Ilchev
20768a550c Sync property naming convention (#2664)
Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-09-10 14:55:51 +03:00
Avgustin Marinov
2d45e2a76c Fix Json serializer defaults (#2663)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-10 10:56:19 +03:00
Avgustin Marinov
ae3a004da0 Finalize and polish fine-grained permission (#2660)
* Remove _REPOSITORY_ permissions -> replaced with _SOFTWARE_MODULE_, _SOFTWARE_MODULE_TYPE_, _DISTRIBUTION_SET_, _DISTRIBUTION_SET_TYPE_ permissions
* Still kept _ROLE_REPOSITORY_ADMIN_ role granting all repository fine-graned permissions
* Added dedicated _TARGET_TYPE_ permission set - the _TARGET_ permissions just grant _READ_TARGET_TYPE_ (analogically _SOFTWARE_MODULE_ permissions grant _READ_SOFTWARE_MODULE_TYPE_ and _DISTRIBUTION_SET_ grants _READ_DISTRIBUTON_SET_TYPE_
* Hierarcy is not configurable - could be completely replaced by setting spring application property org.eclipse.hawkbit.hierarchy or could be extended by adding rules using org.eclipse.hawkbit.hierarchy.ext

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-09-09 15:42:11 +03:00
Avgustin Marinov
2a636328a0 20250828 cleanup (#2639)
* Cleanup

* Refactor artifact management
2025-09-02 16:08:14 +03:00
Avgustin Marinov
441b78460d Improve Permission Management (#2604)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-12 14:09:27 +03:00
Avgustin Marinov
124fef189e Remove Rollout(Group) builders (#2603)
* Fix entityManager.merge for ds and sm

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Remove Rollout(Group) builders

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Remove EntityFactory

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-11 14:01:03 +03:00
Avgustin Marinov
c038c507a9 TargetManagement over RepositoryManagement (#2599)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-07 17:20:22 +03:00
Vasil Ilchev
a55d5cd517 Fix class cast exception when deserielize getRemoteEvent() by any ServiceEvent (#2593)
Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-08-06 09:46:19 +03:00
Vasil Ilchev
1a4df60c59 Introducing TargetUpdatedServiceEvent, ActionCreatedServiceEvent, Act… (#2588)
* Introducing TargetUpdatedServiceEvent, ActionCreatedServiceEvent, ActionUpdatedServiceEvent

* Fix ActionServiceEvents with payload annotation and add ActionEvents and ActionService tests to message converters

* Adapted EventVerifier to expect new ServiceEvents

---------

Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-08-05 10:16:08 +03:00
Avgustin Marinov
7b24981a1d Implement TargetFilterQueryManagement with AbstractJpaRepositoryManagement (#2587)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-05 09:53:24 +03:00
Vasil Ilchev
1d4e0e9959 Fix Protostuff message converter (#2583)
Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-08-04 10:09:20 +03:00
Avgustin Marinov
a689733d4c TargetType management over common RepositoryManagement (#2581)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-01 19:24:49 +03:00
Vasil Ilchev
c79e35b9de Fix not overriding cloud stream properties (#2582)
Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-08-01 18:15:56 +03:00
Avgustin Marinov
fd9c0fc50d Implement target tag management using common RepositoryManagement (and abstract JPA impl) (#2580)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-01 13:41:20 +03:00
Avgustin Marinov
5d75c9b0cc Absract metatype impl (#2575)
* Add common "interface" for metadata supporting entities
* Add common metadata implementation for distribution set and software module
* Extract PermissionSupport + extend by TargetManagement
* TargetManagement tags are now protected by Target permissions - as it should be

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-08-01 12:41:53 +03:00
Vasil Ilchev
cca105c80e Move EventPublisher to hawkbit-repository-core making hawkbit-reposit… (#2576)
* Move EventPublisher to hawkbit-repository-core making hawkbit-repository-api non dependent to rabbit binders

* Move EventPublisherHolder to org.eclipse.hawkbit.repository.event

* Fix overriding default values of RemoteEvents and rabbit binder

---------

Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-08-01 08:48:07 +03:00
Avgustin Marinov
08cacf9034 Soft Module metadata as complex map value (#2568)
---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-30 17:29:02 +03:00
Vasil Ilchev
4a8e60764f Remote Events migrated from Spring Bus to Spring Cloud Stream (#2563)
* Remote Events migrated from Spring Bus to Spring Cloud Stream

---------

Co-authored-by: vasilchev <vasil.ilchev@bosch.com>
2025-07-30 16:58:00 +03:00
Avgustin Marinov
2b66449ff1 Fine grained repository permissions (#2562)
1. Introduce @PrreAuthorize check based on hasPermission - allowing custom processing (compared with non-modifiable hasAuthority/Role processing)
2. Dedicated permissions could be implemented on management api level. Check is made by plugged in PermissionEvaluator
3. Thus common XXX_REPOSITORY permissions could differ for extending services
4. Change create/update entity builder pattern - not via EntityFactory but via clean static lombok based builders (with fine fluent api).
5. Implement abstract repository management jpa class that handles the boilerplate code from extending classes in single place consistently -> AbsreactJpaRepositoryManagement
6. Register management api-s as **Sevice**-s instead of **Bean**-s in order to make easier maintainable and get away from heavy argument forwading
7. Simplify custom hawkbit repository registration + adding proxy to handle exception mapping at lower level - thus not depending on Aspects for converting exceptions
8. Implemented general purpose 'copy' utility (ObjectCopyUtil) that using getter/setter patterns is able to copy (e.g. Create/Update) objects to other objects (e.g. JPA entity objects)
2025-07-28 14:57:33 +03:00
Stanislav Trailov
b4793fcce1 Introduce target grouping (#2538)
* Introduce target grouping

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

* minor refactor

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

* throw validation exception instead direct returning bad request response

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

* fix group query parameter

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

* remove wrongly added import

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

* add review fixes

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

* apply latest review changes

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

* apply latest changes after sybnc/review

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

* fix after review

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

---------

Signed-off-by: strailov <Stanislav.Trailov@bosch.io>
2025-07-14 15:48:37 +03:00
Avgustin Marinov
e7373275bf Add distribution set and target type fine grained permissions (#2545)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-14 14:52:36 +03:00
Avgustin Marinov
21581c4ea4 Fine-grained permissions (#2535)
* Fine-grained permissions

Adds support for permissions of type <permission>(/<rsql filter scope>)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Apply review fixes

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-10 13:51:49 +03:00
Avgustin Marinov
7f97d6f441 Add support for pollingTime overrides (#2533)
* Add support for pollingTime overrides

* the current format HH:mm:ss is still supported
* add option for deviation percent (HH:mm:ss~\d{1,2}%) which allows the system to do some randomizing of the poll interval
* add support for overriding default polling time interval for devices matching some RSQL filters (in order), e.g. 01:00:00~10%, group == 'eu' -> 00:02:00~15%, status != in_sync -> 00:05:00
* IMPORTANT: overdue time is calculated according to the default polling time. So, the overdue status might be incorrect for targets with overridden poll interval

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Remove min polling time from the tenant config - it is a system configuration

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Add support for bigger poll intervals and overdue + duration format config support

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-07 16:33:55 +03:00
Avgustin Marinov
426bdbf179 Move Query Language (RSQL) in separate package and add Entity Matcher (#2531)
* Move Query Language (RSQL) in separate package - hawkbit-repository-ql
* Add Entity Matcher which match an entity object agains filter
* Spec to string utils now in runtime (as a library) - could be used in tests or to dump something in runtimes
* Move eclipselink/hibernate profiles in new QL module, this way provided / set to hawkbit-repository-jpa
* Remove unused javax.el imports
2025-07-03 14:41:55 +03:00
Avgustin Marinov
affae1026a Improve Spring Bus usage (remove stream direct use) (#2521)
* Improve Spring Bus usage (remove stream direct use)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* Remove getApplicaton when creating remote events

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-07-02 08:32:55 +03:00
Avgustin Marinov
cd2c68081f Refactor RabbitMQ configuration (#2519)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-06-30 15:50:30 +03:00
Avgustin Marinov
ef25aa59f0 Fix new line after @Test (#2486)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-06-20 17:42:55 +03:00
Avgustin Marinov
cb7f1107fe Remove allure (phase2) (#2483)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-06-20 15:51:06 +03:00
Avgustin Marinov
12140e468d [#2176] RSQL filtering with exist/not-exist support (#2396)
* [#2176] RSQL filtering with exist/not-exist support

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>

* [#2176] Big Refactoring

* RSQL: all maps with joins with on

---------

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-05-16 16:13:04 +03:00
Avgustin Marinov
ea8fa4e1bd Small code style refactoring (#2302)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-02-25 17:22:23 +02:00
Avgustin Marinov
54a53a3631 Remove anonymous download (#2291)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-02-19 14:28:15 +02:00
Avgustin Marinov
46caed139d Remove unused group repo methods (#2263)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2025-02-04 17:21:04 +02:00