Commit 9dc65fd
committed
fix(telegram): wrap destinations in <code> for approvals and mutations
Extends the /policy show fix to the other Telegram surfaces that
render destinations or URLs: approval prompts and policy mutation
confirmations (allow/deny). Without this, Telegram auto-links the
destination in strings like 'HTTPS api.github.com:443' or 'Added
allow rule: example.com' as a clickable blue URL.
- bot.go FormatApprovalMessage: wrap dest:port and the rendered
request URL in <code>. MCP tool name also in <code>.
- commands.go policyAllow / policyDeny: wrap dest in <code> on both
store and in-memory paths.
- Consolidate the duplicated htmlEscape helpers: commands.go now uses
the existing htmlEscape from bot.go, local wrapper removed.
- Update bot_test.go expectations to match the <code>-wrapped output.1 parent 6b3946f commit 9dc65fd
3 files changed
Lines changed: 20 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | 256 | | |
267 | 257 | | |
268 | 258 | | |
269 | 259 | | |
270 | | - | |
| 260 | + | |
271 | 261 | | |
272 | 262 | | |
273 | 263 | | |
| |||
329 | 319 | | |
330 | 320 | | |
331 | 321 | | |
332 | | - | |
| 322 | + | |
333 | 323 | | |
334 | 324 | | |
335 | | - | |
| 325 | + | |
336 | 326 | | |
337 | 327 | | |
338 | 328 | | |
| |||
364 | 354 | | |
365 | 355 | | |
366 | 356 | | |
367 | | - | |
| 357 | + | |
368 | 358 | | |
369 | 359 | | |
370 | 360 | | |
371 | 361 | | |
372 | 362 | | |
373 | 363 | | |
374 | | - | |
| 364 | + | |
375 | 365 | | |
376 | 366 | | |
377 | 367 | | |
| |||
389 | 379 | | |
390 | 380 | | |
391 | 381 | | |
392 | | - | |
| 382 | + | |
393 | 383 | | |
394 | 384 | | |
395 | 385 | | |
396 | 386 | | |
397 | 387 | | |
398 | | - | |
| 388 | + | |
399 | 389 | | |
400 | 390 | | |
401 | 391 | | |
| |||
0 commit comments