Skip to content

[#14036] Move agent list endpoint out of admin API#14059

Merged
donghun-cho merged 1 commit into
pinpoint-apm:masterfrom
donghun-cho:removePasswordCheck
Jul 23, 2026
Merged

[#14036] Move agent list endpoint out of admin API#14059
donghun-cho merged 1 commit into
pinpoint-apm:masterfrom
donghun-cho:removePasswordCheck

Conversation

@donghun-cho

Copy link
Copy Markdown
Contributor

No description provided.

@donghun-cho donghun-cho added this to the 4.0.0 milestone Jul 23, 2026
@donghun-cho
donghun-cho requested a review from Copilot July 23, 2026 08:12
@donghun-cho donghun-cho self-assigned this Jul 23, 2026
@donghun-cho
donghun-cho force-pushed the removePasswordCheck branch from 28940ad to 788be12 Compare July 23, 2026 08:13
@donghun-cho donghun-cho changed the title [#14036] Move agent endpoint from AdminController to AgentV2Controller [#14036] Move agent list endpoint out of admin API Jul 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Moves the agent-list endpoint out of the admin API surface into AgentV2Controller, consolidating agent retrieval under /api/agents with service-type resolution handled via ServiceTypeRegistryService.

Changes:

  • Removed /api/admin/agents from AdminController (and its AgentListV2Service dependency).
  • Updated AgentV2Controller to (a) use Integer for serviceTypeCode, and (b) add a second /agents handler to return the full agent list when from/to are not provided.
  • Simplified the “invalid service type” error message.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java Adds/adjusts /api/agents endpoints for active vs all agents and updates serviceType resolution.
web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AdminController.java Removes the admin-scoped agents endpoint and related wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


private ServiceType findServiceType(Short serviceTypeCode, String serviceTypeName) {
@PreAuthorize("@naverPermissionEvaluator.hasInspectorPermission(#serviceName.getName(), #applicationName)")
@GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"})
Comment on lines +89 to +91
@PreAuthorize("@naverPermissionEvaluator.hasInspectorPermission(#serviceName.getName(), #applicationName)")
@GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"})
public List<AgentIdView> getAgents(

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java:90

  • @GetMapping has a stray extra comma after the path value, which will not compile and will prevent Spring from registering this handler.
    @GetMapping(value = "/agents",, params = {"applicationName", "!from", "!to"})

@donghun-cho
donghun-cho force-pushed the removePasswordCheck branch from f50e8f1 to 645f483 Compare July 23, 2026 08:25
@donghun-cho
donghun-cho requested a review from Copilot July 23, 2026 08:26
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/AgentV2Controller.java:92

  • This second /agents handler is also named getAgents, which overloads the other handler method name in the same controller. Renaming it to something specific (e.g., getAllAgents) avoids ambiguity in logs/stack traces and clarifies intent for future readers.
    @GetMapping(value = "/agents", params = {"applicationName", "!from", "!to"})
    public List<AgentIdView> getAgents(
            @ServiceParam ServiceName serviceName,

Comment on lines 68 to +69
@GetMapping(value = "/agents", params = {"applicationName", "from", "to"})
public List<AgentIdView> getAgentsV2(
public List<AgentIdView> getAgents(
@donghun-cho
donghun-cho force-pushed the removePasswordCheck branch from 788be12 to f50e8f1 Compare July 23, 2026 08:33
@donghun-cho
donghun-cho merged commit 3594dc2 into pinpoint-apm:master Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants