From 6764a2202fff34591384371ae0b052aef0987b9e Mon Sep 17 00:00:00 2001 From: Travis Tomsu Date: Wed, 7 Jun 2017 15:20:00 -0400 Subject: [PATCH] fix(api-docs): Pull in new swagger library & include Auth controller in generated docs --- build.gradle | 2 +- gate-web/config/gate.yml | 1 + .../gate/controllers/AuthController.groovy | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 12fdce0742..20e9a62457 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ allprojects { apply plugin: 'groovy' ext { - spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.91.0' + spinnakerDependenciesVersion = project.hasProperty('spinnakerDependenciesVersion') ? project.property('spinnakerDependenciesVersion') : '0.92.0' } def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion] diff --git a/gate-web/config/gate.yml b/gate-web/config/gate.yml index 562ee4cc8f..45de3a661c 100644 --- a/gate-web/config/gate.yml +++ b/gate-web/config/gate.yml @@ -54,6 +54,7 @@ swagger: contact: patterns: - .*tasks.* + - .*auth.* - .*applications.* - .*securityGroups.* - /search diff --git a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/AuthController.groovy b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/AuthController.groovy index be470666a2..f040ef1c3f 100644 --- a/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/AuthController.groovy +++ b/gate-web/src/main/groovy/com/netflix/spinnaker/gate/controllers/AuthController.groovy @@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestMethod import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController +import springfox.documentation.annotations.ApiIgnore import javax.servlet.http.HttpServletResponse import java.util.regex.Pattern @@ -68,8 +69,8 @@ class AuthController { } } - @RequestMapping("/user") - User user(@SpinnakerUser User user) { + @RequestMapping(value = "/user", method = RequestMethod.GET) + User user(@ApiIgnore @SpinnakerUser User user) { if (!user) { return user } @@ -81,12 +82,12 @@ class AuthController { return user } - @RequestMapping("/user/serviceAccounts") - List getServiceAccounts(@SpinnakerUser User user) { + @RequestMapping(value = "/user/serviceAccounts", method = RequestMethod.GET) + List getServiceAccounts(@ApiIgnore @SpinnakerUser User user) { permissionService.getServiceAccounts(user) } - @RequestMapping("/loggedOut") + @RequestMapping(value = "/loggedOut", method = RequestMethod.GET) String loggedOut() { return LOGOUT_MESSAGES[r.nextInt(LOGOUT_MESSAGES.size()+1)] } @@ -104,7 +105,7 @@ class AuthController { } } - @RequestMapping("/redirect") + @RequestMapping(value = "/redirect", method = RequestMethod.GET) void redirect(HttpServletResponse response, @RequestParam String to) { validDeckRedirect(to) ? response.sendRedirect(to) :