Skip to content

Commit

Permalink
Added core to GitHub apps
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasm-ttd committed Mar 1, 2024
1 parent 112c9ec commit e55308f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/test/java/app/GitHubTestPipelineApps.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@

import app.common.EnvUtil;
import app.component.Operator;
import app.component.Core;

import java.util.Set;

public class GitHubTestPipelineApps extends Apps {
private static final String OPERATOR_URL = EnvUtil.getEnv("UID2_E2E_PIPELINE_OPERATOR_URL");
private static final Operator.Type OPERATOR_TYPE = Operator.Type.valueOf(EnvUtil.getEnv("UID2_E2E_PIPELINE_OPERATOR_TYPE"));
private static final Operator.CloudProvider OPERATOR_CLOUD_PROVIDER = Operator.CloudProvider.valueOf(EnvUtil.getEnv("UID2_E2E_PIPELINE_OPERATOR_CLOUD_PROVIDER"));

private static final String CORE_URL = EnvUtil.getEnv("UID2_E2E_CORE_URL");
private static final String OPERATOR_NAME = OPERATOR_TYPE == Operator.Type.PUBLIC
? "GitHub Test Pipeline - Public Operator"
: "GitHub Test Pipeline - Private %s Operator".formatted(OPERATOR_CLOUD_PROVIDER.toString());

public GitHubTestPipelineApps() {
super(Set.of(
new Operator(OPERATOR_URL, OPERATOR_NAME, OPERATOR_TYPE)
new Operator(OPERATOR_URL, OPERATOR_NAME, OPERATOR_TYPE),
new Core(CORE_URL, "GitHub Test Pipeline - Core")
));
}
}
4 changes: 4 additions & 0 deletions src/test/java/app/component/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public Core(String host, Integer port, String name) {
super(host, port, name);
}

public Core(String host, String name) {
super(host, null, name);
}

public String attest(String attestationRequest) throws Exception {
String response = HttpClient.post(getBaseUrl() + "/attest", attestationRequest, CORE_API_TOKEN);
return response;
Expand Down

0 comments on commit e55308f

Please sign in to comment.