-
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.
Merge pull request #2563 from mercedes-benz/develop
Release ZAP wrapper
- Loading branch information
Showing
123 changed files
with
4,919 additions
and
2,624 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
|
@@ -33,7 +33,7 @@ jobs: | |
with: | ||
go-version: 1.20.4 | ||
|
||
- uses: actions/[email protected].1 | ||
- uses: actions/[email protected].2 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
|
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
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 |
---|---|---|
|
@@ -63,7 +63,7 @@ jobs: | |
exit 1 | ||
- name: Checkout master | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: master | ||
# Create temporary local tags, so we build documentation for this tag... | ||
|
@@ -97,7 +97,7 @@ jobs: | |
go-version: 1.20.4 | ||
|
||
- name: Set up Go caching | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
id: go-cache | ||
with: | ||
path: | | ||
|
@@ -108,7 +108,7 @@ jobs: | |
${{ runner.os }}-go- | ||
- name: Docker login to ghcr.io | ||
uses: docker/login-action@v2 | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
|
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
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
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
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 |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
| Jeremias Eppler | <[email protected]> | [jeeppler](https://github.com/jeeppler) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2021-01-01 | | ||
| Jan Winz | <[email protected]> | [winzj](https://github.com/winzj) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2021-07-01 | | ||
| Rouven Härtel | <[email protected]> | [haerter-tss](https://github.com/haerter-tss) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2022-02-01 | | ||
| Laura Bottner | <[email protected]> | [lorriborri](hhttps://github.com/lorriborri) | Mercedes-Benz Tech Innovation GmbH, [imprint](https://github.com/mercedes-benz/foss/blob/master/PROVIDER_INFORMATION.md) | 2023-09-06 | | ||
|
||
|
||
## Emeritus Maintainers | ||
|
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
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
101 changes: 101 additions & 0 deletions
101
sechub-api-java/src/main/java/com/mercedesbenz/sechub/api/AbstractSecHubClient.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,101 @@ | ||
package com.mercedesbenz.sechub.api; | ||
|
||
import java.net.URI; | ||
import java.util.LinkedHashSet; | ||
import java.util.Set; | ||
|
||
import javax.crypto.SealedObject; | ||
|
||
import com.mercedesbenz.sechub.commons.core.security.CryptoAccess; | ||
|
||
public abstract class AbstractSecHubClient implements SecHubClient { | ||
|
||
private boolean trustAll; | ||
private String username; | ||
private SealedObject sealedApiToken; | ||
private URI serverUri; | ||
private CryptoAccess<String> apiTokenAccess = new CryptoAccess<>(); | ||
|
||
private Set<SecHubClientListener> secHubClientListeners; | ||
|
||
public AbstractSecHubClient() { | ||
secHubClientListeners = new LinkedHashSet<>(); | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
public void setApiToken(String apiToken) { | ||
this.sealedApiToken = apiTokenAccess.seal(apiToken); | ||
} | ||
|
||
public void setServerUri(URI serverUri) { | ||
this.serverUri = serverUri; | ||
} | ||
|
||
public void setTrustAll(boolean trustAll) { | ||
this.trustAll = trustAll; | ||
} | ||
|
||
@Override | ||
public boolean isTrustAll() { | ||
return trustAll; | ||
} | ||
|
||
@Override | ||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
@Override | ||
public String getSealedApiToken() { | ||
return apiTokenAccess.unseal(sealedApiToken); | ||
} | ||
|
||
@Override | ||
public URI getServerUri() { | ||
return serverUri; | ||
} | ||
|
||
/** | ||
* Adds a listener to the client. For some action on client side the listener | ||
* will be informed. A listener can be added only one time no matter how many | ||
* times this method is called. | ||
* | ||
* @param listener | ||
*/ | ||
@Override | ||
public void addListener(SecHubClientListener listener) { | ||
if (listener == null) { | ||
return; | ||
} | ||
this.secHubClientListeners.add(listener); | ||
} | ||
|
||
/** | ||
* Removes a listener from the client (if added). | ||
* | ||
* @param listener | ||
*/ | ||
@Override | ||
public void removeListener(SecHubClientListener listener) { | ||
if (listener == null) { | ||
return; | ||
} | ||
this.secHubClientListeners.remove(listener); | ||
} | ||
|
||
void inform(SecHubClientListenerCaller r) { | ||
for (SecHubClientListener listener : secHubClientListeners) { | ||
r.inform(listener); | ||
} | ||
} | ||
|
||
interface SecHubClientListenerCaller { | ||
|
||
public void inform(SecHubClientListener listener); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.