Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public class ServiceSource implements VersionedDto {
private static final Set<String> PROXY_SUPPORTED_REGISTRY_TYPES =
ImmutableSet.of(V1McpBridge.REGISTRY_TYPE_STATIC, V1McpBridge.REGISTRY_TYPE_DNS);

private static final Set<String> ALLOWABLE_TYPES =
ImmutableSet.of(V1McpBridge.REGISTRY_TYPE_NACOS, V1McpBridge.REGISTRY_TYPE_NACOS2,
V1McpBridge.REGISTRY_TYPE_NACOS3, V1McpBridge.REGISTRY_TYPE_ZK, V1McpBridge.REGISTRY_TYPE_CONSUL,
V1McpBridge.REGISTRY_TYPE_EUREKA, V1McpBridge.REGISTRY_TYPE_STATIC, V1McpBridge.REGISTRY_TYPE_DNS);

static {
VALIDATORS.put(V1McpBridge.REGISTRY_TYPE_NACOS, new NacosServiceSourceValidator());
VALIDATORS.put(V1McpBridge.REGISTRY_TYPE_NACOS2, new NacosServiceSourceValidator());
Expand Down Expand Up @@ -112,6 +117,11 @@ public boolean isValid() {
return false;
}

// Check if type is within allowable values
if (!ALLOWABLE_TYPES.contains(this.type)) {
return false;
}

if (this.getPort() == null || !ValidateUtil.checkPort(this.getPort())) {
return false;
}
Expand Down
Loading