refactor: rename agent group→application across entire codebase
Complete the group→application terminology rename in the agent registry subsystem: - AgentInfo: field group → application, all wither methods updated - AgentRegistryService: findByGroup → findByApplication - AgentInstanceResponse: field group → application (API response) - AgentRegistrationRequest: field group → application (API request) - JwtServiceImpl: parameter names group → application (JWT claim string "group" preserved for token backward compatibility) - All controllers, lifecycle monitor, command controller updated - Integration tests: JSON request bodies "group" → "application" - Frontend: schema.d.ts, openapi.json, agent queries, AgentHealth RBAC group references (groups table, GroupAdminController, etc.) are NOT affected — they are a separate domain concept. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,8 +37,8 @@ public class TestSecurityHelper {
|
||||
/**
|
||||
* Returns a valid JWT access token with the given roles (no agent registration).
|
||||
*/
|
||||
public String createToken(String subject, String group, List<String> roles) {
|
||||
return jwtService.createAccessToken(subject, group, roles);
|
||||
public String createToken(String subject, String application, List<String> roles) {
|
||||
return jwtService.createAccessToken(subject, application, roles);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -38,17 +38,17 @@ class AgentCommandControllerIT extends AbstractPostgresIT {
|
||||
operatorJwt = securityHelper.operatorToken();
|
||||
}
|
||||
|
||||
private ResponseEntity<String> registerAgent(String agentId, String name, String group) {
|
||||
private ResponseEntity<String> registerAgent(String agentId, String name, String application) {
|
||||
String json = """
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "%s",
|
||||
"group": "%s",
|
||||
"application": "%s",
|
||||
"version": "1.0.0",
|
||||
"routeIds": ["route-1"],
|
||||
"capabilities": {}
|
||||
}
|
||||
""".formatted(agentId, name, group);
|
||||
""".formatted(agentId, name, application);
|
||||
|
||||
return restTemplate.postForEntity(
|
||||
"/api/v1/agents/register",
|
||||
|
||||
@@ -41,7 +41,7 @@ class AgentRegistrationControllerIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "%s",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": ["route-1", "route-2"],
|
||||
"capabilities": {"tracing": true}
|
||||
|
||||
@@ -53,17 +53,17 @@ class AgentSseControllerIT extends AbstractPostgresIT {
|
||||
operatorJwt = securityHelper.operatorToken();
|
||||
}
|
||||
|
||||
private ResponseEntity<String> registerAgent(String agentId, String name, String group) {
|
||||
private ResponseEntity<String> registerAgent(String agentId, String name, String application) {
|
||||
String json = """
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "%s",
|
||||
"group": "%s",
|
||||
"application": "%s",
|
||||
"version": "1.0.0",
|
||||
"routeIds": ["route-1"],
|
||||
"capabilities": {}
|
||||
}
|
||||
""".formatted(agentId, name, group);
|
||||
""".formatted(agentId, name, application);
|
||||
|
||||
return restTemplate.postForEntity(
|
||||
"/api/v1/agents/register",
|
||||
|
||||
@@ -29,7 +29,7 @@ class BootstrapTokenIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "bootstrap-test-agent",
|
||||
"name": "Bootstrap Test",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": [],
|
||||
"capabilities": {}
|
||||
@@ -97,7 +97,7 @@ class BootstrapTokenIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "bootstrap-test-previous",
|
||||
"name": "Previous Token Test",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": [],
|
||||
"capabilities": {}
|
||||
|
||||
@@ -39,7 +39,7 @@ class JwtRefreshIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "Refresh Test Agent",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": [],
|
||||
"capabilities": {}
|
||||
|
||||
@@ -78,7 +78,7 @@ class JwtServiceTest {
|
||||
String token = jwtService.createAccessToken("user:admin", "user", roles);
|
||||
JwtService.JwtValidationResult result = jwtService.validateAccessToken(token);
|
||||
assertEquals("user:admin", result.subject());
|
||||
assertEquals("user", result.group());
|
||||
assertEquals("user", result.application());
|
||||
assertEquals(roles, result.roles());
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class JwtServiceTest {
|
||||
String token = jwtService.createRefreshToken("agent-1", "default", roles);
|
||||
JwtService.JwtValidationResult result = jwtService.validateRefreshToken(token);
|
||||
assertEquals("agent-1", result.subject());
|
||||
assertEquals("default", result.group());
|
||||
assertEquals("default", result.application());
|
||||
assertEquals(roles, result.roles());
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ class RegistrationSecurityIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "Security Test Agent",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": [],
|
||||
"capabilities": {}
|
||||
|
||||
@@ -90,7 +90,7 @@ class SseSigningIT extends AbstractPostgresIT {
|
||||
{
|
||||
"agentId": "%s",
|
||||
"name": "SSE Signing Test Agent",
|
||||
"group": "test-group",
|
||||
"application": "test-group",
|
||||
"version": "1.0.0",
|
||||
"routeIds": ["route-1"],
|
||||
"capabilities": {}
|
||||
|
||||
Reference in New Issue
Block a user