Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d302664
WIP Add JDBI method for component search
sahibamittal Mar 10, 2026
7c2af99
Add dependency metrics to components API
sahibamittal Mar 11, 2026
4462d12
Add safe column checks and update OpenAPI keys
sahibamittal Mar 11, 2026
ebb0f55
Add tests for component identity endpoint
sahibamittal Mar 11, 2026
237fa56
Return project object in component responses
sahibamittal Mar 11, 2026
512f7cd
Update ComponentsResourceTest.java
sahibamittal Mar 11, 2026
be35f8b
Add listComponents endpoint and schema updates
sahibamittal Mar 20, 2026
ea6ef71
Merge branch 'main' into issue-2049-improve-component-search-performance
sahibamittal Mar 20, 2026
892234b
Update ComponentsResourceTest.java
sahibamittal Mar 20, 2026
5e09d4f
Add 400 response and test for invalid CPE
sahibamittal Mar 20, 2026
7471c9f
Add project direct_dependencies in components API
sahibamittal Mar 20, 2026
6debb6e
Include total counts in component pagination
sahibamittal Mar 25, 2026
6bfda9c
Separate project-specific components response schema
sahibamittal Mar 25, 2026
766238a
Add component search by hash
sahibamittal Mar 26, 2026
7489c27
Add sorting support to components listing
sahibamittal Mar 27, 2026
4d08596
Add component sorting test and setup fixes
sahibamittal Mar 27, 2026
dd2f31f
Add hash_type filter and enum-based sorting
sahibamittal Mar 31, 2026
647532a
Merge branch 'main' into issue-2049-improve-component-search-performance
sahibamittal Mar 31, 2026
5d5a56a
Update ComponentDao.java
sahibamittal Apr 14, 2026
4103326
Update ComponentDao.java
sahibamittal Apr 14, 2026
2d5c9d9
Update tests for LAST_RISKSCORE
sahibamittal Apr 14, 2026
4305f10
Use HashType enum and centralize sort mapping
sahibamittal Apr 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions api/src/main/openapi/components/schemas/component-project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
type: object
properties:
name:
type: string
maxLength: 255
version:
type: string
maxLength: 255
uuid:
type: string
format: uuid
96 changes: 96 additions & 0 deletions api/src/main/openapi/components/schemas/dependency-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
type: object
properties:
critical:
type: integer
format: int32
high:
type: integer
format: int32
medium:
type: integer
format: int32
low:
type: integer
format: int32
unassigned:
type: integer
format: int32
vulnerabilities:
type: integer
format: int32
suppressed:
type: integer
format: int32
inherited_risk_score:
type: number
format: double
findings_total:
type: integer
format: int32
findings_audited:
type: integer
format: int32
findings_unaudited:
type: integer
format: int32
policy_violations_fail:
type: integer
format: int32
policy_violations_warn:
type: integer
format: int32
policy_violations_info:
type: integer
format: int32
policy_violations_total:
type: integer
format: int32
policy_violations_audited:
type: integer
format: int32
policy_violations_unaudited:
type: integer
format: int32
policy_violations_security_total:
type: integer
format: int32
policy_violations_security_audited:
type: integer
format: int32
policy_violations_security_unaudited:
type: integer
format: int32
policy_violations_license_total:
type: integer
format: int32
policy_violations_license_audited:
type: integer
format: int32
policy_violations_license_unaudited:
type: integer
format: int32
policy_violations_operational_total:
type: integer
format: int32
policy_violations_operational_audited:
type: integer
format: int32
policy_violations_operational_unaudited:
type: integer
format: int32
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ properties:
maxLength: 255
resolved_license:
$ref: "./license.yaml"
occurrence_count:
type: integer
format: int64
minimum: 0
last_inherited_risk_score:
type: number
format: double
uuid:
type: string
format: uuid
format: uuid
project:
$ref: "./component-project.yaml"
metrics:
$ref: "./dependency-metrics.yaml"
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
type: object
properties:
name:
type: string
maxLength: 255
version:
type: string
maxLength: 255
group:
type: string
maxLength: 255
classifier:
type: string
maxLength: 255
hashes:
$ref: "./hashes.yaml"
cpe:
type: string
maxLength: 255
purl:
type: string
maxLength: 1024
swid_tag_id:
type: string
maxLength: 255
internal:
type: boolean
copyright:
type: string
maxLength: 255
license:
type: string
maxLength: 255
license_expression:
type: string
maxLength: 255
license_url:
type: string
maxLength: 255
resolved_license:
$ref: "./license.yaml"
occurrence_count:
type: integer
format: int64
minimum: 0
last_inherited_risk_score:
type: number
format: double
uuid:
type: string
format: uuid
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is part of Dependency-Track.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) OWASP Foundation. All Rights Reserved.
type: object
allOf:
- $ref: "./paginated-response.yaml"
properties:
items:
type: array
items:
$ref: "./list-project-components-response-item.yaml"
required:
- items
109 changes: 109 additions & 0 deletions api/src/main/openapi/paths/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,114 @@ post:
$ref: "../components/responses/generic-forbidden-error.yaml"
"409":
$ref: "../components/responses/generic-conflict-error.yaml"
default:
$ref: "../components/responses/generic-error.yaml"

get:
operationId: listComponents
summary: List all components
description: |-
Retrieves a list of all components that have the specified component identity. This resource accepts coordinates (group, name, version) or purl, cpe, or swidTagId.

### Sortable fields

Sorting is supported for the following fields:

* `name`
* `version`
* `group`
* `purl`
* `cpe`
* `swid_tag_id`
* `last_inherited_risk_score`

Requires permission <strong>VIEW_PORTFOLIO</strong>
tags:
- Components
parameters:
- name: project_uuid
in: query
description: The UUID of the project to retrieve components for
schema:
type: string
format: uuid
- name: group
in: query
description: The group of the component
schema:
type: string
- name: name
in: query
description: The name of the component
schema:
type: string
- name: version
in: query
description: The version of the component
schema:
type: string
- name: purl
in: query
description: The PURL of the component
schema:
type: string
- name: cpe
in: query
description: The CPE of the component
schema:
type: string
- name: swid_tag_id
in: query
description: The SWID Tag ID of the component
schema:
type: string
- name: hash_type
in: query
description: The MD5, SHA1, SHA_256, SHA_384, SHA_512, SHA3_256, SHA3_384, SHA3_512, BLAKE2B_256, BLAKE2B_384, BLAKE2B_512, or BLAKE3 hash type of the component
schema:
type: string
enum:
- MD5
- SHA1
- SHA_256
- SHA_384
- SHA_512
- SHA3_256
- SHA3_384
- SHA3_512
- BLAKE2B_256
- BLAKE2B_384
- BLAKE2B_512
- BLAKE3
- name: hash
in: query
description: The hash value of the component
schema:
type: string
- $ref: "../components/parameters/pagination-limit.yaml"
- $ref: "../components/parameters/page-token.yaml"
- $ref: "../components/parameters/sort-direction.yaml"
- $ref: "../components/parameters/sort-by.yaml"
responses:
"200":
description: A list of all components for a given identity
content:
application/json:
schema:
$ref: "../components/schemas/list-components-response.yaml"
"400":
description: Bad Request
content:
application/problem+json:
schema:
anyOf:
- $ref: "../components/schemas/json-schema-validation-problem-details.yaml"
- $ref: "../components/schemas/problem-details.yaml"
"401":
$ref: "../components/responses/generic-unauthorized-error.yaml"
"403":
$ref: "../components/responses/generic-forbidden-error.yaml"
"404":
$ref: "../components/responses/generic-not-found-error.yaml"
default:
$ref: "../components/responses/generic-error.yaml"
2 changes: 1 addition & 1 deletion api/src/main/openapi/paths/projects_uuid_components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ get:
content:
application/json:
schema:
$ref: "../components/schemas/list-components-response.yaml"
$ref: "../components/schemas/list-project-components-response.yaml"
"401":
$ref: "../components/responses/generic-unauthorized-error.yaml"
"403":
Expand Down
Loading
Loading