Lwa: Difference between revisions

From IndieWeb
(add planned feature set for Lwa)
Β 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
{{stub}}


'''<dfn>Lwa</dfn>''' is a in-progress social [[reader]] by {{jackyalcine}} at https://lwa.black.af that aims to provide an adaptive approach to rendering social feeds.
'''<dfn>Lwa</dfn>''' is a in-progress social [[reader]] by {{jackyalcine}} 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 [[reply|a reply proxying bridge]]). Β 


=== Features ===
== 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 [https://developer.mozilla.org/en-US/docs/Web/Web_Components Web Components] optimized for use within Lwa.


* Provide rich interfaces for most post types:
Source code (pending) is at https://git.jacky.wtf/indieweb/lwa-composer
** [[like]]
Β 
** [[reply]]
=== Web Proxy ===
** [[note]]
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.
** [[photo]]
Β 
** [[video]]
<pre>
** [[repost]]
GET /auth?me=https://jacky.wtf/&redirect_uri=https://pwa.example/auth/callback&state=$TOKEN
** [[rsvp]]
Host: pwa.example
** [[event]]
Β 
* Provides an endpoint that can be used for to [[follow]] people via [[rel-subscribe]].
HTTP/1.1 302 Redirect
* Provides endpoints to support [[WebSub]].
Location: https://proxy.example/authorize?id=[random id]
* Provides logic to natively render content from
</pre>
** [[Twitter]]
Β 
** [[ActivityPub]]-centric sites like [[Pleroma]], [[Mastodon]] and [[PixelFed]]
The proxy server would begin the act of signing in, finding all the available endpoints for use (or only the ones specified in <code>rel[]</code> as part of the initial request) and ask for scopes as provided in <code>scope</code>. After the proxy server handles all of that, it'll redirect to the redirect URI provided with a <code>code</code> query parameter. This can be redeemed with the original value of <code>state</code> to another endpoint, <code>/redeem</code>.
** [[GitHub]]
Β 
<pre>
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/"
}
</pre>
Β 
This request will work once after redemption &mdash; 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, <code>proxy_url</code> 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 ====
* No [[nickname cache]] or [[hashtag cache]] support, to prevent spam.
* The [[published|published date]] cannot be changed.
* These posts are [[public|listed publicly]] with a [[audience|global audience]].
* Every post lives as an [[expire|expiring post]] with it being marked as such with <code>dt-expired</code>.
* These posts do not send Webmentions out, but they can receive them. This is meant to be a [[spam]] prevention measure.
Β 
== Goals ==
Β 
* [[Micropub]], [[Microsub]] and [[WebSub]] client
* Adaptive timeline views ([[photo]]/[[video]]-optimized, [[audio]]-optimized, replies, reactions)
* Checking if a [[reaction]] was made to a particular post
* Inline [[reaction]] views from source and syndicated sources (configurable, requiring auth)
* [[Web sign-in]]
* [[backfeed]] some social operations like [[follow|following]] and [[block|blocking]] to one's [[micropub|Micropub server]] with [[visibility]] and [[audience]] put into consideration.
* auto [[follow|following]] by looking for [[follow]] posts in a particular feed authored by oneself


== See Also ==
== See Also ==


* [[Microsub]]
* [[Microsub]]
* https://v2.jacky.wtf/post/245d4227-9d03-49d6-b258-a20b5c10527b
* [[Aperture]]
* [[Monocle]]

Latest revision as of 15:53, 7 April 2022


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