Repository navigation
Commit 13b7158
authored
fix(security): don't re-quarantine servers added while running (rc.3 release gate) (#1488)
# Pull Request
## Description
Fixes the `v0.70.0-rc.3` release-gate failure (`matrix/oauth`: *server
not ready, connected=true tools=0*). That failure was a regression from
#1485 (RC-UPG-001).
**Cause**
- #1485 re-quarantines a server that is known to config.db but has no
approved tool baseline.
- `Server.AddServer` saves a new server to config.db **before** it
publishes the config, and the admission gate runs on every publish.
- So a server added at runtime looked "known but never approved" and was
held before its tools could be discovered.
- An OAuth server added with `quarantined: false` has no tools until
sign-in, which is exactly the gate's oauth cell.
**Fix**
- The no-baseline rule now applies only to servers that config.db held
the first time the gate read it in this process
(`Runtime.bootKnownServers`). Those are the only records an older
release could have left behind.
- A `quarantined` value stated at add time is now recorded as an
operator statement (`MarkQuarantineExplicitlySet`). It is written to
`mcp_config.json` and obeyed after a restart. This covers:
- REST add;
- the `upstream_servers` MCP add;
- CLI `upstream add --no-quarantine` without a running daemon;
- imports with `skip_quarantine` (REST and CLI).
The last two were found by an add-path completeness sweep during review.
The CLI direct-file case is pre-existing.
## Testing
- [x] I have tested these changes locally
- [x] I have added/updated tests that prove my fix is effective or my
feature works
- [x] All existing tests pass
| Check | rc.3 (`dc851c8f5`) | this branch |
|---|---|---|
| `release-gate matrix --cells oauth` (real gate driver, run locally) |
fail, same error as CI | pass |
| `release-gate matrix --cells stdio,http,sse` | — | pass |
| v0.69 → upgrade replay (keyless server restarted under v0.69) | — |
keyless server held, vetted server live |
- **New tests:**
-
`TestConfigLoadAdmissionGate_ServerAddedWhileRunningIsNotRequarantined`;
- an explicit-bit assertion in `TestImport_SkipQuarantine`.
- **Suites:** the race suite with `-tags server` passes for runtime,
httpapi, server and config. `configimport` and `cmd/mcpproxy` tests
pass.
- **Lint:** clean on the changed files.
- **Review:** zcode (GLM) found nothing on the diff. The add-path
sweep's two confirmed gaps are fixed here; a third, theoretical
bootKnown edge was refuted on verification.
After merge, the next RC will be `v0.70.0-rc.4`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent dc851c8 commit 13b7158
9 files changed
Lines changed: 81 additions & 1 deletion
File tree
- cmd/mcpproxy
- internal
- configimport
- httpapi
- runtime
- server
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1717 | 1717 | | |
1718 | 1718 | | |
1719 | 1719 | | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
1720 | 1726 | | |
1721 | 1727 | | |
1722 | 1728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
295 | 301 | | |
296 | 302 | | |
297 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2513 | 2513 | | |
2514 | 2514 | | |
2515 | 2515 | | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
2516 | 2522 | | |
2517 | 2523 | | |
2518 | 2524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
151 | 162 | | |
152 | 163 | | |
153 | 164 | | |
| |||
173 | 184 | | |
174 | 185 | | |
175 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
176 | 194 | | |
177 | 195 | | |
178 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
136 | 144 | | |
137 | 145 | | |
138 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5797 | 5797 | | |
5798 | 5798 | | |
5799 | 5799 | | |
| 5800 | + | |
| 5801 | + | |
| 5802 | + | |
| 5803 | + | |
| 5804 | + | |
5800 | 5805 | | |
5801 | 5806 | | |
5802 | 5807 | | |
| |||
0 commit comments