From fd8fbee9fd5fea64f3e35f49c50256a91ac767b3 Mon Sep 17 00:00:00 2001 From: Pranav-b-7 Date: Thu, 4 Feb 2021 21:59:27 +0530 Subject: [PATCH 1/3] bug fix --- .../spinnaker/gate/controllers/OpsmxAutopilotController.groovy | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy index 6ee3506fbc..83b6446483 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/OpsmxAutopilotController.groovy @@ -16,6 +16,7 @@ package com.netflix.spinnaker.gate.controllers +import com.google.gson.Gson import com.netflix.spinnaker.gate.config.ServiceConfiguration import com.netflix.spinnaker.gate.model.ApprovalGateTriggerResponseModel import com.netflix.spinnaker.gate.model.RegisterCanaryResponseModel @@ -64,6 +65,8 @@ class OpsmxAutopilotController { @Autowired OpsmxAutopilotService opsmxAutopilotService + Gson gson = new Gson() + @ApiOperation(value = "Endpoint for autopilot rest services") @RequestMapping(value = "/{type}", method = RequestMethod.GET) Object getAutoResponse1(@PathVariable("type") String type) { From bd6e5feefe25c367fe93d60626d9a0a0766dcd15 Mon Sep 17 00:00:00 2001 From: Pranav-b-7 Date: Fri, 5 Feb 2021 08:37:34 +0530 Subject: [PATCH 2/3] added getters and setter --- .../gate/model/RegisterCanaryResponseModel.groovy | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/model/RegisterCanaryResponseModel.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/model/RegisterCanaryResponseModel.groovy index 20e594c5a3..28057ba8a9 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/model/RegisterCanaryResponseModel.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/model/RegisterCanaryResponseModel.groovy @@ -19,4 +19,12 @@ package com.netflix.spinnaker.gate.model class RegisterCanaryResponseModel { private Integer canaryId; + + Integer getCanaryId() { + return canaryId + } + + void setCanaryId(Integer canaryId) { + this.canaryId = canaryId + } } From 4a3515437644a94cd169f2a03a02864c03d330e4 Mon Sep 17 00:00:00 2001 From: Pranav-b-7 Date: Fri, 5 Feb 2021 09:07:25 +0530 Subject: [PATCH 3/3] auth by pass for /autopilot/api/v2/autopilot/canaries/{id} API --- .../com/netflix/spinnaker/gate/config/AuthConfig.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy b/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy index 6c6b09e7c6..565568c290 100644 --- a/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy +++ b/gate-core/src/main/groovy/com/netflix/spinnaker/gate/config/AuthConfig.groovy @@ -96,6 +96,8 @@ class AuthConfig { .antMatchers(PermissionRevokingLogoutSuccessHandler.LOGGED_OUT_URL).permitAll() .antMatchers('/auth/user').permitAll() .antMatchers(HttpMethod.POST,'/autopilot/registerCanary').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/api/v2/autopilot/canaries/{id}').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/api/v1/autopilot/canaries/{id}').permitAll() .antMatchers(HttpMethod.POST,'/autopilot/api/v1/registerCanary').permitAll() .antMatchers(HttpMethod.POST,'/autopilot/api/v2/registerCanary').permitAll() .antMatchers(HttpMethod.GET,'/autopilot/canaries/{id}').permitAll() @@ -146,6 +148,8 @@ class AuthConfig { .antMatchers(HttpMethod.POST,'/autopilot/api/v1/registerCanary').permitAll() .antMatchers(HttpMethod.POST,'/autopilot/api/v2/registerCanary').permitAll() .antMatchers(HttpMethod.GET,'/autopilot/canaries/{id}').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/api/v2/autopilot/canaries/{id}').permitAll() + .antMatchers(HttpMethod.GET,'/autopilot/api/v1/autopilot/canaries/{id}').permitAll() .antMatchers(HttpMethod.POST,'/visibilityservice/v1/approvalGates/{id}/trigger').permitAll() .antMatchers(HttpMethod.POST,'/visibilityservice/v2/approvalGates/{id}/trigger').permitAll() .antMatchers(HttpMethod.GET,'/visibilityservice/v2/approvalGateInstances/{id}/status').permitAll()