diff --git a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/manifest/ToolManifestService.java b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/manifest/ToolManifestService.java index 27ace95e..cbaf0533 100644 --- a/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/manifest/ToolManifestService.java +++ b/dap-was-lib/src/main/java/io/shinhanlife/dap/lib/manifest/ToolManifestService.java @@ -53,7 +53,7 @@ public class ToolManifestService { } List 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();