Skip to content

Commit 4bd0d86

Browse files
committed
chore: rename EXHORT_ opts to TRUSTIFY_DA_
1 parent 8b55e59 commit 4bd0d86

28 files changed

Lines changed: 195 additions & 197 deletions

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ jobs:
9191

9292
- name: Run unit tests
9393
env:
94-
EXHORT_PYTHON3_PATH: "${{steps.python-location.outputs.python-bin-location}}/python3"
95-
EXHORT_PIP3_PATH: "${{steps.python-location.outputs.python-bin-location}}/pip3"
94+
TRUSTIFY_DA_PYTHON3_PATH: "${{steps.python-location.outputs.python-bin-location}}/python3"
95+
TRUSTIFY_DA_PIP3_PATH: "${{steps.python-location.outputs.python-bin-location}}/pip3"
9696
run: npm run test
9797

9898
- name: Compile project
@@ -105,7 +105,7 @@ jobs:
105105
working-directory: integration
106106
run: bash ./run_its.sh
107107
env:
108-
EXHORT_DEV_MODE: 'true'
108+
TRUSTIFY_DA_DEV_MODE: 'true'
109109

110110
- name: Upload coverage reports
111111
if: ${{ matrix.node == env.MAIN_NODE_VER }}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
### Good to know
2222

23-
* You can override the default backend url by setting another one in the _EXHORT_URL_ environment variable.
23+
* You can override the default backend url by setting another one in the _TRUSTIFY_DA_URL_ environment variable.
2424

2525
### OpenAPI Specifications
2626

@@ -100,10 +100,10 @@ Run integration tests from the project's root:
100100
```
101101

102102
Integration tests are executed against a mocked _Backend_ server.<br/>
103-
If you need to run against the actual _Backend_ server, use the _EXHORT_ITS_USE_REAL_API_ environment variable:
103+
If you need to run against the actual _Backend_ server, use the _TRUSTIFY_DA_ITS_USE_REAL_API_ environment variable:
104104

105105
```shell
106-
(cd integration/ && EXHORT_ITS_USE_REAL_API=true bash ./run_its.sh)
106+
(cd integration/ && TRUSTIFY_DA_ITS_USE_REAL_API=true bash ./run_its.sh)
107107
```
108108

109109
The mocked server implementation is [integration/server/mock_server.js](integration/server/mock_server.js). See the

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@ import exhort from '@trustify-da/trustify-da-javascript-client'
300300
import fs from 'node:fs'
301301

302302
let options = {
303-
'EXHORT_MVN_PATH': '/path/to/my/mvn',
304-
'EXHORT_NPM_PATH': '/path/to/npm',
305-
'EXHORT_PNPM_PATH': '/path/to/pnpm',
306-
'EXHORT_GO_PATH': '/path/to/go',
303+
'TRUSTIFY_DA_MVN_PATH': '/path/to/my/mvn',
304+
'TRUSTIFY_DA_NPM_PATH': '/path/to/npm',
305+
'TRUSTIFY_DA_PNPM_PATH': '/path/to/pnpm',
306+
'TRUSTIFY_DA_GO_PATH': '/path/to/go',
307307
//python - python3, pip3 take precedence if python version > 3 installed
308-
'EXHORT_PYTHON3_PATH' : '/path/to/python3',
309-
'EXHORT_PIP3_PATH' : '/path/to/pip3',
310-
'EXHORT_PYTHON_PATH' : '/path/to/python',
311-
'EXHORT_PIP_PATH' : '/path/to/pip',
312-
'EXHORT_GRADLE_PATH' : '/path/to/gradle',
308+
'TRUSTIFY_DA_PYTHON3_PATH' : '/path/to/python3',
309+
'TRUSTIFY_DA_PIP3_PATH' : '/path/to/pip3',
310+
'TRUSTIFY_DA_PYTHON_PATH' : '/path/to/python',
311+
'TRUSTIFY_DA_PIP_PATH' : '/path/to/pip',
312+
'TRUSTIFY_DA_GRADLE_PATH' : '/path/to/gradle',
313313
// Configure proxy for all requests
314-
'EXHORT_PROXY_URL': 'http://proxy.example.com:8080'
314+
'TRUSTIFY_DA_PROXY_URL': 'http://proxy.example.com:8080'
315315
}
316316

317317
// Get stack analysis in JSON format ( all package managers, pom.xml is as an example here)
@@ -333,13 +333,13 @@ You can set the proxy URL in two ways:
333333

334334
1. Using environment variable:
335335
```shell
336-
export EXHORT_PROXY_URL=http://proxy.example.com:8080
336+
export TRUSTIFY_DA_PROXY_URL=http://proxy.example.com:8080
337337
```
338338

339339
2. Using the options object when calling the API programmatically:
340340
```javascript
341341
const options = {
342-
'EXHORT_PROXY_URL': 'http://proxy.example.com:8080'
342+
'TRUSTIFY_DA_PROXY_URL': 'http://proxy.example.com:8080'
343343
}
344344
```
345345

@@ -362,62 +362,62 @@ following keys for setting custom paths for the said executables.
362362
<tr>
363363
<td><a href="https://maven.apache.org/">Maven</a></td>
364364
<td><em>mvn</em></td>
365-
<td>EXHORT_MVN_PATH</td>
365+
<td>TRUSTIFY_DA_MVN_PATH</td>
366366
</tr>
367367
<tr>
368368
<td><a href="https://maven.apache.org/">Maven</a></td>
369369
<td><em>maven</em></td>
370-
<td>EXHORT_PREFER_MVNW</td>
370+
<td>TRUSTIFY_DA_PREFER_MVNW</td>
371371
</tr>
372372
<tr>
373373
<td><a href="https://www.npmjs.com/">NPM</a></td>
374374
<td><em>npm</em></td>
375-
<td>EXHORT_NPM_PATH</td>
375+
<td>TRUSTIFY_DA_NPM_PATH</td>
376376
</tr>
377377
<tr>
378378
<td><a href="https://pnpm.io/">PNPM</a></td>
379379
<td><em>pnpm</em></td>
380-
<td>EXHORT_PNPM_PATH</td>
380+
<td>TRUSTIFY_DA_PNPM_PATH</td>
381381
</tr>
382382
<tr>
383383
<td><a href="https://classic.yarnpkg.com/">Yarn Classic</a> / <a href="https://yarnpkg.com/">Yarn Berry</a></td>
384384
<td><em>yarn</em></td>
385-
<td>EXHORT_YARN_PATH</td>
385+
<td>TRUSTIFY_DA_YARN_PATH</td>
386386
</tr>
387387
<tr>
388388
<td><a href="https://go.dev/blog/using-go-modules/">Go Modules</a></td>
389389
<td><em>go</em></td>
390-
<td>EXHORT_GO_PATH</td>
390+
<td>TRUSTIFY_DA_GO_PATH</td>
391391
</tr>
392392
<tr>
393393
<td><a href="https://www.python.org/">Python programming language</a></td>
394394
<td><em>python3</em></td>
395-
<td>EXHORT_PYTHON3_PATH</td>
395+
<td>TRUSTIFY_DA_PYTHON3_PATH</td>
396396
</tr>
397397
<tr>
398398
<td><a href="https://pypi.org/project/pip/">Python pip Package Installer</a></td>
399399
<td><em>pip3</em></td>
400-
<td>EXHORT_PIP3_PATH</td>
400+
<td>TRUSTIFY_DA_PIP3_PATH</td>
401401
</tr>
402402
<tr>
403403
<td><a href="https://www.python.org/">Python programming language</a></td>
404404
<td><em>python</em></td>
405-
<td>EXHORT_PYTHON_PATH</td>
405+
<td>TRUSTIFY_DA_PYTHON_PATH</td>
406406
</tr>
407407
<tr>
408408
<td><a href="https://pypi.org/project/pip/">Python pip Package Installer</a></td>
409409
<td><em>pip</em></td>
410-
<td>EXHORT_PIP_PATH</td>
410+
<td>TRUSTIFY_DA_PIP_PATH</td>
411411
</tr>
412412
<tr>
413413
<td><a href="https://gradle.org/">Gradle</a></td>
414414
<td><em>gradle</em></td>
415-
<td>EXHORT_GRADLE_PATH</td>
415+
<td>TRUSTIFY_DA_GRADLE_PATH</td>
416416
</tr>
417417
<tr>
418418
<td><a href="https://gradle.org/">Gradle</a></td>
419419
<td><em>gradle</em></td>
420-
<td>EXHORT_PREFER_GRADLEW</td>
420+
<td>TRUSTIFY_DA_PREFER_GRADLEW</td>
421421
</tr>
422422
</table>
423423

@@ -462,7 +462,7 @@ The MVS-based resolution is **enabled by default**.
462462
If you want to disable this behavior and instead include **all transitive module versions** (as listed in `go.mod` dependencies), set the system property or environment variable:
463463

464464
```bash
465-
EXHORT_GO_MVS_LOGIC_ENABLED=false
465+
TRUSTIFY_DA_GO_MVS_LOGIC_ENABLED=false
466466
```
467467

468468
#### Python Support
@@ -471,32 +471,32 @@ By default, For python support, the api assumes that the package is installed us
471471
Binaries passed to environment variables. In any case, If the package is not installed , then an error will be thrown.
472472

473473
There is an experimental feature of installing the requirements.txt on a virtual env(only python3 or later is supported for this feature) - in this case,
474-
it's important to pass in a path to python3 binary as `EXHORT_PYTHON3_PATH` or instead make sure that python3 is on the system path.
475-
in such case, You can use that feature by setting environment variable `EXHORT_PYTHON_VIRTUAL_ENV` to true.
474+
it's important to pass in a path to python3 binary as `TRUSTIFY_DA_PYTHON3_PATH` or instead make sure that python3 is on the system path.
475+
in such case, You can use that feature by setting environment variable `TRUSTIFY_DA_PYTHON_VIRTUAL_ENV` to true.
476476

477477
##### "Best Efforts Installation"
478478
Since Python pip packages are very sensitive/picky regarding python version changes( every small range of versions is only tailored for a certain python version), I'm introducing this feature, that
479479
tries to install all packages in requirements.txt onto created virtual environment while **disregarding** versions declared for packages in requirements.txt.
480480
This increasing the chances and the probability that the automatic installation will succeed.
481481

482482
###### Usage
483-
A New setting is introduced - `EXHORT_PYTHON_INSTALL_BEST_EFFORTS` (as both env variable/key in `options` object)
484-
1. `EXHORT_PYTHON_INSTALL_BEST_EFFORTS`="false" - install requirements.txt while respecting declared versions for all packages.
485-
2. `EXHORT_PYTHON_INSTALL_BEST_EFFORTS`="true" - install all packages from requirements.txt, not respecting the declared version, but trying to install a version tailored for the used python version. When using this setting, you must set setting `MATCH_MANIFEST_VERSIONS` to 'false'.
483+
A New setting is introduced - `TRUSTIFY_DA_PYTHON_INSTALL_BEST_EFFORTS` (as both env variable/key in `options` object)
484+
1. `TRUSTIFY_DA_PYTHON_INSTALL_BEST_EFFORTS`="false" - install requirements.txt while respecting declared versions for all packages.
485+
2. `TRUSTIFY_DA_PYTHON_INSTALL_BEST_EFFORTS`="true" - install all packages from requirements.txt, not respecting the declared version, but trying to install a version tailored for the used python version. When using this setting, you must set setting `MATCH_MANIFEST_VERSIONS` to 'false'.
486486

487487
##### Using `pipdeptree`
488488
By default, The API algorithm will use native commands of PIP installer as data source to build the dependency tree.
489-
It's also possible to use the lightweight Python PIP utility [pipdeptree](https://pypi.org/project/pipdeptree/) as data source instead. In order to activate this, you need to set the environment variable/option `EXHORT_PIP_USE_DEP_TREE` to 'true'.
489+
It's also possible to use the lightweight Python PIP utility [pipdeptree](https://pypi.org/project/pipdeptree/) as data source instead. In order to activate this, you need to set the environment variable/option `TRUSTIFY_DA_PIP_USE_DEP_TREE` to 'true'.
490490

491491
#### Toggle Red Hat Trusted Content recommendations
492-
Both the HTML-based report and JSON response will by default contain recommendations for migrating to Red Hat-based Trusted Content repositories. This feature can be disabled by setting `EXHORT_RECOMMENDATIONS_ENABLED` to 'false' via environment variables or options.
492+
Both the HTML-based report and JSON response will by default contain recommendations for migrating to Red Hat-based Trusted Content repositories. This feature can be disabled by setting `TRUSTIFY_DA_RECOMMENDATIONS_ENABLED` to 'false' via environment variables or options.
493493

494494
#### Additional CLI arguments
495495
For some ecosystems we support passing additional CLI arguments to the underlying tools. The following table outlines the supported ecosystems and the environment variable/option that configures this. Note that the arguments are expected to be in the format of a JSON array.
496496

497497
|Ecosystem|Key |
498498
|---------|---------------|
499-
|Maven |EXHORT_MVN_ARGS|
499+
|Maven |TRUSTIFY_DA_MVN_ARGS|
500500

501501

502502
<!-- Badge links -->
@@ -506,7 +506,7 @@ For some ecosystems we support passing additional CLI arguments to the underlyin
506506
### Known Issues
507507

508508
- For pip requirements.txt - It's been observed that for python versions 3.11.x, there might be slowness for invoking the analysis.
509-
If you encounter a performance issue with version >= 3.11.x, kindly try to set environment variable/option `EXHORT_PIP_USE_DEP_TREE=true`, before calling the analysis.
509+
If you encounter a performance issue with version >= 3.11.x, kindly try to set environment variable/option `TRUSTIFY_DA_PIP_USE_DEP_TREE=true`, before calling the analysis.
510510

511511

512512
- For maven pom.xml, it has been noticed that using java 17 might cause stack analysis to hang forever.

config/config.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
EXHORT_DEV_MODE=false
1+
TRUSTIFY_DA_DEV_MODE=false

docker-image/Dockerfiles/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ USER root
66

77
# assign token for reading packages from github package registry
88
ARG PACKAGE_REGISTRY_ACCESS_TOKEN=''
9-
ARG EXHORT_JAVASCRIPT_API_VERSION='0.1.1-ea.55'
9+
ARG TRUSTIFY_DA_JAVASCRIPT_API_VERSION='0.1.1-ea.55'
1010

1111
# install Java
1212
RUN curl -kL https://download.oracle.com/java/21/archive/jdk-21.0.1_linux-x64_bin.tar.gz -o /tmp/java-package.tar.gz \
@@ -28,7 +28,7 @@ COPY configs/.npmrc .
2828
# replace placeholder with the actual environment variable
2929
RUN sed -i "s/__PACKAGE_REGISTRY_ACCESS_TOKEN__/${PACKAGE_REGISTRY_ACCESS_TOKEN}/g" ./.npmrc
3030
# install Exhort javascript API
31-
RUN npm install --global @trustify-da/trustify-da-javascript-client@${EXHORT_JAVASCRIPT_API_VERSION}
31+
RUN npm install --global @trustify-da/trustify-da-javascript-client@${TRUSTIFY_DA_JAVASCRIPT_API_VERSION}
3232

3333
# add RHDA script
3434
COPY scripts/rhda.sh /rhda.sh
@@ -52,11 +52,11 @@ LABEL org.opencontainers.image.source=https://github.com/guacsec/trustify-da-jav
5252
# assign rhda source for exhort tracking purposes
5353
ENV RHDA_SOURCE=''
5454
# contains pip feeze --all data, base64 encoded
55-
ENV EXHORT_PIP_FREEZE=''
55+
ENV TRUSTIFY_DA_PIP_FREEZE=''
5656
# contains pip show data for all packages, base64 encoded
57-
ENV EXHORT_PIP_SHOW=''
57+
ENV TRUSTIFY_DA_PIP_SHOW=''
5858
# indicate whether to use the Minimal version selection (MVS) algorithm to select a set of module versions to use when building Go packages.
59-
ENV EXHORT_GO_MVS_LOGIC_ENABLED='true'
59+
ENV TRUSTIFY_DA_GO_MVS_LOGIC_ENABLED='true'
6060

6161
# Copy java executable from the builder stage
6262
COPY --from=builder /usr/jdk-21.0.1/ /usr/jdk-21.0.1/

docker-image/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Maven, NPM, Golang | mvn 3.9.6, <br>npm 10.2.4, <br>go 1.21.5, <br>python \<an
2020

2121
## Usage Notes
2222

23-
To perform RHDA analysis on a **Python** ecosystem, the data from both `pip freeze --all` and `pip show` commands should be generated for all packages listed in the requirements.txt manifest. This data should be encoded in base64 and passed through the `EXHORT_PIP_FREEZE` and `EXHORT_PIP_SHOW` environment variables, respectively.
23+
To perform RHDA analysis on a **Python** ecosystem, the data from both `pip freeze --all` and `pip show` commands should be generated for all packages listed in the requirements.txt manifest. This data should be encoded in base64 and passed through the `TRUSTIFY_DA_PIP_FREEZE` and `TRUSTIFY_DA_PIP_SHOW` environment variables, respectively.
2424
Code example:
2525
``` shell
2626
# Install requirements.txt
@@ -34,6 +34,6 @@ SHOW_LIST=$(awk -F '==' '{print $1}' < pip_freeze.txt)
3434
pip3 show $(echo "$SHOW_LIST") > pip_show.txt
3535

3636
# Encode data using base64 and export to environment variables
37-
export EXHORT_PIP_FREEZE=$(cat pip_freeze.txt | base64 -w 0)
38-
export EXHORT_PIP_SHOW=$(cat pip_show.txt | base64 -w 0)
37+
export TRUSTIFY_DA_PIP_FREEZE=$(cat pip_freeze.txt | base64 -w 0)
38+
export TRUSTIFY_DA_PIP_SHOW=$(cat pip_show.txt | base64 -w 0)
3939
```

integration/run_its.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#!!!!! DO NOT FORGET 'npm run compile' on root prior to running this script !!!!#
44

5-
# set EXHORT_ITS_USE_REAL_API=true to use the real backend
6-
EXHORT_ITS_USE_REAL_API="${EXHORT_ITS_USE_REAL_API:=false}"
5+
# set TRUSTIFY_DA_ITS_USE_REAL_API=true to use the real backend
6+
TRUSTIFY_DA_ITS_USE_REAL_API="${TRUSTIFY_DA_ITS_USE_REAL_API:=false}"
77

88
# utility function for wrapping up and exiting
99
# takes an exit code

integration/testers/javascript/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if ('component' === args[0]) {
2222
if ('validateToken' === args[0]) {
2323
// args[1] - the token passed
2424
let tokens = {
25-
"EXHORT_SNYK_TOKEN" : args[1]
25+
"TRUSTIFY_DA_SNYK_TOKEN" : args[1]
2626
}
2727
let res = await exhort.validateToken(tokens)
2828
console.log(res)

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
"lint": "eslint src test --ext js",
3333
"lint:fix": "eslint src test --ext js --fix",
3434
"test": "c8 npm run tests",
35-
"localtest": "EXHORT_PIP3_PATH=/home/zgrinber/python3.9/bin/pip3 EXHORT_PYTHON3_PATH=/home/zgrinber/python3.9/bin/python3 c8 npm run tests",
36-
"postlocaltest": " git status | grep src/providers/ | grep rewire | xargs -i git clean -f {}",
3735
"tests": "mocha --config .mocharc.json --grep \"Integration Tests|.*analysis module.*\" --invert",
3836
"tests:rep": "mocha --reporter-option maxDiffSize=0 --reporter json > unit-tests-result.json",
3937
"integration-tests": "mocha --grep \"Integration Tests\"",

0 commit comments

Comments
 (0)