Allow webrtc connection for products - #399
Conversation
83a0f2e to
6379f5d
Compare
|
Reviewed with the container's other lockdowns in mind. The same-origin
Verified separately: a rebuild of |
filvecchiato
left a comment
There was a problem hiding this comment.
one minor nit: RFC-0002 states something that this PR now (obviously) contradicts. maybe a follow-up issue should be open if not already open
I think that we should keep RFC as it is. In the target solution we still want to gate WebRTC properly but that requires proper planing beforehand |
SUMMARY
Products need WebRTC (
RTCPeerConnection) inside the iOS/Android host. Theearlier approach in #379 tried
to gate it behind an app-level permission through the
__container__bridge,but that gating did not hold up, so it is not the path forward.
Instead, the lockdown container now leaves
RTCPeerConnectionavailable toproducts rather than deleting it. We accept that leaving RTCPeerConnection available also permits unprompted ICE gathering to arbitrary STUN/TURN hosts over UDP as a tradeoff to allow products to use WebRTC connection. Access to the camera and microphone stays protected by the operating system: the user still sees the native permission
prompts before any media is captured.
SOLUTION
js/container— the TrUAPI-mode lockdown no longer removeswindow.RTCPeerConnection. Products can construct peer connections directly;camera and microphone capture (
getUserMedia) continues to trigger thenative OS permission request. The vendored
ios/truapi-host/.../Resources/truapi-container.jsbundle is regenerated tomatch.
WebRTCmethod requests camera and microphone (devicepermissions) through TrUAPI, then runs
getUserMedia+RTCPeerConnection.createOffer. It appears in the method browser and thediagnosis so the flow can be exercised end to end. It no longer requests a
separate WebRTC remote permission.
CONTEXT
WebRTC gating #379