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:
@@ -60,13 +60,13 @@ public class JwtServiceImpl implements JwtService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createAccessToken(String subject, String group, List<String> roles) {
|
||||
return createToken(subject, group, roles, "access", properties.getAccessTokenExpiryMs());
|
||||
public String createAccessToken(String subject, String application, List<String> roles) {
|
||||
return createToken(subject, application, roles, "access", properties.getAccessTokenExpiryMs());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createRefreshToken(String subject, String group, List<String> roles) {
|
||||
return createToken(subject, group, roles, "refresh", properties.getRefreshTokenExpiryMs());
|
||||
public String createRefreshToken(String subject, String application, List<String> roles) {
|
||||
return createToken(subject, application, roles, "refresh", properties.getRefreshTokenExpiryMs());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,12 +84,12 @@ public class JwtServiceImpl implements JwtService {
|
||||
return validateAccessToken(token).subject();
|
||||
}
|
||||
|
||||
private String createToken(String subject, String group, List<String> roles,
|
||||
private String createToken(String subject, String application, List<String> roles,
|
||||
String type, long expiryMs) {
|
||||
Instant now = Instant.now();
|
||||
JWTClaimsSet claims = new JWTClaimsSet.Builder()
|
||||
.subject(subject)
|
||||
.claim("group", group)
|
||||
.claim("group", application)
|
||||
.claim("type", type)
|
||||
.claim("roles", roles)
|
||||
.issueTime(Date.from(now))
|
||||
@@ -132,7 +132,7 @@ public class JwtServiceImpl implements JwtService {
|
||||
throw new InvalidTokenException("Token has no subject");
|
||||
}
|
||||
|
||||
String group = claims.getStringClaim("group");
|
||||
String application = claims.getStringClaim("group");
|
||||
|
||||
// Extract roles — may be absent in legacy tokens
|
||||
List<String> roles;
|
||||
@@ -145,7 +145,7 @@ public class JwtServiceImpl implements JwtService {
|
||||
roles = List.of();
|
||||
}
|
||||
|
||||
return new JwtValidationResult(subject, group, roles);
|
||||
return new JwtValidationResult(subject, application, roles);
|
||||
} catch (ParseException e) {
|
||||
throw new InvalidTokenException("Failed to parse JWT", e);
|
||||
} catch (JOSEException e) {
|
||||
|
||||
Reference in New Issue
Block a user