Skip to content

fix: Let users open conversation history and send messages - #116

Merged
0xmc merged 1 commit into
mainfrom
fix/conversation-subresources
Oct 4, 2026
Merged

0xmc merged 1 commit into
mainfrom
fix/conversation-subresources

Conversation

@0xmc

@0xmc 0xmc commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Users cannot open a conversation's history or send a message through the Milo API, because Milo now checks those requests against permissions the assistant never registered.

Each request fails as "not registered" for every user, with no fallback to the conversation's own permissions.

This registers both permissions and grants them alongside the matching conversation permissions, so readers can open history and creators can send. A new test derives the served subresources from the server itself, so a future one fails the build until it is registered and granted.

It must ship before the chat dock is promoted to production.

Fixes #115. Follows #114, milo-os/milo#456, milo-os/openfga-provider#139, datum-cloud/infra#6664 and datum-cloud/infra#6667, and mirrors milo-os/telemetry#193.

Test plan

  • Build, lint and unit tests pass, and the new test fails for both subresources without this change.
  • In staging, a user with the assistant user role opens a conversation's history.
  • In staging, that user sends a message from the chat dock and gets a reply.
  • In staging, a user with only the viewer role is refused when sending.

Milo's OpenFGA provider now authorizes subresources on their own, with no
fallback to the parent resource's permissions. Conversations serve two
subresources and declared neither, so every transcript load and every turn
sent through the conversations apiserver failed as "not registered". A
read-only production probe confirmed it for conversations/messages.get.

Key changes:
- declare conversations/messages (get) and conversations/sendmessage
  (create) on the Conversation ProtectedResource; these are the verbs the
  stock RequestInfoFactory resolves for the only methods served, GET and POST
- grant messages.get in conversation-viewer beside conversations.get, and
  sendmessage.create in conversation-creator beside conversations.create;
  the user role inherits both
- extract the v1alpha1 storage map into v1alpha1Storage so tests can read it
- add iam_test.go: it probes every method on every subresource in the
  storage map through the assembled server (only 405 counts as unserved),
  resolves each with the stock RequestInfoFactory, and requires the
  permission to be declared and granted by every role that grants the base
  verb; a second test requires every role permission to be declared

Without the fix the test fails for both subresources (undeclared, ungranted);
with it, both pass. Granting an undeclared permission fails the second test.

Hazard: with subresource authorization off, the provider marks any role
holding a subresource permission invalid as a whole, so these roles would
grant nothing on a Milo running without the flag.

Fixes #115
@0xmc
0xmc marked this pull request as ready for review October 4, 2026 22:24
@0xmc
0xmc merged commit 17482ba into main Oct 4, 2026
5 checks passed
@0xmc
0xmc deleted the fix/conversation-subresources branch October 4, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conversation history refused as not registered

2 participants