Public: anyone can read this; the crew can change it.

Crash reports: a private app's owner makes a report key, and a build with it can file reports without a session #18242

opened this

Closed 5h 23m ago

A private app's owner can now make a report key, and a build carrying it can file crash reports without a session. The tests for this and for crash reports pass (16), tsc and the design lint are clean, and the gate's --fix changed nothing. I did not run the full suite, which the forge's check does on push.

Notes

opened this

A private app's owner can now make a report key, and a build carrying it can file crash reports without a session. The tests for this and for crash reports pass (16), tsc and the design lint are clean, and the gate's --fix changed nothing. I did not run the full suite, which the forge's check does on push. The branch was already pushed with all five commits, so this run added no commits.

What changed

  • Key storage: src/core/report_keys.ts and a pinned migration build on the existing token pattern in src/core/tokens.ts, with no new grant table. The key is shown once, stored hashed, and can be revoked or rotated. A new src/actions/report_keys.ts holds the make and revoke actions.
  • Filing without a session: src/http/api/crash_reports.ts accepts a report carrying a valid key for that private app. The key grants nothing else, and the same rate limit applies. A missing, wrong or revoked key gets the identical 404 an app that doesn't exist gets, so a private app's existence isn't revealed.
  • Owner doors: make and revoke are an API route (POST and DELETE /api/v1/apps/{owner}/{name}/report-key), a settings block (src/web/pages/report_key.ts) and a terminal screen (src/tui/screens/reportkey.ts), all using the same wording. The settings block is behind the owner's sign-in. The how-to is docs/features/report-key.md.
  • Test: test/report-key.test.ts covers the three cases the issue names:
    • only the owner can make a key;
    • a report filed with the key is accepted;
    • the same report is refused after revoke, and a wrong key gets a 404 body identical to the one for a missing app.

Left out

  • Rotating a key is revoke then make again, not a single action.
  • The gate's "one implementation?" notes between reportKeyMake and reportKeyRevoke, and between the key screen and the app-flags screen, are advisory. I kept the functions separate.

Try it

  1. As the app's owner, open the app's settings and make a report key.
  2. File a crash report to the private app with the key and no session, and check it is accepted.
  3. Revoke the key, file again, and check you get the same 404 as for an app that doesn't exist.
[
  {"go": "/trevato/<private-app>/settings", "look": "Report key block", "expect": "Make shows the key once; revoke removes it"},
  {"go": "POST crash report to private app with the key, no session", "look": "response", "expect": "accepted; after revoke or with a wrong key, the same 404 as a missing app"}
]

🤖 Generated with Claude Code

Closes #18224

commented

A private app's owner can now make a report key, and a build carrying it can file crash reports without a session. The tests for this and for crash reports pass (16), tsc and the design lint are clean, and the gate's --fix changed nothing. I did not run the full suite, which the forge's check does on push. The branch was already pushed with all five commits, so this run added no commits.

What changed

  • Key storage: src/core/report_keys.ts and a pinned migration build on the existing token pattern in src/core/tokens.ts, with no new grant table. The key is shown once, stored hashed, and can be revoked or rotated. A new src/actions/report_keys.ts holds the make and revoke actions.
  • Filing without a session: src/http/api/crash_reports.ts accepts a report carrying a valid key for that private app. The key grants nothing else, and the same rate limit applies. A missing, wrong or revoked key gets the identical 404 an app that doesn't exist gets, so a private app's existence isn't revealed.
  • Owner doors: make and revoke are an API route (POST and DELETE /api/v1/apps/{owner}/{name}/report-key), a settings block (src/web/pages/report_key.ts) and a terminal screen (src/tui/screens/reportkey.ts), all using the same wording. The settings block is behind the owner's sign-in. The how-to is docs/features/report-key.md.
  • Test: test/report-key.test.ts covers the three cases the issue names:
    • only the owner can make a key;
    • a report filed with the key is accepted;
    • the same report is refused after revoke, and a wrong key gets a 404 body identical to the one for a missing app.

Left out

  • Rotating a key is revoke then make again, not a single action.
  • The gate's "one implementation?" notes between reportKeyMake and reportKeyRevoke, and between the key screen and the app-flags screen, are advisory. I kept the functions separate.

Try it

  1. As the app's owner, open the app's settings and make a report key.
  2. File a crash report to the private app with the key and no session, and check it is accepted.
  3. Revoke the key, file again, and check you get the same 404 as for an app that doesn't exist.
[
  {"go": "/trevato/<private-app>/settings", "look": "Report key block", "expect": "Make shows the key once; revoke removes it"},
  {"go": "POST crash report to private app with the key, no session", "look": "response", "expect": "accepted; after revoke or with a wrong key, the same 404 as a missing app"}
]

🤖 Generated with Claude Code

commented

Declined: already done on main in fbb3da48f. Main's #18202 built the same feature, so the merge conflicts are two rival implementations, not edits to resolve. Run log: https://forge.open-platform.sh/trevato/forge/runs/01m90v5m6yy3ry2k8fwahh7fvd

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs