Commit Graph

944 Commits

Author SHA1 Message Date
Avgustin Marinov
94d39a12c6 [#1510] Add Vaadin 8 UI discontinuation warning (#1517)
Could be disabled by setting spring property _hawkbit.server.ui.notification.text_ to empty value.
For instance by setting environment propery:
```shell
export HAWKBIT_SERVER_UI_NOTIFICATION_TEXT=
```

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-12-13 20:53:42 +02:00
Denislav Prinov
1ecdcc4edd Added an option to show a footer notification (#1504)
* Added an option to show a footer notification

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

* Refactoring

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>

---------

Signed-off-by: Denislav Prinov <denislav.prinov@bosch.com>
2023-12-08 11:35:18 +02:00
Michael Herdt
960ab6872d Extend access control management (#1493)
* Fix ACM related executions.

* Introduce access controller for actions. Resolve some todos and fix distribution set invalidation strategy.

* Do only check for access if returned values are access controlled.

* Fix review findings.

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

---------

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.com>
2023-12-01 08:50:41 +02:00
Avgustin Marinov
a6fa75697f Splitting monolith app to micro services (#1490)
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-11-30 15:41:12 +02:00
Avgustin Marinov
0021b03c9a CI friendly maven poms - use $revision for version (#1477)
https://maven.apache.org/maven-ci-friendly.html

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-11-16 17:23:01 +02:00
Avgustin Marinov
b982039a74 Feature/ctx aware and access controller2 (#1456)
* Introduce the AccessControlManager and use if for the TargetManagement and TargetTypeManagement.

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

* Extend the access control manager by an API to serialize the current active context and persist it for scheduled background operations like auto-assignment.

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

* Verify modification is permitted before performing automatic assignment

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

* Start with controlling distribution set type access. Perform some refactoring.

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

* Support distribution set access control. Increase character limit to 512 chars for access control context. Refactor default implementations.

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

* Introduce ContextRunner and define admin execution to check for duplicates before creating/updating entities.

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

* Introduce Software Module, Module Type and Artifact control management. Fix tests.

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

* Introduce access controlling test base. Add first test verifying the read operations for target types.

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

* Finalize target type access controlling test.

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

* Introduce ContextRunnerTest and TargetAccessControllingTest.
Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>

* Introduce DistributionSetAccessControllingTest and fix missing access control specifications.

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

* Extend test cases. Include only updatable targets into rollout.

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

* Fix action visibility.

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

* Modifiable->Updatable & UPDATE check where needed

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

* ContextRunner superseded by ContextAware

+ ContextRunner remaned to ContextAware (move as a cenral entry/concept).
  It now extends (and replace) TenantAware
+ SecurityContextTenantAware becomes ContextAware
+ Pluggable serialization mechanism
  (default Java serialization of contexts) for SecurityContextTenantAware
  (using SecurityContextSerializer)
+ AccessControl methods are added to ensure no entities fill be retrieved
  just to call access control - so, if all permitted - no additional db
  queries will be made
+ &lt;repo type&gt;AccessControl classes removed and replaced with
  AccessControl &lt;repo type&gt; generics
+ AccessControlService removed - every AccessControl is registered and
  overiden independently
+ access_control_context in DB increased to 4k (in order to support java
  security context serialization)
+ needed adaptaion of implemtation and tests done

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

* Refactor SoftModules & DistSets

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

* Refactoring of the Repositories

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

* Repostiotory level permissions

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

* Improvements

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

* Simplification of AccessControl interface

* Simplifications & management package

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

* Implementation improvements

+ Artifact management & repo reviewed and tuned
+ Action(Status) management & repo reviewed and tuned
+ SoftwareModule(Type/Meta) management & repo reviewed and tuned
+ DistributionSet(Type/Tag/Meta) management(+Invalidation) & repo reviewed and tuned
+ Target(Tag/Type/Meta) management & repo reviewed and tuned
+ TargetQueryFilter management & repo reviewed and tuned

* Apply suggestions from code review

Suggestions accepted. Thanks @herdt-michael

Co-authored-by: Michael Herdt <michael.herdt@bosch.com>

* Apply suggestions from code review 2

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

---------

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
Co-authored-by: Michael Herdt <Michael.Herdt@bosch.com>
2023-11-16 11:07:06 +02:00
Stein.Codes
defa6c3b69 refactor: Java Security Ultimate Security Repo Scanner 2023 (#1455)
Disclaimer: Automated Commit Alert

Please be aware that this commit, generated through automated processes, may contain false alerts or not be precisely targeted. This automated commit is part of a large-scale effort to enhance software security over time. It is sent to various repositories to improve code quality and security. Exercise caution when reviewing the changes, and ensure that any necessary adjustments are made to maintain the integrity and functionality of the software.

Use this link to re-run the recipe: https://app.moderne.io/recipes/builder/TkgUEiqd7?organizationId=RWNsaXBzZSBGb3VuZGF0aW9u

Co-authored-by: Moderne <team@moderne.io>
2023-11-01 16:41:08 +02:00
Stanislav Trailov
44e7a72be3 Rollout retry (#1454)
* Rollout retry mechanism initial commit

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

* Remove test target fields for filter query

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

* minor refactoring

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

* Fixes after review

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

* more refactoring after review

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

* skip compatibility check of dstype for retried rollout

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

* remove dsType from javadoc

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

---------

Signed-off-by: Stanislav Trailov <Stanislav.Trailov@bosch.io>
2023-10-19 09:58:46 +03:00
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
Avgustin Marinov
56ea5b15c9 [#1383] Spring Boot 3 Migration / Step 1 (#1384)
1. PagingAndSortingRepository doesn't extend CrudRepository anymore. For all extending that interface repositories CrudRepository super interface shall be now declared (https://spring.io/blog/2022/02/22/announcing-listcrudrepository-friends-for-spring-data-3-0 -
```
The popular PagingAndSortingRepository used to extend from CrudRepository, but it no longer does. This lets you combine it
with either CrudRepository or ListCrudRepository or a base interface of your own creation. This means you now have to
explicitly extend from a CRUD fragment, even when you already extend from PagingAndSortingRepository.
```
)
2. org.eclipse.hawkbit.autoconfigure.mgmt.ui -> move in hawkbit-ui (to be ready for removal), anyway - it's a better location for ui related configs
3. extends WebMvcConfigurerAdapter -> implements WebMvcConfigurer
4. remove WebSecurityConfigurerAdapter -> https://docs.spring.io/spring-security/reference/5.8/migration/servlet/config.html#_stop_using_websecurityconfigureradapter, https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter
and add @Order to the bean reg!!
5. Use configurers (the other will be deprecated / removed), e.d:  http.csrf().disable() -> http.csrf(AbstractHttpConfigurer::disable)
6. configure(final AuthenticationManagerBuilder auth) -> put in httpsecurity config - http.getSharedObject(AuthenticationManagerBuilder.class).... (https://www.baeldung.com/spring-security-authentication-provider)
7. configure(final WebSecurity webSecurity) ->
```
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
    return (web) -> web.ignoring().antMatchers("/documentation/**", "/VAADIN/**", "/*.*", "/docs/**");
}
```
(https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter)
8. AuthenticationManager authenticationManagerBean() ->
```
@Bean
AuthenticationManager authenticationManager(final AuthenticationConfiguration authenticationConfiguration) throws Exception {
    return authenticationConfiguration.getAuthenticationManager();
}
```
(https://backendstory.com/spring-security-how-to-replace-websecurityconfigureradapter/)
9. WebMvcAutoConfiguration could be removed - it uses deprectated methods, and sets properties that are same by default - hence - not neeeded
(https://github.com/spring-projects/spring-framework/issues/23915#issuecomment-563987147)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-07-17 10:36:26 +03:00
Marinov Avgustin
ad3404c93d Fix some sonar findings
Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-06-30 09:29:13 +03:00
Marinov Avgustin
649c714006 [#1378] Switch to Tomcat
switch hawkBit web server to Tomcat (was Jetty)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
2023-06-28 16:23:39 +03: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
Michael Herdt
d567b32280 Fix issues in rollout creation dialog (#1329)
* Introduce text input converter and validator to prevent problems with rollout group definitions.
* Add 2023 bosch.io license
* add new header to pom
* Extend usage of new TrimmingStringConverter.
* fixed compile error
2023-03-17 15:41:27 +01:00
Stanislav Trailov
06dca2d5d2 Unify search behaviour in Mgmt UI (#1319)
Signed-off-by: Stanislav Trailov <stanislav.trailov@bosch.io>
2023-02-09 07:45:24 +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
Stanislav Trailov
9d929e014b Make attributes layout horizonthal scroll bar visible (#1308)
* Make attributes layout horizonthal scroll bar visible some more minor improvements afterwards
* Fix sonar build

Signed-off-by: Stanislav Trailov <Stanislav.Trailov@bosch.io>
2023-01-12 15:54:50 +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
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
Stefan Behl
3d3481110e Provide target quicklinks from Target Filters and Rollout views to Deployment view (#1270)
* Adapted GridComponentBuilder#addControllerIdColumn to create a link

* Do not hard-code target link ID prefix

* Encode controller ID

* Introduce HTML encoder for controller IDs

* Remove unused imports
2022-09-23 15:29:58 +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
Bondar Bogdan
1ec5eb6ede Calculate target count asynchronously (#1263)
* first prototype

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

* moved asynchrinous count caclucation to abstract footer support

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

* added asynchronous count details calculation

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

* fixed typo

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-07-07 09:46:46 +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
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
Bondar Bogdan
cc60725c08 UI deep-linking for targets (#1230)
* added target deeplinking through url param
* populate search irregardless of target existence
* adapted view state paramater evaluation flow
* fixed review comments

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2022-02-22 09:24:30 +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
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
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
Bondar Bogdan
f94b4430e0 added Insufficient Permissions UI error extractor (#1196)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-10-21 15:47:31 +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
Robert Sing
76be812cf1 Feature - TargetType compatibility check (#1180)
* added targettype compatibility check in deployment

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

* added targettype compatibility for autssignment

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

* added / fixed tests for auto assignment compatibility check

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

* adapted rollout creation to use JPA specifications for compatibility checks

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

* fix unit tests and javadoc

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

* fix copyright header

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>

* replaced validated-DS management calls

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

* improved compatibility check in DeploymentManagementTest

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

* fixed review findings

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-10-15 15:39:21 +02:00
Anand Kumar
39ccf65f2e Feature target with target type in UI (#1178)
* Added the target type combo box to add or update Target in UI

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

* Fixed NPE for empty target type

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

* Added target type option to target bulk upload

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

* Added Target type filter

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

* Added Named entity mapper for target type UI

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

* Fixed review comments

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

* Fixed sonar issues for serialization

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

* Fixed Review comments

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

* Fixed Bulk upload target type combo box

Signed-off-by: Anand kumar <anand.kumar@bosch-si.com>
2021-10-11 15:00:16 +02:00
Natalia Kislicyn
70d0fe879e Feature mass cancel running actions on ds invalidation (#1177)
* Extend DS invalidation dialog to include mass-cancellation of actions

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

add component id for cancelation type radio buttons

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

* add infos about ds invalidation to UI documentation;
update UI images; add screenshot about ds invalidation

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

* fix review findings

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

* add link property to invalidation docu

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

* Put invalidation counts into one object

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

* add hint to invalidation dialog, that invalidation is unrepeatable

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

* disable invalidate button if insufficient permission

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

* fix auto assignment error with insufficient permission

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

* implement permissions check for invalidation dialog

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

* add update_target permission to api doc description

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-10-05 14:15:43 +02:00
Markus Block
56e4066f12 Feature invalidation of distribution sets [UI part] (#1176)
* Visualization of action/button invalidate DistributionSet

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

* introduced two dialogs to confirm ds invalidation

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

* fixed dialog titles appear centered and added manamgement classes

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

* retrieving affected entities from repository

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

* considered multiselection for invalidating dist sets

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

* adapt style and tooltip of invalid distributions in grid

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

* showing errors for actions not allowed for invalidate DS

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

* enhanced error message with dist name and version

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

* added ids to the labels to be used in tests

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

* added support for overwriting entity specific edit behaviour

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

* Fixed incorrect label for cancelled action due to invalidation of ds in
a rollout

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

* Fixed error notification to not show "please try again" for an invalid
DS

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

* fixed typo

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

* fixed Sonar findings

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

* remove DS of a copied Rollout in case the DS is invalidated

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

* changed icon of RolloutActionStatus in case of stopped Rollout because
of invalidation of DS and DS wasn't yet assigned to target. This is to
distinguish from the case of not assigned DS because of duplicate DS
assignemnt

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

* Prevent editing Metadata of invalid DS

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

* show DS as invalidated in Rollout view

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

* incorporated code review remarks

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

* invalidated DS should be removed from the list of DS to be invalidated

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

* fixed missing code due to merge

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

* Fixed compile error due to rebase

Signed-off-by: Markus Block <markus.block@bosch-si.com>
2021-10-01 16:15:05 +02:00
Bondar Bogdan
ace2f00742 View-scoped event listeners (#1134)
* added UI EntityNotFound error details extractor

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

* changed Target count label to not rely on grid data change events but rather on EntityModified UI events to decide how to react dependand on the event type

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

* added current view check on entity modified events

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

* unsubscribe/resubscribe event listeners on view leave/enter, reselect grid entities on view enter

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

* fixed target grid count reset on initial load and after view change

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

* re-evaluate filters on Deployment View enter

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

* added on view enter logic for rest of the views

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

* introduced event listener aware layout and view, adapted code accordingly

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

* fixed bulk upload

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

* added missing docs

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

* adapted software module deselection upon master entity change

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

* fixed npe in case master support is not present (Artifact View)

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

* restructured amqp assignDistributionSetMultipleTimes test

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

* added waiting for the messages to be dispached by test

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-07-22 11:00:05 +02:00
Robert Sing
18851d62a1 PopUp dialog for canceling queued uploads (#1112)
* added cancel dialog for queued uploads

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

* fix PR review findings

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

* fix sonar finding

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

* fixed DashboardMenu navigation

Signed-off-by: Robert Sing <robert.sing@bosch-si.com>
2021-06-14 13:40:20 +02:00
Florian Ruschbaschan
f19c3e5ff6 Remove wrong license header (#1127)
Signed-off-by: Florian Ruschbaschan <Florian.Ruschbaschan@bosch.io>
2021-06-08 12:25:03 +02:00
Bondar Bogdan
afdaeca25a added remote entity events dispatch topic to be fired on deffered events dispatch (#1129)
Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-06-07 20:28:14 +02:00
Bondar Bogdan
40b28e212d Injectable UI target data suppliers (#1123)
* initial proposal for injectible target data provider

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

* improved selection of first entity in grid

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

* introduced constructor to explicitely set DataCommunicator for a Grid

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

* made data communicator for target grid injectable

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

* adapted size page request to load only one entity for getting total elements, fixed grid duplicates in case lastModified property is the same for targets and rollouts

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

* DeleteSupport rethrows the exception to be intercepted by error handlers

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

* minor grid refactoring

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

* adapted docu for base data providers

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

* added custom filter data provider, made filter effectively immutable by cloning before data refresh

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

* grid returns size directly from data provider instead of data communicator

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

* restructured data provider/communicator dependency injection, added injectable data supplier for target filter view grid

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

* do not remove confirmation dialog window from UI explicitely

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

* fixed sonar, added docs

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-06-02 16:58:35 +02:00
Michael Herdt
efa21469cd Fix the action status icon "CANCEL_REJECTED" because it was displayed as unknown (#1115)
Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2021-05-03 15:52:30 +02:00
Bondar Bogdan
5bcaf3d99b UI error handling refactoring (#1106)
* refactored HawkbitUIErrorHandler to delegate error details extraction to external extractor beans
* refactored ui error handling, allowed ui error details extractors to return a list of error details
* added license headers, restructured package structure
* adapted javadocs
* fixed sonar findings
* fixed license header
* added tests for HawkbitUIErrorHandler
* refactored ConstraintViolationErrorExtractor, added test for extractors
* changed UI tests feature to Management UI
* fixed the parent/child error type resolution by ui error details extractor, added test

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch.io>
2021-04-22 08:19:45 +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
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
Natalia Kislicyn
3422781125 Restructure Tenant Configuration View to make it more flexible for adaptations (#1043)
* Extract view creation for Configuration Components into Beans;
Split implementations of config Binders into corresponding view classes:
- add ProxySystemConfig classes respectively for ConfigurationViews;
- create Binder and config Bean in BaseConfigurationView via Generics;
- extend ConfigurationViews from BaseConfigurationView;
- populate Binders and config Bean in ConfigurationView;
- access binder getter/setter in ConfigurationItem through corresponding ProxySystemConfig;
- autowire Collection of Config Views in TenantConfigurationDashboardView;
- create components, call save and undo for each config view in Collection

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

* Do not send the target token when anonymous download is enabled

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

* Update amqp tests to cover enabled anonymous download config

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

* Do not change TargetToken functionality for hawkbit;
Make createDownloadAndUpdateRequest protected;
Undo some of previous test changes;

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

* Add license header to ProxySystemConfigDsType

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

* Call save methods for filtered ConfigurationViews only, not the autowired.

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

* Document public classes

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

* Adopt Review Comments:
- Rename DefaultDistributionSetTypeLayout
- Remove unnecessary qualifier TenantConfigurationProperties

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

* Refactoring: implement InitializingBean instead of using PostConstruct

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

* Apply to remaining classes: implement InitializingBean instead of using PostConstruct

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

* Removed unnecessary method notifyConfigurationChanged();
Documented Bean creation of configuration views

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

* Rename TenantConfigurationAutoConfiguration to SystemConfigViewAutoConfiguration

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

* Rename init method of DefaultDistributionSetTypeView

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-02-11 17:21:55 +01:00
Michael Herdt
3deb325514 Show Controller ID within target, filter and rollouts view (#1056)
* Add the controllerId column to the targetGrid of the deployment, rollout target and filter search result view.

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

* Fix review findings.

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

* introduce a constant for the default min_width in GridComponentBuilder

Signed-off-by: Michael Herdt <Michael.Herdt@bosch.io>
2021-02-11 17:10:49 +01:00
Dominic Schabel
17cca56a1b Merge pull request #1018 from bosch-io/fix_migration_to_new_spring_boot_version
Update Spring Boot to 2.3.7.RELEASE
2021-02-11 16:42:14 +01:00
Natalia Kislicyn
d1c60d613a Fix NPE that occurs on invalid user input in editfields (#1077)
Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch.io>
2021-02-05 13:57:09 +01:00