DependencyTrack / DependencyTrack/dependency-track
PUT/POST /license ignores policyConditions
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 237
Description
### Current Behavior
policyConditions contents are ignored, even though the OpenAPI spec shows that you can send them
### Steps to Reproduce
```
curl --fail-with-body --silent --show-error -H 'Authorization: Bearer ' http://localhost:8081/api/v1/policy -X PUT -H 'Content-Type: application/json' --data-binary @- <<< '{"name":"Vulnerability Policy","operator":"ANY","violationState":"FAIL","policyConditions":[{"operator":"IS","subject":"SEVERITY","value":"CRITICAL"},{"operator":"IS","subject":"SEVERITY","value":"HIGH"}],"global":true}'
{"name":"Vulnerability Policy","operator":"ANY","violationState":"FAIL","policyConditions":[],"projects":[],"tags":[],"uuid":"2a8feba0-86d4-4532-9600-e9a017cf2d81","includeChildren":false,"onlyLatestProjectVersion":false,"global":true}
```
### Expected Behavior
policyConditions contents are not ignored, and the specified conditions are added to the policy
### Dependency-Track Version
4.13.1
### Dependency-Track Distribution
Container Image
### Database Server
PostgreSQL
### Database Server Version
_No response_
### Browser
N/A
### Checklist
- [x] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [x] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Assessment
This issue has not been assessed yet.