Skip to content

Commit

Permalink
Merge pull request #560 from martinthomson/rtcidentity-dict
Browse files Browse the repository at this point in the history
Changing from callback interface to dictionary for RTCIdentityProvider
  • Loading branch information
alvestrand committed Apr 14, 2016
2 parents d1ca8c0 + c767534 commit afc42c4
Showing 1 changed file with 53 additions and 48 deletions.
101 changes: 53 additions & 48 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,7 @@ <h2>Introduction</h2>
<section id="conformance">
<p>This specification defines conformance criteria that apply to a single
product: the <dfn>user agent</dfn> that implements the interfaces that it
contains with the exception of the <code><a>RTCIdentityProvider</a></code>
interface which is used by the
user agent but not implemented by the user agent.</p>

<p>It also defines conformance criteria for identity providers which provide
implementations of the <code><a>RTCIdentityProvider</a></code>
interface.</p>
contains.</p>

<p>Conformance requirements phrased as algorithms or specific steps may be
implemented in any manner, so long as the end result is equivalent. (In
Expand Down Expand Up @@ -6103,7 +6097,7 @@ <h4 id="sec.create-identity-proxy">Instantiating an IdP Proxy</h4>
<h2 id="sec.register-idp">Registering an IdP Proxy</h2>

<p>An IdP proxy implements the <code><a>RTCIdentityProvider</a></code>
callback interface, which is the means by which the user agent is able to
methods, which are the means by which the user agent is able to
request that an identity assertion be generated or validated.</p>

<p>Once instantiated, the IdP script is executed. The IdP MUST call the
Expand All @@ -6117,70 +6111,82 @@ <h2 id="sec.register-idp">Registering an IdP Proxy</h2>
<dt>void register(RTCIdentityProvider idp)</dt>
<dd>
<p>This method is invoked by the IdP when its script is first
executed. This registers an instance of
<code><a>RTCIdentityProvider</a></code> with the user agent.</p>
executed. This registers
<code><a>RTCIdentityProvider</a></code> methods with the user
agent.</p>
</dd>
</dl>

<section>
<h2>Interface Exposed by Identity Providers</h2>

<p>The <code>RTCIdentityProvider</code> interface is exposed by identity
providers and is called by <code>RTCPeerConnection</code> to acquire or
validate identity assertions.</p>
<p>The callback functions in <code>RTCIdentityProvider</code> are
exposed by identity providers and is called
by <code>RTCPeerConnection</code> to acquire or validate identity
assertions.</p>

<dl class="idl" title="callback interface RTCIdentityProvider">
<dt>Promise&lt;RTCIdentityAssertionResult&gt;
generateAssertion(DOMString contents, DOMString origin,
optional DOMString usernameHint)</dt>
<dl class="idl" title="dictionary RTCIdentityProvider">
<dt>required GenerateAssertionCallback generateAssertion</dt>
<dd>
<p>A user agent invokes this method on the IdP to request the
generation of an identity assertion.</p>

<p>The <var>contents</var> parameter includes the information that the
user agent wants covered by the identity assertion. A successful
validation of the provided assertion MUST produce this string.</p>

<p>The <var>origin</var> parameter identifies the origin of the
<code><a>RTCPeerConnection</a></code> that triggered this request.
An IdP can use this information as input to policy decisions about
use. This value is generated by the <a>user agent</a> based on the
origin of the document that created
the <code>RTCPeerConnection</code> and therefore can be trusted to
be correct.</p>

<p>The IdP selects the identity to assert. The optional
<var>usernameHint</var> parameter is the same value that was passed to
<code>setIdentityProvider</code>.</p>

<p>The IdP provides a promise that resolves to an
<code><a>RTCIdentityAssertionResult</a></code> to successfully
generate an identity assertion. Any other value, or a rejected
promise, is treated as an error.</p>
</dd>

<dt>Promise&lt;RTCIdentityValidationResult&gt;
validateAssertion(DOMString assertion, DOMString origin)</dt>
<dt>required ValidateAssertionCallback validateAssertion</dt>
<dd>
<p>A user agent invokes this method on the IdP to request the
validation of an identity assertion.</p>

<p>The <var>assertion</var> parameter includes the assertion that was
<p>The IdP returns a Promise that resolves to an
<code><a>RTCIdentityValidationResult</a></code> to successfully
validate an identity assertion and to provide the actual identity.
Any other value, or a rejected promise, is treated as an error.</p>
</dd>
</dl>

<dl class="idl" title="callback GenerateAssertionCallback =
Promise&lt;RTCIdentityAssertionResult&gt;"
data-merge="RTCIdentityProvider">
<dt>DOMString contents</dt>
<dd>The <var>contents</var> parameter includes the information that the
user agent wants covered by the identity assertion. A successful
validation of the provided assertion MUST produce this string.</dd>

<dt>DOMString origin</dt>
<dd>The <var>origin</var> parameter identifies the origin of the
<code><a>RTCPeerConnection</a></code> that triggered this request.
An IdP can use this information as input to policy decisions about
use. This value is generated by the <a>user agent</a> based on the
origin of the document that created
the <code>RTCPeerConnection</code> and therefore can be trusted to
be correct.</dd>

<dt>optional DOMString usernameHint</dt>
<dd>The IdP selects the identity to assert. The optional
<var>usernameHint</var> parameter is the same value that was passed to
<code>setIdentityProvider</code>.</dd>
</dl>

<dl class="idl" title="callback ValidateAssertionCallback =
Promise&lt;RTCIdentityValidationResult&gt;"
data-merge="RTCIdentityProvider">
<dt>DOMString assertion</dt>
<dd>The <var>assertion</var> parameter includes the assertion that was
recovered from an <code>a=identity</code> in the session description;
that is, the value that was part of the
<code><a>RTCIdentityAssertionResult</a></code> provided by the IdP
that generated the assertion.</p>
that generated the assertion.</dd>

<p>The <var>origin</var> parameter identifies the origin of the
<dt>DOMString origin</dt>
<dd>The <var>origin</var> parameter identifies the origin of the
<code><a>RTCPeerConnection</a></code> that triggered this request. An
IdP can use this information as input to policy decisions about
use.</p>

<p>The IdP returns a Promise that resolves to an
<code><a>RTCIdentityValidationResult</a></code> to successfully
validate an identity assertion and to provide the actual identity.
Any other value, or a rejected promise, is treated as an error.</p>
</dd>
use.</dd>
</dl>
</section>

Expand Down Expand Up @@ -6259,7 +6265,7 @@ <h3 id="sec.identity-proxy-assertion-request">Requesting Identity
<li>
<p>The <code>RTCPeerConnection</code> invokes the <code><a
href="#widl-RTCIdentityProvider-generateAssertion-Promise-RTCIdentityAssertionResult--DOMString-contents-DOMString-origin-DOMString-usernameHint">generateAssertion</a></code>
method on the <code><a>RTCIdentityProvider</a></code> instance
method on the <code><a>RTCIdentityProvider</a></code> methods
registered by the IdP.</p>

<p>The <code>RTCPeerConnection</code> generates the
Expand Down Expand Up @@ -6394,8 +6400,7 @@ <h3 id="sec.identity-verify-assertion">Verifying Identity Assertions</h3>
<li>
<p>The <code>RTCPeerConnection</code> invokes the <code><a
href="#widl-RTCIdentityProvider-validateAssertion-Promise-RTCIdentityValidationResult--DOMString-assertion-DOMString-origin">validateAssertion</a></code>
method on the <code><a>RTCIdentityProvider</a></code> instance
registered by the IdP.</p>
method registered by the IdP.</p>

<p>The <var>assertion</var> parameter is taken from the decoded
identity assertion. The <var>origin</var> parameter contains the
Expand Down

0 comments on commit afc42c4

Please sign in to comment.