-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move configuration services to configuration package #2513
- Loading branch information
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...sbenz/sechub/webui/CredentialService.java → ...ebui/configuration/CredentialService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...-webui/src/main/java/com/mercedesbenz/sechub/webui/configuration/SecHubAccessService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |