w3c / webrtc-identity

Specification of the Identity framework for WebRTC
https://w3c.github.io/webrtc-identity/
Other
4 stars 12 forks source link

Ambiguous definition for IdP errors #14

Open dontcallmedom opened 7 years ago

dontcallmedom commented 7 years ago

Initially raised by @soareschen at https://github.com/w3c/webrtc-pc/issues/1511

In the last step of 9.3 Requesting Identity Assertions:

If assertion generation fails, then the promise for the corresponding function call is rejected with a newly created OperationError.

This is not consistent with several other sections.

Section 9.5 also do not distinguish well of which error is returned by the IdP proxy callback, vs which error is returned by the RTCPeerConnection methods. For example:

Some of the failure do not have defined error type. For example 9.4.9 says:

  1. The RTCPeerConnection validates that the domain portion of the identity matches the domain of the IdP as described in [RTCWEB-SECURITY-ARCH]. If this check fails then the identity validation fails.

If identity validation fails and there is a target peer identity for the RTCPeerConnection, the promise returned by setRemoteDescription MUST be rejected with the same DOMException.

So it's not clear if in such as do setRemoteDescription get rejected with OperationError?

I think the error sections can be rewritten with more concise definitions by separating them into multiple phases. And for each kind of failure, the specific type of error should be mentioned in the same step.

dontcallmedom commented 7 years ago

Comment by @fluffy

@martinthomson - have a look at this