Skip to content

Commit

Permalink
[#11123] Add '/api' explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
donghun-cho committed Jun 4, 2024
1 parent b247b12 commit 85b8188
Show file tree
Hide file tree
Showing 34 changed files with 45 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
* @author intr3p1d
*/
@RestController
@RequestMapping(value = "/errors")
@RequestMapping(value = "/api/errors")
@Validated
public class ExceptionTraceController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* @author minwoo.jung
*/
@RestController
@RequestMapping("/inspector/agentStat")
@RequestMapping("/api/inspector/agentStat")
public class AgentInspectorStatController {

private final TimeWindowSampler DEFAULT_TIME_WINDOW_SAMPLER = new TimeWindowSlotCentricSampler(5000L, 200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Objects;

@RestController
@RequestMapping("/inspector/applicationStat")
@RequestMapping("/api/inspector/applicationStat")
public class ApplicationInspectorStatController {
private final TimeWindowSampler DEFAULT_TIME_WINDOW_SAMPLER_30M = new TimeWindowSlotCentricSampler(30000L, 200);
private final TenantProvider tenantProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @author Hyunjoon Cho
*/
@RestController
@RequestMapping(value = "/systemMetric")
@RequestMapping(value = "/api/systemMetric")
public class SystemMetricController {
private final SystemMetricDataService systemMetricDataService;
private final SystemMetricHostInfoService systemMetricHostInfoService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping(value = "/uriStat")
@RequestMapping(value = "/api/uriStat")
public class UriStatController {
private final UriStatSummaryService uriStatService;
private final TenantProvider tenantProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public ServletRegistrationBean<DispatcherServlet> servletRegistrationBean(
WebMvcProperties webMvcProperties,
ObjectProvider<MultipartConfigElement> multipartConfig) {

final ServletRegistrationBean<DispatcherServlet> bean = new ServletRegistrationBean<>(dispatcherServlet, "/api/*", "/monitor/*");
final ServletRegistrationBean<DispatcherServlet> bean = new ServletRegistrationBean<>(dispatcherServlet);

Check warning on line 58 in web/src/main/java/com/navercorp/pinpoint/web/WebServerConfig.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/WebServerConfig.java#L58

Added line #L58 was not covered by tests
bean.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
bean.setLoadOnStartup(webMvcProperties.getServlet().getLoadOnStartup());
bean.setMultipartConfig(multipartConfig.getObject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.apache.logging.log4j.Logger;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -54,6 +55,7 @@
* @author jaehong.kim
*/
@RestController
@RequestMapping("/api")
@Validated
public class FilteredMapController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -65,6 +66,7 @@
* @author HyunGil Jeong
*/
@RestController
@RequestMapping("/api")
@Validated
public class MapController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* @author Taejin Koo
*/
@RestController
@RequestMapping("/agent")
@RequestMapping("/api/agent")
@Validated
public class ActiveThreadDumpController {
private final ConfigProperties webProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @author HyunGil Jeong
*/
@RestController
@RequestMapping("/admin")
@RequestMapping("/api/admin")
@Validated
public class AdminController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* @author HyunGil Jeong
*/
@RestController
@RequestMapping("/api")
@Validated
public class AgentInfoController {
private final AgentInfoService agentInfoService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
* @author intr3p1d
*/
@RestController
@RequestMapping(value = "/agents")
@RequestMapping(value = "/api/agents")
@Validated
public class AgentListController {
private final AgentInfoService agentInfoService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author HyunGil Jeong
*/
@RestController
@RequestMapping("/getAgentStat/{chartType}")
@RequestMapping("/api/getAgentStat/{chartType}")
@Validated
public class AgentStatController<DP extends AgentStatDataPoint> {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author minwoo.jung
*/
@RestController
@RequestMapping(value={"/alarmRule", "/application/alarmRule"})
@RequestMapping(value={"/api/alarmRule", "/api/application/alarmRule"})
@Validated
public class AlarmController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
import org.apache.logging.log4j.Logger;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
@Validated
public class ApplicationDataSourceController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.Map;

@RestController
@RequestMapping("/getApplicationStat/{chartType}/chart")
@RequestMapping("/api/getApplicationStat/{chartType}/chart")
@Validated
public class ApplicationStatController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.concurrent.TimeUnit;

@RestController()
@RequestMapping("/heatmap")
@RequestMapping("/api/heatmap")
@Validated
public class HeatMapController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -53,6 +54,7 @@
import java.util.Objects;

@RestController
@RequestMapping("/api")
public class ResponseTimeController {
private final Logger logger = LogManager.getLogger(this.getClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -56,6 +57,7 @@
* @author jaehong.kim
*/
@RestController
@RequestMapping("/api")
@Validated
public class ScatterChartController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* @author minwoo.jung
*/
@RestController
@RequestMapping(value = "/user")
@RequestMapping("/api/user")
@Validated
public class UserController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* @author minwoo.jung
*/
@RestController
@RequestMapping(value = "/userGroup")
@RequestMapping(value = "/api/userGroup")
@Validated
public class UserGroupController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @author minwoo.jung
*/
@RestController
@RequestMapping(value = {"/alarmRule", "/application/alarmRule"})
@RequestMapping(value = {"/api/alarmRule", "/api/application/alarmRule"})
@ConditionalOnProperty(name = WebhookModule.NAME, havingValue = "true", matchIfMissing = true)
public class WebhookAlarmController {
private final WebhookAlarmServiceFacade webhookAlarmServiceFacade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ResponseStatusException;
Expand All @@ -39,6 +40,7 @@
* @author Taejin Koo
*/
@RestController
@RequestMapping("/api")
@Validated
public class AgentStatisticsController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
import jakarta.validation.constraints.PositiveOrZero;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

@RestController
@RequestMapping("/api")
@Validated
public class ApdexScoreController {
private static final TimeWindowSampler APDEX_SCORE_TIME_WINDOW_SAMPLER = new TimeWindowSlotCentricSampler(60 * 1000, 200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
*/

@RestController
@RequestMapping("/api")
@Validated
public class ApplicationController {
public static final int MAX_PAGING_LIMIT = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
Expand All @@ -58,6 +59,7 @@
* @author Taejin Koo
*/
@RestController
@RequestMapping("/api")
@Validated
public class BusinessTransactionController {
private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

Expand All @@ -43,6 +44,7 @@
* @author netspider
*/
@RestController
@RequestMapping("/api")
@Validated
public class MainController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.Map;

@RestController
@RequestMapping(value={"/error"})
@RequestMapping(value={"/api/error"})
@Validated
public class NonWhiteLabelErrorController extends AbstractErrorController {
private final ErrorProperties errorProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.LinkedHashMap;
Expand All @@ -31,6 +32,7 @@
* @author HyunGil Jeong
*/
@RestController
@RequestMapping("/api")
public class FrontendConfigController {

private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Objects;

@RestController
@RequestMapping("/api")
public class AgentDownloadController {

private final AgentDownLoadService agentDownLoadService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

@RestController
@RequestMapping("/api")
public class QueryController {

private final Logger logger = LogManager.getLogger(this.getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.Objects;

@RestController
@RequestMapping("/command")
@RequestMapping("/api/command")
@Validated
public class EchoController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.Objects;

@RestController
@RequestMapping(value={"/webhook", "/application/webhook"})
@RequestMapping(value={"/api/webhook", "/api/application/webhook"})
public class WebhookController {
private final Logger logger = LogManager.getLogger(this.getClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.Objects;

@RestController
@RequestMapping(value={"/webhookSendInfo", "/application/webhookSendInfo"})
@RequestMapping(value={"/api/webhookSendInfo", "/api/application/webhookSendInfo"})
public class WebhookSendInfoController {
private final Logger logger = LogManager.getLogger(this.getClass());

Expand Down

0 comments on commit 85b8188

Please sign in to comment.