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 5, 2024
1 parent 98cee10 commit eac901b
Show file tree
Hide file tree
Showing 35 changed files with 44 additions and 93 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
19 changes: 0 additions & 19 deletions web/src/main/java/com/navercorp/pinpoint/web/WebServerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@
import com.navercorp.pinpoint.web.servlet.HttpIntentRoutingFilter;
import com.navercorp.pinpoint.web.servlet.VersionPrefixRewriter;
import jakarta.servlet.Filter;
import jakarta.servlet.MultipartConfigElement;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.boot.web.servlet.support.ErrorPageFilter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ShallowEtagHeaderFilter;
import org.springframework.web.servlet.DispatcherServlet;

import java.util.List;

Expand Down Expand Up @@ -48,17 +42,4 @@ public PerformanceLoggingInterceptor performanceLoggingInterceptor(
@Value("${pinpoint.web.performance-logging-interceptor.threshold:3000}") int threshold) {
return new PerformanceLoggingInterceptor(threshold);
}

@Bean
public ServletRegistrationBean<DispatcherServlet> servletRegistrationBean(
DispatcherServlet dispatcherServlet,
WebMvcProperties webMvcProperties,
ObjectProvider<MultipartConfigElement> multipartConfig) {

final ServletRegistrationBean<DispatcherServlet> bean = new ServletRegistrationBean<>(dispatcherServlet, "/api/*", "/monitor/*");
bean.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
bean.setLoadOnStartup(webMvcProperties.getServlet().getLoadOnStartup());
bean.setMultipartConfig(multipartConfig.getObject());
return bean;
}
}
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
Loading

0 comments on commit eac901b

Please sign in to comment.