Re: [webrtc-extensions] Add a CSP check to RTCPeerConnection.addIceCandidate(). (#81)

> The model I aimed for is consistency with the other networking APIs. All failures there are essentially surfaced as if there was a network error. This could be a DNS error, a CORS failure, a CSP failure, blocking of Mixed Content, etc.

@annevk What are the underlying requirements met by this model?

RTCPeerConnection differs from more linear connection establishment APIs in several ways:
1. It talks to [up to 64](https://github.com/w3c/webrtc-pc/pull/2679) STUN/TURN servers provided by JS, with no error path anyone listens to ([onicecandidateerror](https://wpt.fyi/results/webrtc/RTCPeerConnection-onicecandidateerror.https.html)). So lots of networking activity normally happens (STUN/TURN requests + out-of-band-signaling in JS) on both sides, before we ever reach ["failed"](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate-failed), which may be seconds, [if at all](https://github.com/w3c/webrtc-pc/issues/2698).
2. ["failed"](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate-failed) isn't a terminal state, since JS can [pc.restartIce()](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-restartice) ([diagram](https://w3c.github.io/webrtc-pc/#fig-non-normative-ice-transport-state-transition-diagram)).
3. ["closed"](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate-closed), the only terminal state, is only reachable from [pc.close()](https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-close) (never surfaced to JS e.g. through an event).

In other words, RTCPeerConnection is more of a p2p connection negotiation factory than a connection itself, and doesn't really die until you kill it.

We can still try to find a common network failure path to simulate, like halting the ICE agent entirely — though when I tried, I fell in mud, and had to file https://github.com/w3c/webrtc-pc/issues/2698  — we can fix that, but it'd be good to know if it meets the requirements.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/pull/81#issuecomment-974566504 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 20 November 2021 01:17:13 UTC