Commit graph

62 commits

Author SHA1 Message Date
Niklas
43a1e38d1e
Merge pull request #3248 from mge-mm/dependency-track-1732
Project cloning logic for cloning policy violations and Violationanalysis
2024-01-15 20:39:37 +01:00
Ralf King
3f97987d85 Implement #1732
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-10 02:43:38 +01:00
Ralf King
e379766844 reuse existing projects endpoint instead of creating a new one
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-04 02:02:54 +01:00
Ralf King
763492f42f Portfolio Access Control : Add a team group to project should only list projects that are not already added.
Signed-off-by: Ralf King <rkg@mm-software.com>
2023-12-03 21:30:53 +01:00
Niklas
065e483a98
Merge pull request #3179 from nscuro/supplier-manufacturer-corrections
Supplier and manufacturer corrections
2023-11-28 23:42:30 +01:00
Willie Nel
7ead801fea Added a default value for 'active' if it is null
When creating a project from json payload and the active field is
not specified it will now default to true instead of null.

This fixes an issue with projects not being assignable as parent projects
because they are "inactive".

Signed-off-by: Willie Nel <4620380+willienel@users.noreply.github.com>
2023-11-28 20:28:55 +01:00
nscuro
b5a0bbf5fe
Move manufacturer from ProjectMetadata to Project
As per CycloneDX specification, `metadata.manufacturer` refers to `metadata.component`, whereas `metadata.supplier` and `metadata.authors` refer to the BOM itself.

Keeping `manufacturer` in `ProjectMetadata` is awkward and confusing.

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 21:47:02 +01:00
nscuro
b6952ca22f
Remove unused ProjectQueryManager#updateProject method
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 20:09:50 +01:00
nscuro
609c4f8092
Ensure project.supplier can be PATCHed
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 20:07:51 +01:00
nscuro
91c1040f77
Include metadata when cloning projects
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 19:44:53 +01:00
nscuro
785f1e485e
Handle supplier in update, patch, and clone operations of components and projects
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-11-27 19:44:53 +01:00
nscuro
a6230de487
Object passed to IndexEvent no longer need detaching
They are converted to non-managed `SearchDocument` implementations in `IndexEvent`'s constructor.

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-10-22 22:41:58 +02:00
nscuro
5534d3aace
Fix NPE in doesProjectExist when project version is null
Regression introduced in #2966

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-10-02 23:09:22 +02:00
nscuro
741de8ce16
Fix project cloning allowing for duplicate versions
Also fixed:

* services not being cloned, despite `includeServices` being set to `true`.
* ACLs not being enforced for the `/clone` endpoint

And added tests for cloning that were previously missing.

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-08-21 22:57:29 +02:00
Walter de Boer
8580c05d89 Use projections / result class to determine ProjectVersions
Co-authored-by: Niklas <nscuro@protonmail.com>
Signed-off-by: Walter de Boer <walterdeboer@dbso.nl>
2023-06-27 23:02:45 +02:00
Walter de Boer
c02fe38e7b Added transient List of ProjectVersions and set Metrics in Project to minimize the number of round trips a client needs to make
Signed-off-by: Walter de Boer <walterdeboer@dbso.nl>
2023-04-28 07:34:48 +02:00
Florian Heubeck
fea0adef2c
Issue #2695: Add externalReferences to PATCH project
Signed-off-by: Florian Heubeck <heubeck@mediamarktsaturn.com>
2023-04-20 17:13:24 +02:00
nscuro
ca74c2682d
Fix invalid query filter assembly
Fixes #2583

Signed-off-by: nscuro <nscuro@protonmail.com>
2023-03-09 11:58:29 +01:00
syalioune
4fd762474e Fix: Cloning ACL when cloning project
See #2493 for details

Signed-off-by: syalioune <sy_alioune@yahoo.fr>
2023-03-02 15:02:40 +01:00
nscuro
50b6c89987
Add checkstyle plugin to enforce import style
Signed-off-by: nscuro <nscuro@protonmail.com>
2023-02-05 17:43:14 +01:00
rbt-mm
a160bd5590
Fix NullPointerException when updating a project (#2319)
* Fix `NullPointerException` in ProjectQueryManager

Fixes the `NullPointerException` which occurs when updating a project
where `project.isActive() == null`

Signed-off-by: RBickert <rbt@mm-software.com>

* Prevent NullPointerException in NotificationRouter

Signed-off-by: RBickert <rbt@mm-software.com>

Signed-off-by: RBickert <rbt@mm-software.com>
2022-12-21 10:55:06 +01:00
Mvld3r
61b63d54b1
Make project search by tags case insensitive (#1723)
Signed-off-by: ege-dw <enora.germond@deveryware.com>

Signed-off-by: ege-dw <enora.germond@deveryware.com>
Co-authored-by: ege-dw <enora.germond@deveryware.com>

Closes #1717
2022-12-14 16:16:29 +01:00
KramNamez
a2cbecca89
Added ProjectCreationNotification (#2176)
* Added ProjectCreationNotification

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

* Added test

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

* Fixed mess after dealing with GitHub

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

* And redo work lost due to that mess

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

* Fixed broken tests

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

* Fixed misunderstanding of createProjectTest

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

Signed-off-by: Mark Zeman <zeman@puzzle.ch>

Closes #2173
2022-12-14 12:41:09 +01:00
rbt-mm
48688fa958
Implement treegrid to display parent-child-relationship in project list (#2152)
* Implement new functionalities for treegrid

A project now serializes his ID and his parent ID into JSON.

It's now possible to get children Projects by tag and by classifier

Signed-off-by: RBickert <rbt@mm-software.com>

* Serialize `parentUuid` instead of `id` and `pid`

Signed-off-by: RBickert <rbt@mm-software.com>

* Add check for setting inactive parent

Signed-off-by: RBickert <rbt@mm-software.com>

* Adjust API for new vue-multiselect in frontend

Signed-off-by: RBickert <rbt@mm-software.com>

* Adjust `ProjectResourceTest` to updated API

Signed-off-by: RBickert <rbt@mm-software.com>

Signed-off-by: RBickert <rbt@mm-software.com>

Closes #84
2022-12-02 18:21:49 +01:00
Stephan Spindler
65a86f6d5a
Refactoring in persistence (#2121)
* Refactor getTags for greater readability

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Rename method and clean up formatting

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Add docs to ProjectQueryFilterBuilder

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Add tests for ProjectQueryFilterBuilder

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Simplify method

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Simplify getComponents  method

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Move copying from another alias into VulnerabilityAlias class

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Add missing newlines at eof

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

* Add back condition removed in refactoring

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>

Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-11-15 11:34:27 +01:00
valentijnscholten
1d4dd162d8 Use ArrayList to satisfy Lift
Co-authored-by: sonatype-lift[bot] <37194012+sonatype-lift[bot]@users.noreply.github.com>
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-06 20:44:57 +01:00
Valentijn Scholten
9abffde4c1 clone-acl: remove comment
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-06 19:51:21 +01:00
Valentijn Scholten
a5ff479c9a Allow cloning of ACL during Project cloning
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-11-05 16:09:33 +01:00
RBickert
378a2501a0 Improve backend for hierarchical view
Fetch plans are now set for queries instead of persistence managers.

Improved project query filter 'withParent' to avoid collisions.

Changed logger from error to debug in 'ProjectResource'.

Checks for access in 'getProjectsWithoutDescendantsOf'.

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-18 09:41:11 +02:00
rbt-mm
2610187937 Improvements to backend methods
- Removed redundant if-clause in `excludeProjectsThatAreChildren()` and
adjusted if-clauses in the case of only showing root projects in
`ProjectQueryManager.java`

- Added logger errors in `ProjectResource.java`

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:19 +02:00
RBickert
538bdb1116 Optimizations and fixes for hierarchical view
- Renamed `excludeChildren` to `excludeProjectsThatAreChildren`

- Optimized several conditional clauses which check if a project is
active

- Throw exception instead of just logging if an inactive parent is
selected, if an active parent with active children is updated to
inactive or if a project updates itself to its parent

- Added more information in Swagger-API

- Added ACL-check in `getChildrenProjects`

- Updated API calls to reduce redundant methods and to filter a
project's viable parents in the backend instead of in the backend

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:19 +02:00
RBickert
bb2a0ee6c0 Fix switching parent to inactive
A parent project cannot be set to inactive if any of his children are
set to active

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:19 +02:00
RBickert
d1f9ef0abe Remove selection of inactive parent in API
Fixed selection of inactive parent projects in project creation and
project update.

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:18 +02:00
RBickert
ab34bdf61b Add and display project parent-child-relationship
Add selection of parent at project creation.

Add methods in both project api and project query manager to display
the new hierarchical project list view correctly.
New functionalities:
- Return every root project (project without a parent)
- Return every child of a project
- Return every project with every parent-relationship

Signed-off-by: RBickert <rbt@mm-software.com>
2022-10-04 16:48:18 +02:00
nscuro
99d48e8c46
Fix exception when deleting projects that are associated with policies
Fixes #1852

Signed-off-by: nscuro <nscuro@protonmail.com>
2022-08-03 21:57:46 +02:00
nscuro
d469ab6cfe
Use datastore-native limiting in queries where only a single result is desired
Translates into `LIMIT 1`, `TOP 1` etc. depending on the datastore.

Results in queries being executed faster in the datastore (at least when no index is used), reduces the amount of unnecessary data being loaded into RAM.

Signed-off-by: nscuro <nscuro@protonmail.com>
2022-07-23 20:29:51 +02:00
Pinto Spindler, Stephan
0924197d7e feat: allow name based filtering in tag view
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
7c912cf3a4 refactor: move ProjectQueryFilterBuilder to package
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
815971aa69 refactor: use ProjectQueryFilterBuilder in generic getProjects
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
00a5f49435 refactor: introduce ProjectQueryFilterBuilder
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
9d88bc8fce docs: fix javadoc grammar
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
3e1fcfdc2f refactor: simplify setting of query params
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
Pinto Spindler, Stephan
4f5a8fe3f1 refactor: extract common part from if on filter field
Signed-off-by: Pinto Spindler, Stephan <25225092+s-spindler@users.noreply.github.com>
2022-07-16 12:27:25 +02:00
nscuro
47d81ed574
Commit search index after project deletion
Fixes #1605

Signed-off-by: nscuro <nscuro@protonmail.com>
2022-05-11 22:50:23 +02:00
Steve Springett
f3fe456bc0 #1185 - Adding support for querying projects by classifier
Signed-off-by: Steve Springett <steve@springett.us>
2022-05-08 02:52:49 -05:00
Steve Springett
6bc6c72f36 Implemented VEX consumption and processing
Signed-off-by: Steve Springett <steve@springett.us>
2022-05-08 00:31:27 -05:00
Valentijn Scholten
bdf92a1b0e BOM upload autocreate: Add Team to ACL
Signed-off-by: Valentijn Scholten <valentijnscholten@gmail.com>
2022-04-12 13:33:01 +02:00
Steve Springett
9039fcab67 #1524 - Fixed NPE
Signed-off-by: Steve Springett <steve@springett.us>
2022-04-10 17:30:45 -05:00
Steve Springett
87675e4f62 #1501 - Adding ability to exclude inactive projects when querying by tag
Signed-off-by: Steve Springett <steve@springett.us>
2022-03-30 10:55:12 -05:00
Steve Springett
10d9446700 Updating to Alpine v2
Signed-off-by: Steve Springett <steve@springett.us>
2022-02-23 23:14:51 -06:00