Skip to content

Commit

Permalink
Move configuration services to configuration package #2513
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeeppler committed Sep 27, 2023
1 parent 0814795 commit 21210b9
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
package com.mercedesbenz.sechub.webui;
package com.mercedesbenz.sechub.webui.configuration;

import javax.annotation.PostConstruct;
import javax.crypto.SealedObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.mercedesbenz.sechub.webui.configuration;

import java.net.URI;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.mercedesbenz.sechub.api.MockedSecHubClient;
import com.mercedesbenz.sechub.api.SecHubClient;

@Service
public class SecHubAccessService {
@Value("${sechub.server-url}")
private String secHubServerUrl;

@Value("${sechub.trust-all-certificates}")
private boolean trustAllCertificates;

private SecHubClient client;

@PostConstruct
void setupSecHubClient() {
URI serverUri = URI.create(secHubServerUrl);

this.client = MockedSecHubClient.from(serverUri, "mocked", "verySecretTrustMe", trustAllCertificates);
}

public SecHubClient getSecHubClient() {
return this.client;
}

public URI getSecHubServerUri() {
return this.client.getServerUri();
}
}

0 comments on commit 21210b9

Please sign in to comment.