Lwa

From IndieWeb
(Redirected from lwa)


Lwa is a in-progress social reader by Jacky Alcinรฉ that aims to provide a people-centric approach to the social Web. It's comprised of a PWA for the Web browser, a proxy server for handling requests from Micropub and Microsub as well (for handling Web sign-in, post type discovery and a reply proxying bridge).

Experiments

Composable Editor

The composable Micropub editor provided in Lwa is meant to be the advanced mode of the editing experience; for those who want to craft a particular item down to the property. This is a set of Web Components optimized for use within Lwa.

Source code (pending) is at https://git.jacky.wtf/indieweb/lwa-composer

Web Proxy

Allowing a PWA to participate 'natively' with the IndieWeb requires the use of a trusted Web server. This proxy aims to provide an approved PWA to have its requests proxied through. The flow follows.

GET /auth?me=https://jacky.wtf/&redirect_uri=https://pwa.example/auth/callback&state=$TOKEN
Host: pwa.example

HTTP/1.1 302 Redirect
Location: https://proxy.example/authorize?id=[random id]

The proxy server would begin the act of signing in, finding all the available endpoints for use (or only the ones specified in rel[] as part of the initial request) and ask for scopes as provided in scope. After the proxy server handles all of that, it'll redirect to the redirect URI provided with a code query parameter. This can be redeemed with the original value of state to another endpoint, /redeem.

POST /redeem
Host: pwa.example
.. Browser-specific CORS headers ..

state=$STATE
code=$CODE


HTTP/1.1 200 OK
Content-Type: application/json

{
  "rels": {
    "micropub": ["http://proxy.example/endpoint/UUID0"]
  },
  "rel-urls": {
    "http://jacky.example/micropub": {
       "rels": ["micropub"],
       "proxy_url": "http://proxy.example/endpoint/UUID0",
       "title": "Content"
    }
  },
  "me": "https://jacky.example/"
}

This request will work once after redemption — the values should be stored into either session or local storage for later use. It returns the following:

  • rels: List of endpoint URLs, mapped by their corresponding rel
  • rel-urls: A mapping of relations by their URL. There's an additional key, proxy_url which serves as the CORS-friendly proxy URL for this endpoint.

Notes

  • Q: Should proxy endpoints have lifespans? This would enforce hygiene on PWA clients.
  • Q: Can we expand this to allow people to always proxy their endpoint - being "Cloudflare of Micropub"?
  • Q: Can requests can be sent elsewhere (e-mail?)

Local Micropub

On the off chance someone doesn't have the ability to use Micropub on their site, Lwa can store posts for authenticated users for at most a month. A read only endpoint for querying posts, tags and the like will be available.

Caveats

Goals

See Also