Commit Graph

178 Commits

Author SHA1 Message Date
Avgustin Marinov
af50e8c938 Fix portable event on setting confirmation status (#2146)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-12 12:37:03 +02:00
Avgustin Marinov
68c0b616b7 Remove unused TargetManagement#findByFilterOrderByLinkedDistributionSet (#2138)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-11 10:04:56 +02:00
Avgustin Marinov
9de1bd2ae6 Optimise rollout create - single save + groups saveAll (#2126)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-06 16:57:46 +02:00
Avgustin Marinov
2a476d1268 Small JPA improvements & test code style (#2122)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-06 13:03:48 +02:00
Avgustin Marinov
39861e7790 Refactor action repository (#2118)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-05 11:41:41 +02:00
Avgustin Marinov
74616db431 Small refactoring (#2115)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-03 13:25:44 +02:00
Avgustin Marinov
a9f3d1491a JPA Refactoring (3) (#2109)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-02 13:50:06 +02:00
Avgustin Marinov
794f26bea2 JPA Refactoring (2) (#2108)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-12-02 11:52:30 +02:00
Avgustin Marinov
2a95adc562 JPA Refactoring (#2107)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-29 14:07:37 +02:00
Avgustin Marinov
d435c0a424 Switch (mostly) to JPA generic events (#2104)
instead of EclipseLink specific

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-26 12:59:45 +02:00
Avgustin Marinov
b664fd7838 Add MySQL flyway support for repository tests (#2090)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-21 08:47:20 +02:00
Avgustin Marinov
a3468b2ba9 Fix some issues found by qodana (#2083)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-19 17:04:19 +02:00
Avgustin Marinov
9c8c82fd8b Switch from deprecated EnableGlobalMethodSecurity to EnableMethodSecurity (#2081)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-19 16:46:31 +02:00
Avgustin Marinov
c3bcc4371d Code formating and removing unused imports (#2072)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-18 09:13:58 +02:00
Avgustin Marinov
f9bb48d697 Code refactoring of hawkbit-repository (#2056)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-17 15:03:03 +02:00
Avgustin Marinov
f62f9fa97b Move Flyway into separate artifact (#2025)
Now it is not part of the ddi and dmf starters - only mgmt (where could be excluded on packaging)

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-14 11:51:23 +02:00
Avgustin Marinov
7902b89268 Unify artifact names (#2021)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-12 15:09:03 +02:00
Avgustin Marinov
3605f3ff95 Fix SecurityContextSwtich - make WithUser impl Serializable (#1993)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-09 22:34:51 +02:00
Avgustin Marinov
4c8156287f Fix SecurityContextSwtich - add better comment (#1992)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-09 22:01:49 +02:00
Avgustin Marinov
6c4d84def4 Fix SecurityContextSwtich - transient anotation remove (#1991)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-09 21:40:20 +02:00
Avgustin Marinov
bb8095e84a Fix sonar findings: optional rest params boolean -> Boolean (#1990)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-09 20:43:21 +02:00
Avgustin Marinov
e886dda9e6 Fix sonar findings: dupplications (#1989)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-09 20:31:11 +02:00
Avgustin Marinov
fe8fb3a602 Move ControllerPollProperties -> org.eclipse.hawkbit.tenancy.configuration (#1981)
_release_notes_

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 17:52:48 +02:00
Avgustin Marinov
56ff8168f9 Rename org.eclipse.hawkbit.api -> org.eclipse.hawkbit.artifact.repository.urlhandler (#1980)
_release_notes_

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 17:40:27 +02:00
Avgustin Marinov
6dec398cb9 Remove unusied org.eclipse.hawkbit.HawkbitServerProperties (#1979)
_release_notes_

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 17:18:59 +02:00
Avgustin Marinov
6867b8eac0 Move spring-boot-starter-test and alure to root (#1973)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 16:25:19 +02:00
Avgustin Marinov
3effa996dd Refactor tenancy classes (#1972)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 16:12:18 +02:00
Avgustin Marinov
ade5723c8c Remove unused TenantUserPasswordAuthenticationToken (#1966)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
2024-11-08 12:29:19 +02:00
Avgustin Marinov
4987d429c2 Code format hawkbit-repository-test (#1931)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-11-05 10:11:19 +02:00
Avgustin Marinov
897c49602c Remove deprecated toggle ds tag assigment from where possible (#1888)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-10-17 10:21:11 +03:00
Avgustin Marinov
8d78cea9d2 Web env none in tests where not needed (#1871)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-10-04 16:51:10 +03:00
Avgustin Marinov
4bc082599b Fix RoleHierarchyImpl deprecation (#1849)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-10-01 10:32:03 +03:00
Avgustin Marinov
d958d8e82c Remove download by downloadId functionality (#1820)
This functionallity seems to get via AMQP (after some authentication)
a private (wihtout need of authentication) url to an artifact assigned
to the controller.

By default, DDI or DMF shall provide proper urls (for direct download)
to devices and if they have to be without authentication this shall be
solved in different ways - for instance separate download server providing
dedicated private / signed urls.

This functinallity is not a real hawkBit part but more like something
intended to solve some edge cases.
Since it is complicated, heeds support, doesn't solve wide spread use
cases, and could be achieved with other means - better to be removed.

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-08-14 17:28:46 +03:00
Avgustin Marinov
a021de5829 Improve base pom structure (#1774)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-07-17 14:30:36 +03:00
Avgustin Marinov
8b3434fc17 Add support for dynamic rollout group template (#1752)
1. Add support in REST and Mgmt API for dynamic group template
2. If present - groups follows the pattern of this template, otherwise - the last static group
3. This allows to create pure dynamic rollout with 0 static groups - auto assignment equivalent with groups

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-06-26 08:31:01 +03:00
Avgustin Marinov
40f99962d2 Add REST method for update rollout (#1749)
* adds PUT method for updating name and description of a rollout
* restrict RolloutUpdate to changing only name and description
* small refactoring

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-06-24 09:16:39 +03:00
Avgustin Marinov
d1b7f1d70e Fixed SecurityContextSwitch method name (#1716)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-04-15 09:04:21 +03:00
Avgustin Marinov
da67193e0f Make SecurityContextSwitch more intuitive (#1715)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-04-12 17:48:58 +03:00
Avgustin Marinov
1f2dd28ab6 [#1712] Fix READ_TENANT_CONFIGURATION hierarchy and add tests (#1714)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-04-12 17:39:31 +03:00
Avgustin Marinov
718c7381f4 Fix outdated (and maybe wrong) jpa related properties (#1702)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-04-09 13:53:12 +03:00
Avgustin Marinov
1640025a25 Apply role hierarchy in hasPermission checks (#1675)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-03-07 18:52:50 +02:00
Avgustin Marinov
a0db5ff70e Rename UserTenantAware to TenantAwareUser (#1668)
in order to be compatible with other TenantAware entities

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-02-27 08:43:40 +02:00
Avgustin Marinov
24d70827b7 Improve hawkBit user management (#1666)
1. Definded with properties users (static) are configured using property map (no need of indexes)
2. AuthenticationProvider that authenticates them is always registered (if not needed - don't configure them)
3. UserDetailsService (in case of missing - won't be registered)
4. Spring security user (spring.security.username) will be registered together with other users (if any). If any - it will be system-wide, otherwise tenant-scoped.
5. UserPrincipal renamed to TenantAwareUser in order to match its purpose.
6. Some if its fields are removes as not needed - to be closer to spring security user
7. DefaultRolloutApprovalStrategy now use UserAuthoritiesResolver instead of UserDetailsService as the central point of truth

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-02-26 16:56:37 +02:00
Avgustin Marinov
f8b1910d02 Refactoring/Improving source: repository 5 (slf4j) (#1605)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-02-03 17:58:54 +02:00
Avgustin Marinov
791b87b27b Reduce dependency on Guava 2 (#1590)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-02-03 00:43:10 +02:00
Avgustin Marinov
bce69676d2 Reduce dependency on Guava (#1589)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-02-02 22:21:46 +02:00
Avgustin Marinov
7440d90f59 [#1383] Spring Boot 3 migration Step 2 (#1559)
* [#1383] Spring Boot 3 migration Step 2

Some of the steps:

1. Change spring version parent and versions in root pom.xml
2. update eclipselink versions
3. javax.annotation -> jakarta.annotation (*.java)
4. javax.persistence -> jakarta.persistence (*.java)
5. javax.servlet -> jakarta.servlet (*.java, pom.xml)
6. javax.validation:validation-api -> jakarta.validation:jakarta.validation-api (pom.xml)
7. javax.validation -> jakarta.validation (*.java)
8. javax.transaction -> jakarta.transaction (*.java)
9. replace spring-cloud-stream-binder-test (hawkbit-repository-test) with
```
<dependency>
   <groupId>org.springframework.cloud</groupId>
   <artifactId>spring-cloud-stream-test-binder</artifactId>
</dependency>
```
, TestSupportBinderAutoConfiguration.class }) -> })
@Import(TestChannelBinderConfiguration.class)
10. Set to Simple UI standard parent
11. requestMatchers to securityMatcher
12. @SpringBootApplication(scanBasePackages = "org.eclipse.hawkbit") (otherwise for instance flyway doesn't work - suffix is default ".sql", not H2.sql and don't differentiate dbs? strange is there a change?)
13. @NonEmpty for Long leads to validation exception - replaced with @NotNull
14. RSQLUtilityTest.correctRsqlBuildsPredicate - fixed - mock query builder add method
15. https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide#spring-mvc-and-webflux-url-matching-changes - aliases as targers/ return 404 - remove trailing slash
16. firewall tests (allowedHostNameWithNotAllowedHost) doesn't throw 'rejected exception' but return 400 instead (as probably is expected anyway)

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

* Fix tenant listing to do not mix with multitenancy

Tenant metadata is not multitenancy aware while depend on distribution set type
which is. Thus querying all tenant metadata (in non tenant context) sometimes leads to
resolution of distribution set type which is tenant scoped and leads to problems.

So, now listing tenant lists just their ids - not fill entities.

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

---------

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-01-20 15:57:17 +02:00
Avgustin Marinov
7768e543fd [#1548] Add support for dynamic rollouts (#1533)
* [#1548] Add support for dynamic rollouts

-- Current status --

Initial draft only !!!, to be improved

TODO:
 * evaluate the target count - if update group/rollout total count fails dynamic updates could (?), actually, contain more targets
 * is it needed to break handler on group creating?
 * if dynamic group schedulers occur to be heavy - maybe a handler per tenant will ensure that one tenant won't break all

*Concept for dynamic groups*:

Rollouts are static and dynamic.
Static rollouts consist of static groups only while dynamic rollouts have a number of static groups (first groups) and then an unlimited number of dynamic groups.

Group targets assignments:
* static groups include ALL matching targets created at the time the rollout was created, nevertheless they have active actions with bigger weight or not. Actions for the rollout and included targeets however are created at the start time.
* dynamic groups however are filled in when started and consider the action weight. The targets included in a dynamic group are:
  * matching (filter and distribution set compatible)
  * not included in this or following rollout static groups (if already included in any of the following rollouts - it's intended to be overridden)
  * not in active actions of any rollouts with equal or bigger weight

In general, when you create a rollout it contains all matching targets available at create time overriding any previous rollouts, actions, and so on. If the rollout is dynamic when its dynamic group becomes running it gets only matching targets that doesn't belong to static groups or have actions with great or equal weight

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

* [#1548] Add 1000 weight for actions, rollouts and auto assignments without weight

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

---------

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2024-01-18 11:37:01 +02:00
Avgustin Marinov
767a7e6b11 [#1509] Sync Target type with SW and DS types (REST Layer) (#1514)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-12-13 14:33:32 +02:00
Avgustin Marinov
1ae72d4ead Remove WithSpringContextRule (#1505)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-12-07 23:52:23 +02:00