-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathconfig-filter-test.yaml
More file actions
110 lines (102 loc) · 3.49 KB
/
config-filter-test.yaml
File metadata and controls
110 lines (102 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Test configuration for validating filter functionality
#
# This config tests different filter scenarios:
# - Name inclusion/exclusion with glob patterns
# - Tag inclusion/exclusion
# - Multiple filter combinations
#
# IMPORTANT: Name filters use glob patterns (filepath.Match):
# - * matches any characters EXCEPT path separator /
# - To match across path components use */ or */*
# - Server names include prefixes like: io.github.stacklok/server-name
#
# Usage:
# thv-registry-api serve --config examples/config-filter-test.yaml
# CONFIG_FILE=config-filter-test.yaml docker-compose up
sources:
# Test 1: Include only database-related servers by name pattern
- name: database-servers
file:
path: /examples/upstream-registry.json
syncPolicy:
interval: "30s"
filter:
names:
include:
- "*/*-mysql-*" # Matches: io.github.stacklok/adb-mysql-mcp-server
- "*/genai-*" # Matches: io.github.stacklok/genai-toolbox
exclude:
- "*/*-mcp-server" # Excludes: io.github.stacklok/adb-mysql-mcp-server
# Result: Should only include genai-toolbox (included by */genai-* but not excluded)
# Test 2: Filter by tags - only security and database servers
- name: security-and-database
file:
path: /examples/upstream-registry.json
syncPolicy:
interval: "30s"
filter:
tags:
include:
- "security" # Should match: crowdstrike-falcon
- "database" # Should match: adb-mysql-mcp-server, genai-toolbox
exclude:
- "mysql" # Should exclude servers with mysql tag
# Result: Should include crowdstrike-falcon and genai-toolbox (has database but not mysql-specific)
# Test 3: Complex filter - GitHub/GitLab servers excluding certain tags
- name: version-control
file:
path: /examples/upstream-registry.json
syncPolicy:
interval: "30s"
filter:
names:
include:
- "*/git*" # Matches: io.github.stacklok/github, io.github.stacklok/gitlab
tags:
exclude:
- "wiki" # GitLab has wiki tag, should be excluded
# Result: Should only include github (gitlab excluded due to wiki tag)
# Test 4: Wildcard patterns with proper prefix
- name: dev-tools
file:
path: /examples/upstream-registry.json
syncPolicy:
interval: "30s"
filter:
names:
include:
- "*/aws-*" # Should match: io.github.stacklok/aws-api
- "*/chrome-*" # Should match: io.github.stacklok/chrome-devtools-mcp
- "*/fetch" # Should match: io.github.stacklok/fetch
# Result: Should include aws-api, chrome-devtools-mcp, and fetch
# Test 5: No filters - should include all servers for comparison
- name: all-servers
file:
path: /examples/upstream-registry.json
syncPolicy:
interval: "30s"
# No filter - should include all 12 servers
registries:
- name: database-servers
sources: ["database-servers"]
- name: security-and-database
sources: ["security-and-database"]
- name: version-control
sources: ["version-control"]
- name: dev-tools
sources: ["dev-tools"]
- name: all-servers
sources: ["all-servers"]
auth:
mode: anonymous
# PostgreSQL database configuration for Docker Compose
database:
host: postgres # Docker service name
port: 5432
user: db_app
migrationUser: db_migrator
database: registry
sslMode: disable
maxOpenConns: 10
maxIdleConns: 2
connMaxLifetime: "30m"