tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

RTCIdentityProvider.webidl (2298B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/.
      5 *
      6 * http://w3c.github.io/webrtc-pc/ (with https://github.com/w3c/webrtc-pc/pull/178)
      7 */
      8 
      9 [LegacyNoInterfaceObject,
     10 Exposed=Window]
     11 interface RTCIdentityProviderRegistrar {
     12  undefined register(RTCIdentityProvider idp);
     13 
     14  /* Whether an IdP was passed to register() to chrome code. */
     15  [ChromeOnly]
     16  readonly attribute boolean hasIdp;
     17  /* The following two chrome-only functions forward to the corresponding
     18   * function on the registered IdP.  This is necessary because the
     19   * JS-implemented WebIDL can't see these functions on `idp` above, chrome JS
     20   * gets an Xray onto the content code that suppresses functions, see
     21   * https://developer.mozilla.org/en-US/docs/Xray_vision#Xrays_for_JavaScript_objects
     22   */
     23  /* Forward to idp.generateAssertion() */
     24  [ChromeOnly, Throws]
     25  Promise<RTCIdentityAssertionResult>
     26  generateAssertion(DOMString contents, DOMString origin,
     27                    optional RTCIdentityProviderOptions options = {});
     28  /* Forward to idp.validateAssertion() */
     29  [ChromeOnly, Throws]
     30  Promise<RTCIdentityValidationResult>
     31  validateAssertion(DOMString assertion, DOMString origin);
     32 };
     33 
     34 dictionary RTCIdentityProvider {
     35  required GenerateAssertionCallback generateAssertion;
     36  required ValidateAssertionCallback validateAssertion;
     37 };
     38 
     39 callback GenerateAssertionCallback =
     40  Promise<RTCIdentityAssertionResult>
     41    (DOMString contents, DOMString origin,
     42     RTCIdentityProviderOptions options);
     43 callback ValidateAssertionCallback =
     44  Promise<RTCIdentityValidationResult> (DOMString assertion, DOMString origin);
     45 
     46 dictionary RTCIdentityAssertionResult {
     47  required RTCIdentityProviderDetails idp;
     48  required DOMString assertion;
     49 };
     50 
     51 dictionary RTCIdentityProviderDetails {
     52  required DOMString domain;
     53  DOMString protocol = "default";
     54 };
     55 
     56 dictionary RTCIdentityValidationResult {
     57  required DOMString identity;
     58  required DOMString contents;
     59 };
     60 
     61 dictionary RTCIdentityProviderOptions {
     62  DOMString protocol = "default";
     63  DOMString usernameHint;
     64  DOMString peerIdentity;
     65 };