Commit bc1c1ce
fix(rest): a scoped /discovery advertises routes.auth on the unscoped base (#16957)
* test(rest): pin routes.auth on a SCOPED discovery document (#16538)
No test had ever touched `routes.auth` on a scoped `/discovery` document. The
three existing pins live in `packages/objectql/src/protocol-discovery.test.ts`
and measure the PRODUCER, which never sees a base path — so the REST
projection's scoped branch was unmeasured, and that is why the defect was
green.
This commit adds the failing case only; the repair follows.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
* fix(rest): strip the environment scope from the advertised auth route (#16538)
`registerDiscoveryEndpoints`' auth branch stripped only the retired
`/projects/:environmentId`, while `isScoped` — the condition guarding that
branch — is true only for `/environments/:environmentId`. The replace could
therefore never match where it ran: it returned `basePath` unchanged, so a
scoped `/discovery` advertised `routes.auth` as
`/api/v1/environments/:environmentId/auth` — keeping both the scope the
comment two lines above says to drop ("Auth is a control-plane concern, so use
the unscoped base") and a literal, unsubstituted route parameter.
The repair is the sibling MCP block's own regex, in the same handler and for
the same reason.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
* chore(changeset): patch @objectstack/rest for the scoped auth route repair (#16538)
Measured rather than assumed: `@objectstack/rest` is public (npm 17.3.0) and
ships `files: ["dist", ...]`; the changed regex is present twice in both
`dist/index.js` and `dist/index.cjs` — the sibling MCP strip as the positive
control, and the auth strip this change moved — while the retired-only
spelling has zero occurrences there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015QE8qk46e5CHJxyQEUjbf8
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3e21cf0 commit bc1c1ce
3 files changed
Lines changed: 87 additions & 1 deletion
File tree
- .changeset
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4525 | 4525 | | |
4526 | 4526 | | |
4527 | 4527 | | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
4528 | 4538 | | |
4529 | 4539 | | |
4530 | | - | |
| 4540 | + | |
4531 | 4541 | | |
4532 | 4542 | | |
4533 | 4543 | | |
| |||
0 commit comments