-
Notifications
You must be signed in to change notification settings - Fork 554
test(client): support read-only clients #25350
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
Conversation
71f55fd
to
e414272
Compare
Configure presence multi-client testing to have a single writer and all others read only. Add test infrastructure support to have uniquely reader clients in a session. Token provider need only specify write scope during attach.
e414272
to
ca2c5b4
Compare
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.
Pull Request Overview
This PR adds support for read-only clients in multi-client presence testing by introducing scope-based access control. The change allows configuring one client as a writer (leader) and all others as read-only participants.
- Add scope parameters to control client permissions during connection and container creation
- Refactor token provider to support different scopes for attach vs regular operations
- Update multi-process test infrastructure to designate first client as writer and others as readers
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
orchestratorUtils.ts | Modified to create first client with write permissions and added scope parameters to connection messages |
messageTypes.ts | Added scope fields to ConnectCommand interface for specifying client permissions |
childClient.ts | Updated to pass scope parameters through to token provider and removed unused imports |
AzureTokenFactory.ts | Added attachScopes parameter to support different permissions for container creation |
insecureTokenProvider.ts | Refactored to consolidate token generation logic and support separate attach scopes |
...ges/service-clients/end-to-end-tests/azure-client/src/test/multiprocess/orchestratorUtils.ts
Show resolved
Hide resolved
packages/runtime/test-runtime-utils/src/insecureTokenProvider.ts
Outdated
Show resolved
Hide resolved
packages/runtime/test-runtime-utils/src/insecureTokenProvider.ts
Outdated
Show resolved
Hide resolved
as Copilot suggests for efficiency
(ahead of protocol update)
with skipped failing test
packages/runtime/test-runtime-utils/src/insecureTokenProvider.ts
Outdated
Show resolved
Hide resolved
childErrorPromise, | ||
); | ||
}); | ||
for (const writeClients of [numClients, 1]) { |
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.
This is just a question -- so here we want to test both with attendee connect and disconnect with all write clients and then with all read clients?
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.
Not quite - all write and then 1 write with rest read
Update presence multi-client testing to have tests with a single writer and all others read only.
Add test infrastructure support to have uniquely reader clients in a session. Token provider need only specify write scope during attach.