Skip to content

Commit 8e3d08c

Browse files
committed
Add docs for importer service, per review
Signed-off-by: Jim Crossley <[email protected]>
1 parent 9341d02 commit 8e3d08c

File tree

2 files changed

+34
-13
lines changed

2 files changed

+34
-13
lines changed

docs/env-vars.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
| `HTTP_SERVER_TLS_ENABLED` | Enable TLS | `false` |
2121
| `HTTP_SERVER_TLS_KEY_FILE` | Path to the TLS key file in PEM format | |
2222
| `HTTP_SERVER_WORKERS` | Number of worker threads, defaults to zero, which falls back to the number of cores | `0` |
23+
| `IMPORTER_CONCURRENCY` | The maximum number of jobs run simultaneously by the importer | `1` |
24+
| `IMPORTER_WORKING_DIR` | Where the importer downloads documents prior to ingesting them | `tempdir` |
2325
| `OIDC_PROVIDER_CLIENT_ID` | OIDC client ID used for retrieving access tokens | |
2426
| `OIDC_PROVIDER_CLIENT_SECRET` | Secret matching the OIDC client ID | |
2527
| `OIDC_PROVIDER_ISSUER_URL` | OIDC issuer to request access tokens from | |

modules/importer/README.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,67 @@
11
# Importer
22

3-
## Create a new CSAF importer
3+
## Server configuration
4+
5+
The `importer` service is started using `trustd`, e.g.
6+
7+
```shell
8+
trustd importer --concurrency=4 --working-dir=".trustify/importer"
9+
```
10+
11+
The default value for `concurrency` is 1. This is the maximum number
12+
of importer jobs run simultaneously by the service.
13+
14+
The `importer` should be started with the same database and storage
15+
options as the associated `api` service. Run the following to see what
16+
those are:
17+
18+
```shell
19+
trustd importer --help
20+
```
21+
22+
## Client API
23+
24+
### Create a new CSAF importer
425

526
```shell
627
http POST localhost:8080/api/v2/importer/redhat-csaf csaf[source]=https://redhat.com/.well-known/csaf/provider-metadata.json csaf[disabled]:=false csaf[onlyPatterns][]="^cve-2023-" csaf[period]=30s csaf[v3Signatures]:=true
728
```
829

9-
## Create a new OSV importer
30+
### Create a new OSV importer
1031

1132
```shell
1233
http POST localhost:8080/api/v2/importer/osv-r osv[source]=https://github.com/RConsortium/r-advisory-database osv[path]=vulns osv[disabled]:=false osv[period]=30s
1334
```
1435

15-
## Create a new SBOM importer
36+
### Create a new SBOM importer
1637

1738
Quarkus & RHEL 9 data:
1839

1940
```shell
2041
http POST localhost:8080/api/v2/importer/redhat-sbom sbom[source]=https://access.redhat.com/security/data/sbom/beta/ sbom[keys][]=https://access.redhat.com/security/data/97f5eac4.txt#77E79ABE93673533ED09EBE2DCE3823597F5EAC4 sbom[disabled]:=false sbom[onlyPatterns][]=quarkus sbom[onlyPatterns][]=rhel-9 sbom[period]=30s sbom[v3Signatures]:=true
2142
```
2243

23-
## Get all importers
44+
### Get all importers
2445

2546
```shell
2647
http GET localhost:8080/api/v2/importer
2748
```
2849

29-
## Get a specific importer
50+
### Get a specific importer
3051

3152
```shell
3253
http GET localhost:8080/api/v2/importer/redhat-csaf
3354
http GET localhost:8080/api/v2/importer/redhat-sbom
3455
```
3556

36-
## Get reports
57+
### Get reports
3758

3859
```shell
3960
http GET localhost:8080/api/v2/importer/redhat-csaf/report
4061
http GET localhost:8080/api/v2/importer/redhat-sbom/report
4162
```
4263

43-
## Update an importer configuration
64+
### Update an importer configuration
4465

4566
```shell
4667
http PUT localhost:8080/api/v2/importer/redhat-csaf csaf[source]=https://redhat.com/.well-known/csaf/provider-metadata.json csaf[disabled]:=false csaf[period]=30s csaf[v3Signatures]:=true csaf[fetchRetries]:=50
@@ -58,29 +79,27 @@ To execute:
5879
http GET localhost:8080/api/v2/importer/redhat-csaf | jq .configuration | jq .csaf.fetchRetries=50 | http PUT localhost:8080/api/v2/importer/redhat-csaf
5980
```
6081

61-
## Patch an importer configuration
82+
### Patch an importer configuration
6283

6384
```shell
6485
http PATCH localhost:8080/api/v2/importer/redhat-csaf "Content-Type:application/merge-patch+json" csaf[fetchRetries]:=50
6586
```
6687

67-
## Delete an importer
88+
### Delete an importer
6889

6990
```shell
7091
http DELETE localhost:8080/api/v2/importer/redhat-csaf
7192
http DELETE localhost:8080/api/v2/importer/redhat-sbom
7293
```
7394

74-
## Set the enabled state of an importer
95+
### Set the enabled state of an importer
7596

7697
```shell
7798
echo true | http PUT localhost:8080/api/v2/importer/redhat-sbom/enabled
7899
```
79100

80-
## Force an importer run
101+
### Force an importer run
81102

82103
```shell
83104
http PUT localhost:8080/api/v2/importer/redhat-sbom/force
84105
```
85-
86-

0 commit comments

Comments
 (0)