SIGN IN SIGN UP

Merged PR 63482: [9.0] Restrict JavaScript root component operations (#69240)

Restricts parameter updates and removal to roots created by JavaScript.

----
#### AI description  (iteration 1)
#### PR Classification
Security enhancement to restrict JavaScript root component operations by validating component ownership.

#### PR Summary
This pull request adds validation to ensure that JavaScript can only modify or remove root components that it originally created, preventing unauthorized operations on server-rendered components.

- `JSComponentInterop.cs`: Added `_jsComponentIds` HashSet to track JS-added components and `EnsureValidJSComponentId()` validation method that throws `InvalidOperationException` for unauthorized operations in `SetRootComponentParameters()` and `RemoveRootComponent()`.
- `JSComponentInteropTest.cs`: Added comprehensive unit tests verifying that operations on server-rendered components are rejected while JS-added components remain accessible.
- `JSRootComponentsTest.cs` and test assets: Added E2E test case and supporting JavaScript helpers to verify parameters cannot be updated on non-JS root components, with UI elements to trigger and display validation errors.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->

Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
Co-authored-by: Javier Calvarro Nelson <6995051+javiercn@users.noreply.github.com>
W
William Godbe committed
cd17eacb2756a8ca8f8e0703b1054ca8647f122c
Parent: f297276
Committed by GitHub <noreply@github.com> on 9/11/2026, 6:01:47 PM