Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto configuration most parts now done #2092
- health check parts added - auto prepare some parts added - executors, profiles and projects are now configured completely (and it is possible to restart the setup, old data is automatically removed except old but now unused executor configurations) - credentials are still missing for PDS solution
- Loading branch information
Showing
28 changed files
with
789 additions
and
276 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
40 changes: 40 additions & 0 deletions
40
...c/main/java/com/mercedesbenz/sechub/api/internal/OpenApiSecHubClientConversionHelper.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,40 @@ | ||
package com.mercedesbenz.sechub.api.internal; | ||
|
||
import java.util.List; | ||
|
||
import com.mercedesbenz.sechub.api.internal.gen.AdminApi; | ||
import com.mercedesbenz.sechub.api.internal.gen.invoker.ApiException; | ||
import com.mercedesbenz.sechub.api.internal.gen.model.OpenApiExecutionProfileFetch; | ||
import com.mercedesbenz.sechub.api.internal.gen.model.OpenApiExecutionProfileFetchConfigurationsInner; | ||
import com.mercedesbenz.sechub.api.internal.gen.model.OpenApiExecutionProfileUpdate; | ||
import com.mercedesbenz.sechub.api.internal.gen.model.OpenApiExecutionProfileUpdateConfigurationsInner; | ||
|
||
public class OpenApiSecHubClientConversionHelper { | ||
|
||
private AdminApi adminApi; | ||
|
||
public OpenApiSecHubClientConversionHelper(AdminApi adminApi) { | ||
this.adminApi = adminApi; | ||
} | ||
|
||
public OpenApiExecutionProfileUpdate fetchProfileAndConvertToUpdateObject(String profileId) throws ApiException { | ||
OpenApiExecutionProfileUpdate update = new OpenApiExecutionProfileUpdate(); | ||
|
||
OpenApiExecutionProfileFetch fetched = adminApi.adminFetchesExecutionProfile(profileId); | ||
update.setDescription(fetched.getDescription()); | ||
update.setEnabled(fetched.getEnabled()); | ||
List<OpenApiExecutionProfileFetchConfigurationsInner> fetchedConfigurations = fetched.getConfigurations(); | ||
|
||
for (OpenApiExecutionProfileFetchConfigurationsInner fetchedConfiguration : fetchedConfigurations) { | ||
/* we only need the uuid on server side - everything else is ignored */ | ||
String uuid = fetchedConfiguration.getUuid(); | ||
|
||
/* add to update again */ | ||
OpenApiExecutionProfileUpdateConfigurationsInner existingItem = new OpenApiExecutionProfileUpdateConfigurationsInner(); | ||
existingItem.setUuid(uuid); | ||
update.addConfigurationsItem(existingItem); | ||
} | ||
return update; | ||
} | ||
|
||
} |
Oops, something went wrong.