feat(was-lib): map sys category to iam and pct tools
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled

This commit is contained in:
jade
2026-08-18 20:57:13 +09:00
parent 3216148ee2
commit 35fa033a1c

View File

@@ -53,7 +53,7 @@ public class ToolManifestService {
}
List<ToolManifestItem> tools = toolSupplier.get().stream()
.filter(tool -> categoryKey == null || categoryKey.equals(tool.getCategoryKey()))
.filter(tool -> isMatchCategory(categoryKey, tool.getCategoryKey()))
.map(this::toManifestItem)
.sorted(Comparator.comparing(ToolManifestItem::name))
.toList();
@@ -61,6 +61,19 @@ public class ToolManifestService {
return new ToolManifestResponse(bundleId, revision(bundleId, tools), tools);
}
private boolean isMatchCategory(String requestedCategory, String toolCategory) {
if (requestedCategory == null) {
return true;
}
if (requestedCategory.equalsIgnoreCase(toolCategory)) {
return true;
}
if ("sys".equalsIgnoreCase(requestedCategory)) {
return "iam".equalsIgnoreCase(toolCategory) || "pct".equalsIgnoreCase(toolCategory);
}
return false;
}
private ToolManifestItem toManifestItem(ToolMetadata tool) {
String title = tool.getDisplayName() == null || tool.getDisplayName().isBlank()
? tool.getName() : tool.getDisplayName();