-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathREADME.md
70 lines (48 loc) · 2 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!--
SPDX-FileCopyrightText: the secureCodeBox authors
SPDX-License-Identifier: Apache-2.0
-->
# DefectDojo Client Java
Java Client to interact with the DefectDojo API.
## Dependency Information
You can find the latest version on [Maven Central](https://central.sonatype.com/artifact/io.securecodebox/defectdojo-client/).
### Maven
```xml
<dependency>
<groupId>io.securecodebox</groupId>
<artifactId>defectdojo-client</artifactId>
<version>1.0.0.-beta2</version>
</dependency>
```
### Gradle
```groovy
implementation group: 'io.securecodebox', name: 'defectdojo-client', version: '1.0.0.-beta2'
```
## Development
To run a local build clone this repo and just invoke the following command in the repo directory:
```shell
mvn clean install
```
## Supported DefectDojo Versions
The client is supposed to be compatible with DefectDojo 1.10 and later, older version of DefectDojo might still work, but are not officially supported.
## Example
```java
import com.fasterxml.jackson.core.JsonProcessingException;
import io.securecodebox.persistence.defectdojo.config.Config;
import io.securecodebox.persistence.defectdojo.service.ProductTypeService;
import java.net.URISyntaxException;
public class DefectDojoClientTest {
public static void main(String[] args) throws URISyntaxException, JsonProcessingException {
// Configure DefectDojo URl and APIv2 Key
var conf = new DefectDojoConfig("https://defectdojo.example.com", "f8....");
var productTypeService = new ProductTypeService(conf);
var productTypes = productTypeService.search();
System.out.println("ProductTypes:");
for (var productType : productTypes) {
System.out.println(" - Id: " + productType.getId() + ", Name: '" + productType.getName()) + "'";
}
}
}
```
## Testing a modified client
To build a gradle project that depends on this client one can use `./gradlew build --include-build <path_to_this_folder>`. Gradle will then build the project with this local version of the the client.