diff options
author | Piotr Borelowski <p.borelowski@partner.samsung.com> | 2019-09-10 13:48:01 +0200 |
---|---|---|
committer | Piotr Borelowski <p.borelowski@partner.samsung.com> | 2019-09-10 13:48:36 +0200 |
commit | 0107aa9f0f2101110e3d1a79602a3e663bbbf8c8 (patch) | |
tree | e12390f98486829c4748b0d19beadabb3f7d0a66 /workflow-designer-be/src/main | |
parent | 8d870958cac0eaf35b5a99597bdcf8a9acfbd652 (diff) |
Stop Swagger UI interface in workflow-designer-be
Implemented DisableSwaggerController to respond with NOT_FOUND status
when asked for swagger-ui.html.
Issue-ID: OJSI-31
Signed-off-by: Piotr Borelowski <p.borelowski@partner.samsung.com>
Change-Id: I0dd580cb7a936c28c028dd6c1168468c40a9dc3b
Diffstat (limited to 'workflow-designer-be/src/main')
-rw-r--r-- | workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java new file mode 100644 index 00000000..44aa8bb7 --- /dev/null +++ b/workflow-designer-be/src/main/java/org/onap/sdc/workflow/api/DisableSwaggerController.java @@ -0,0 +1,33 @@ +/* + * Copyright © 2019 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.sdc.workflow.api; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.context.annotation.Profile; +import org.springframework.http.HttpStatus; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Profile("!dev") +@RestController +public class DisableSwaggerController { + @RequestMapping("swagger-ui.html") + public void swagger(HttpServletResponse response) { + response.setStatus(HttpStatus.NOT_FOUND.value()); + } +} |