janeirodigital / sai-js

Typescript library for Solid Application Interoperability
https://sai.js.org/
MIT License
8 stars 6 forks source link

Provide Web Push to Webhooks service #83

Open elf-pavlik opened 5 months ago

elf-pavlik commented 5 months ago

Since Web Push requires the sender's public key to create a subscription, it is very limited if the sender is one of many resource servers. Authorization Agent is a great place to offer Web Push subscription service that creates Webhook channels with all the resource servers and forwards notifications from Webhooks to Web Push.

sequenceDiagram
  participant App
  participant AA
  participant RS1
  participant RS2
  participant RS3

  App ->> AA: Create Web Push channel
  AA ->> RS1: Create Webhook channel
  loop Every notification
    RS1-->>AA: Deliver notification
    AA -->>App: Forward notification
  end
  App ->> AA: Create Web Push channel
  AA ->> RS2: Create Webhook channel
  loop Every notification
    RS2-->>AA: Deliver notification
    AA -->>App: Forward notification
  end
  App ->> AA: Create Web Push channel
  AA ->> RS3: Create Webhook channel
  loop Every notification
    RS3->>AA: Deliver notification
    AA -->>App: Forward notification
  end