Skip to content

Commit ab9e45f

Browse files
authored
Merge pull request #240 from ruromero/revert-trustification-oss
feat: revert trustification-ossindex customization
2 parents 23dd7f4 + 232f13c commit ab9e45f

File tree

4 files changed

+1
-47
lines changed

4 files changed

+1
-47
lines changed

deploy/exhort.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ spec:
3535
secretKeyRef:
3636
name: exhort-secret
3737
key: api-snyk-token
38-
- name: API_OSSINDEX_TRUSTIFICATION_TOKEN
39-
valueFrom:
40-
secretKeyRef:
41-
name: exhort-secret
42-
key: api-ossindex-trustification-token
43-
- name: API_OSSINDEX_TRUSTIFICATION_USER
44-
valueFrom:
45-
secretKeyRef:
46-
name: exhort-secret
47-
key: api-ossindex-trustification-user
4838
- name: MONITORING_ENABLED
4939
value: "true"
5040
- name: MONITORING_SENTRY_DSN

deploy/openshift/template.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,7 @@ objects:
147147
valueFrom:
148148
secretKeyRef:
149149
name: exhort-secret
150-
key: api-snyk-token
151-
- name: API_OSSINDEX_TRUSTIFICATION_TOKEN
152-
valueFrom:
153-
secretKeyRef:
154-
name: exhort-secret
155-
key: api-ossindex-trustification-token
156-
- name: API_OSSINDEX_TRUSTIFICATION_USER
157-
valueFrom:
158-
secretKeyRef:
159-
name: exhort-secret
160-
key: api-ossindex-trustification-user
150+
key: api-snyk-token
161151
- name: TELEMETRY_WRITE_KEY
162152
valueFrom:
163153
secretKeyRef:

src/main/java/com/redhat/exhort/integration/providers/ossindex/OssIndexIntegration.java

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

2121
import java.util.Base64;
2222
import java.util.List;
23-
import java.util.Optional;
2423

2524
import org.apache.camel.Exchange;
2625
import org.apache.camel.builder.AggregationStrategies;
@@ -40,17 +39,9 @@
4039
@ApplicationScoped
4140
public class OssIndexIntegration extends EndpointRouteBuilder {
4241

43-
private static final String TRUSTIFICATION_SOURCE = "trustification";
44-
4542
@ConfigProperty(name = "api.ossindex.timeout", defaultValue = "10s")
4643
String timeout;
4744

48-
@ConfigProperty(name = "api.ossindex.trustification.user")
49-
Optional<String> trustificationUser;
50-
51-
@ConfigProperty(name = "api.ossindex.trustification.token")
52-
Optional<String> trustificationToken;
53-
5445
@Inject VulnerabilityProvider vulnerabilityProvider;
5546

5647
@Inject OssIndexResponseHandler responseHandler;
@@ -64,7 +55,6 @@ public void configure() {
6455
from(direct("ossIndexScan"))
6556
.routeId("ossIndexScan")
6657
.transform(method(OssIndexRequestBuilder.class, "split"))
67-
.process(this::authenticateTrustificationSource)
6858
.choice()
6959
.when(method(OssIndexRequestBuilder.class, "missingAuthHeaders"))
7060
.setBody(method(OssIndexResponseHandler.class, "unauthenticatedResponse"))
@@ -127,17 +117,4 @@ private void processComponentRequest(Exchange exchange) {
127117
message.removeHeader(Constants.OSS_INDEX_USER_HEADER);
128118
message.removeHeader(Constants.OSS_INDEX_TOKEN_HEADER);
129119
}
130-
131-
private void authenticateTrustificationSource(Exchange exchange) {
132-
var headers = exchange.getIn().getHeaders();
133-
var source = headers.get(Constants.RHDA_SOURCE_HEADER);
134-
if (!TRUSTIFICATION_SOURCE.equals(source)) {
135-
return;
136-
}
137-
if (!headers.containsKey(Constants.OSS_INDEX_USER_HEADER)
138-
&& !headers.containsKey(Constants.OSS_INDEX_TOKEN_HEADER)) {
139-
headers.put(Constants.OSS_INDEX_USER_HEADER, trustificationUser.orElse(null));
140-
headers.put(Constants.OSS_INDEX_TOKEN_HEADER, trustificationToken.orElse(null));
141-
}
142-
}
143120
}

src/main/resources/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ project.name=${pom.name}
55
project.version=${pom.version}
66
project.build=${timestamp}
77

8-
9-
10-
118
api.snyk.token=placeholder
129
api.snyk.host=https://app.snyk.io/api/v1
1310
# api.snyk.timeout=10s

0 commit comments

Comments
 (0)