Git Product home page Git Product logo

web-request-rpc's Introduction

web-request-rpc

JSON-RPC for Web Request Polyfills

The RPC protocol used in this library relies on the use of postMessage and JSON-RPC. While it could potentially be made more general, it is currently targeted at building components that help implement "Web Request" polyfills.

A "Web request" is a catch all for a request made from a Web application (the relying party) that is fulfilled by another Web application (the service provider) that is typically from another origin. There are a number of different "Web requests" such as requests for payment, credentials, social information, or media. Each of these may have a Web API that is narrowly targeted (or includes specific features related to) at the specific type of request, however, each of them follow the same general model. This means some building blocks for creating polyfills for these sorts of "Web requests" can be shared.

Some of these building blocks are provided by this library.

Client

A Client is used to connect to an RPC Server.

TODO

Server

TODO:

WebAppContext

A WebAppContext loads or attaches to a window with a remote Web Application that typically runs on a cross domain website. It is used to manage and provide access this RPC WebApp. It also enables the WebApp to make some control calls, such as to show or hide its UI.

Use cases include:

  1. Loading and communicating with a "Web Request Mediator" that polyfills some missing feature in a user's Web browser that could not be polyfilled without the use of a cross-domain third party website. These features are typically modeled as some kind of request made by one website that will be fulfilled by a different website. The mediator plays the role that the browser would natively provide if it implemented the feature, namely to facilitate communication and interaction between these two sites to process and fulfill the request.
  2. Loading and communicating with a third party service provider Web application. A "Web Request Mediator" (see the first use case) would use a WebAppContext to load these Web applications to enable them to fulfill requests made by a relying party.

TODO: Add note about usefulness of passing a Promise for a window handle when creating/connecting with client/server/WebAppContext/etc. This approach enables a message listener to be attached prior to the creation of the window where access to the window handle is not available until the window has loaded. This is important to prevent missing messages.

WebApp

A Web Application that uses RPC to communicate with a WebAppContext that is loaded by another, typically cross domain, website. This Web Application could be a "Web Request Mediator" that will itself load WebApps, or an application designed to fulfill Web requests.

web-request-rpc's People

Contributors

dlongley avatar gannan08 avatar mattcollier avatar davidlehn avatar ivan770 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.