-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure E2E: Add read client signal and audience tests #20042
Azure E2E: Add read client signal and audience tests #20042
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me! Left a few clarification questions/nits before you merge 🙂
azure/packages/test/end-to-end-tests/src/test/AzureTokenFactory.ts
Outdated
Show resolved
Hide resolved
Need to see if I can "force read" via server changes based on token scopes rather than the client config change. |
…/signal-audience-reader-tests
## Description When a client joins with AzureClient, it will always try to join in `write` even if it only has `read` permissions according to its token claims. On the server (Nexus Lambda), we handle that correctly by creating a read-scoped connection. However, the server would incorrectly handle client details and send connection info like this: ```js socket.emit("connect_document_success", { /* ... */, mode: "read"); // ... socket.emitToRoom( "tenantId/documentId", "signal", { /* ... join signal message ...*/, client: { /* ... */, mode: "write" }); ``` I'm not sure about the specifics of what's happening on the client, but when testing read client Audience and Signals usage in #20042, I realized that the read client audience is not working appropriately without this change. My understanding is it's because Audience is trying to use Quorum (Join Ops) instead of Join Signals because the Join Signal client details said `{ mode: "write" }` even though Connection details said `{ mode: "read" }`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
## Description When a client joins with AzureClient, it will always try to join in `write` even if it only has `read` permissions according to its token claims. On the server (Nexus Lambda), we handle that correctly by creating a read-scoped connection. However, the server would incorrectly handle client details and send connection info like this: ```js socket.emit("connect_document_success", { /* ... */, mode: "read"); // ... socket.emitToRoom( "tenantId/documentId", "signal", { /* ... join signal message ...*/, client: { /* ... */, mode: "write" }); ``` I'm not sure about the specifics of what's happening on the client, but when testing read client Audience and Signals usage in microsoft#20042, I realized that the read client audience is not working appropriately without this change. My understanding is it's because Audience is trying to use Quorum (Join Ops) instead of Join Signals because the Join Signal client details said `{ mode: "write" }` even though Connection details said `{ mode: "read" }`
Description
Azure Fluid Relay is planning work to begin officially supporting Signals. Part of that work is also making sure that Audience management works correctly for Read-only clients.
This PR adds 4 new Azure E2E tests.
Also, it adds a fix in Nexus Lambda to update the Connection messages Clientmode
toread/write
depending on Claims scopes.Reviewer Guidance
A couple of the new tests involve semi-complicated (in a testing sense) scenarios. I know tests are supposed to test 1 thing and then have another test to test another thing, however, each of these tests creates a new Container, so adding too many tests can become costly when running frequently against production environments. Open to feedback on alternative ways to handle this self-imposed limitation.