Skip to content

Commit

Permalink
Merge pull request #22 from jenkinsci/moving_to_v1_endpoints
Browse files Browse the repository at this point in the history
Moving v1alpha endpoint to v1 endpoint
  • Loading branch information
sanyam803 authored Mar 12, 2024
2 parents 6d8afd4 + f6e6f34 commit 1c5fa28
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
* validating and processing response.
*/
public class IACValidationService {
private static final String VALIDATE_ENDPOINT_DOMAIN = "https://securityposture.googleapis.com/v1alpha";
private static final String VALIDATE_ENDPOINT_DOMAIN = "https://securityposture.googleapis.com/v1";
private static final String VALIDATE_ENDPOINT_PATH =
"/organizations/{ORG_ID}/locations/global/reports:createIaCValidationReport";
private static final String VALIDATE_URL = VALIDATE_ENDPOINT_DOMAIN + VALIDATE_ENDPOINT_PATH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,40 +74,40 @@ public class IACValidationServiceTest {
private static final String DUMMY_JSON_POLL_ENDPOINT_RES = "{\n"
+ " \"name\": \"organizations/627849321070/locations/global/operations/operation-1704446435860-60e2f5c592090-44537b85-4e5c383b\",\n"
+ " \"metadata\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.OperationMetadata\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata\",\n"
+ " \"createTime\": \"2024-01-05T09:20:35.889386783Z\",\n"
+ " \"target\": \"organizations/627849321070/locations/global/reports/f501fae7-6e6b-4058-8782-c80670022f3e\",\n"
+ " \"verb\": \"create\",\n"
+ " \"requestedCancellation\": false,\n"
+ " \"apiVersion\": \"v1alpha\"\n"
+ " \"apiVersion\": \"v1\"\n"
+ " },\n"
+ " \"done\": false\n"
+ "}";
private static final String DUMMY_JSON_EMPTY_POLL_ENDPOINT_RES = "{\n" + " \"name\": \"\",\n"
+ " \"metadata\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.OperationMetadata\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata\",\n"
+ " \"createTime\": \"2024-01-05T09:20:35.889386783Z\",\n"
+ " \"target\": \"organizations/627849321070/locations/global/reports/f501fae7-6e6b-4058-8782-c80670022f3e\",\n"
+ " \"verb\": \"create\",\n"
+ " \"requestedCancellation\": false,\n"
+ " \"apiVersion\": \"v1alpha\"\n"
+ " \"apiVersion\": \"v1\"\n"
+ " },\n"
+ " \"done\": false\n"
+ "}";
private static final String DUMMY_JSON_EMPTY_VIOLATIONS_RES = "{\n"
+ " \"name\": \"organizations/627849321070/locations/global/operations/operation-1704444122295-60e2ed272ed68-625d72a8-6fd29abb\",\n"
+ " \"metadata\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.OperationMetadata\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata\",\n"
+ " \"createTime\": \"2024-01-05T08:42:02.325485680Z\",\n"
+ " \"endTime\": \"2024-01-05T08:42:02.473852683Z\",\n"
+ " \"target\": \"organizations/627849321070/locations/global/reports/142336eb-5c66-4283-bb3e-681595ac0644\",\n"
+ " \"verb\": \"create\",\n"
+ " \"requestedCancellation\": false,\n"
+ " \"apiVersion\": \"v1alpha\"\n"
+ " \"apiVersion\": \"v1\"\n"
+ " },\n"
+ " \"done\": true,\n"
+ " \"response\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.Report\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.Report\",\n"
+ " \"name\": \"organizations/627849321070/locations/global/reports/142336eb-5c66-4283-bb3e-681595ac0644\",\n"
+ " \"createTime\": \"2024-01-05T08:42:02.302457702Z\",\n"
+ " \"updateTime\": \"2024-01-05T08:42:02.302457702Z\",\n"
Expand All @@ -117,17 +117,17 @@ public class IACValidationServiceTest {
private static final String DUMMY_JSON_NON_EMPTY_VIOLATIONS_RES = "{\n"
+ " \"name\": \"organizations/627849321070/locations/global/operations/operation-1703707216002-60d833f693fab-94a01344-ae728e4f\",\n"
+ " \"metadata\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.OperationMetadata\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.OperationMetadata\",\n"
+ " \"createTime\": \"2024-12-27T20:00:16.070421839Z\",\n"
+ " \"endTime\": \"2024-12-27T20:00:16.126303630Z\",\n"
+ " \"target\": \"organizations/627849321070/locations/global/reports/182db54a-95de-4c10-b9f9-624a92ab8e3c\",\n"
+ " \"verb\": \"create\",\n"
+ " \"requestedCancellation\": false,\n"
+ " \"apiVersion\": \"v1alpha\"\n"
+ " \"apiVersion\": \"v1\"\n"
+ " },\n"
+ " \"done\": true,\n"
+ " \"response\": {\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1alpha.Report\",\n"
+ " \"@type\": \"type.googleapis.com/google.cloud.securityposture.v1.Report\",\n"
+ " \"name\": \"organizations/627849321070/locations/global/reports/182db54a-95de-4c10-b9f9-624a92ab8e3c\",\n"
+ " \"createTime\": \"2024-12-27T20:00:16.012019593Z\",\n"
+ " \"updateTime\": \"2024-12-27T20:00:16.012019593Z\",\n"
Expand Down Expand Up @@ -359,7 +359,7 @@ private Response buildResponse(final List<Violation> violations) {
.target("organizations/627849321070/locations/global/reports/142336eb-5c66-4283-bb3e-681595ac0644")
.verb("create")
.requestedCancellation(false)
.apiVersion("v1alpha")
.apiVersion("v1")
.build();
return Response.builder()
.name(
Expand Down

0 comments on commit 1c5fa28

Please sign in to comment.