Commit 58c553a
committed
fix(interfaces): bound descriptions in the service and rate-limit OTP verify
Two gaps recovered from the copilot-tool and duplicate-implementation audits.
- `MAX_INTERFACE_DESCRIPTION_LENGTH` was enforced only in the HTTP contract, but
the contract is not the only writer: the copilot's `user_interface` tool calls
`createInterface`/`updateInterfaceDescription` directly, so the cap did not
apply to it. An unbounded description is then re-serialized into every
subsequent get/list response and into the copilot's VFS metadata each turn —
recurring context cost, not just row bloat. Now asserted beside the name check
that was already there for the same reason.
- The public file OTP route rate-limited the send path but not verify, while the
interfaces route limits both. Added the matching per-IP bucket, kept separate
from the send bucket so failed verifies cannot throttle a legitimate resend.1 parent e2f389e commit 58c553a
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
156 | 176 | | |
157 | 177 | | |
158 | 178 | | |
| |||
210 | 230 | | |
211 | 231 | | |
212 | 232 | | |
| 233 | + | |
213 | 234 | | |
214 | 235 | | |
215 | 236 | | |
| |||
276 | 297 | | |
277 | 298 | | |
278 | 299 | | |
| 300 | + | |
| 301 | + | |
279 | 302 | | |
280 | 303 | | |
281 | 304 | | |
| |||
0 commit comments