feat: pass folderKey in CAS WebSocket handshake for robot access validation#1375
Open
feat: pass folderKey in CAS WebSocket handshake for robot access validation#1375
Conversation
a31bd4e to
48ab984
Compare
48ab984 to
0be1150
Compare
maxduu
reviewed
Mar 3, 2026
| assert context.conversation_id is not None, "conversation_id must be set in context" | ||
| assert context.exchange_id is not None, "exchange_id must be set in context" | ||
|
|
||
| # Extract host from UIPATH_URL |
Contributor
There was a problem hiding this comment.
Any specific reason to remove comment? Same with # Construct WebSocket URL for CAS below?
Author
There was a problem hiding this comment.
Oh no those shouldn't be removed, added them back and looked through the rest of the commit to make sure nothing else was removed that shouldn't have been.
a039733 to
08a5fe2
Compare
CAS now validates robot access via org + folderKey match instead of syntheticUserId. Send folderKey (from UIPATH_FOLDER_KEY env var) as a query param and remove syntheticUserId plumbing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
maxduu
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Passes
folderKeyas a WebSocket query parameter during the CAS handshake so that robots running withrunAsMe=false(unattended, external app tokens) can be authorized by CAS via folder-scoped access.Changes
_bridge.py: Build WebSocket URL withfolderKeyquery param sourced fromUIPATH_FOLDER_KEYenv var (available viaIJobInvocation.FolderKeyin HDENS)constants.py: RemoveENV_SYNTHETIC_USER_ID(no longer needed — CAS validates folder, not synthetic user identity)test_bridge.py: Update test to verifyfolderKeyis included andsyntheticUserIdis absentHow it works
When a URT agent runs with
runAsMe=false, the robot's user ID won't match the conversation owner. CAS falls back to verifying the robot'sfolderKeymatchesconversation.folder_key. This avoids threading the user's synthetic identity through FpsProperties/HDENS/wire.Companion PR
AgentInterfaces#761 — CAS-side folder-scoped robot authorization
Test Plan
python -m pytest tests/cli/chat/test_bridge.pyfolderKeyappears in WebSocket URL whenUIPATH_FOLDER_KEYis setsyntheticUserIdis no longer sent