R9 Web Push in decePub: one subscription per persona, each with its own token and registration
Build / Build (push) Successful in 56s
Build / Build (push) Successful in 56s
Settings gets "Notifications on this device" (PushEditor): personas, alerts in four groups, policy, a test
notification, after a one-time notice of what the push service learns. Each persona ticked gets its own service
worker registration (push-worker.js at push/{slot}/), so its own endpoint and keys, subscribed with its own token
(IHttpService's *As); nothing PrivaPub stores ties two personas together and the worker never reads the payload's
token. PushService follows the tokens (re-subscribing after a renewal), reconciles at every session start, turns
off before sign-out and drops deleted or suspended personas. A click opens that persona's notifications; the app
badge counts the unread ones. Exchanges now ask for the push scope.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
1 parent
d33697e3fc
commit
ab17959ed4
29 files changed
+2047
-67
No files matched your search
+7
-1
@@ -122,7 +122,8 @@ public static class APIs
|
||||
public const string POST_Revoke = "oauth/revoke";
|
||||
public const string TokenExchangeGrant = "urn:ietf:params:oauth:grant-type:token-exchange";
|
||||
public const string JwtTokenType = "urn:ietf:params:oauth:token-type:jwt";
|
||||
public const string Scopes = "read write follow";
|
||||
// push since R9: a persona's token subscribes that persona to Web Push (PrivaPub's PersonaExchange grants it)
|
||||
public const string Scopes = "read write follow push";
|
||||
}
|
||||
|
||||
public static class Mastodon
|
||||
@@ -196,6 +197,11 @@ public static class APIs
|
||||
public static string GET_M_FavouritedBy(string statusId) => $"api/v1/statuses/{Uri.EscapeDataString(statusId)}/favourited_by";
|
||||
public static string GET_M_RebloggedBy(string statusId) => $"api/v1/statuses/{Uri.EscapeDataString(statusId)}/reblogged_by";
|
||||
public const string POST_Reports = "api/v1/reports";
|
||||
// Web Push: one subscription per access token, so the persona whose token goes with the request
|
||||
public const string GET_PushSubscription = "api/v1/push/subscription";
|
||||
public const string POST_PushSubscription = "api/v1/push/subscription";
|
||||
public const string PUT_PushSubscription = "api/v1/push/subscription";
|
||||
public const string DELETE_PushSubscription = "api/v1/push/subscription";
|
||||
public const string GET_NotificationPolicy = "api/v2/notifications/policy";
|
||||
public const string PATCH_NotificationPolicy = "api/v2/notifications/policy";
|
||||
public const string GET_NotificationRequests = "api/v1/notifications/requests";
|
||||
|
||||
Reference in new issue
Block a user