Skip to content

Complete UnifiedPush integration with WebPush payload encryption - #91

Draft
koo5 with Copilot wants to merge 2 commits into
masterfrom
copilot/finish-unifiedpush-integration
Draft

Complete UnifiedPush integration with WebPush payload encryption#91
koo5 with Copilot wants to merge 2 commits into
masterfrom
copilot/finish-unifiedpush-integration

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

UnifiedPush distributors require WebPush-encrypted payloads to deliver notification content securely, which the backend previously did not support. This PR introduces WebPush encryption to the push notification pipeline to fully support UnifiedPush clients.

Changes

  • Client Registration: Modified Android PushServiceImpl and PushDistributorManager to extract and transmit the WebPush pubkey and auth secrets during push endpoint registration.
  • Database Schema: Expanded the PushRegistration model with webpush_auth and webpush_p256dh columns, alongside the required Alembic migration.
  • Push Delivery: Integrated pywebpush into the backend notification dispatcher. When WebPush keys are present, the backend now encrypts the payload via standard WebPush protocol, falling back to a plain HTTP POST otherwise.
# Payload encryption and dispatch via pywebpush
subscription_info = {
    "endpoint": registration.push_endpoint,
    "keys": {
        "auth": registration.webpush_auth,
        "p256dh": registration.webpush_p256dh
    }
}
payload = json.dumps({"content": "activity_update", "encrypted": True})

await asyncio.to_thread(
    webpush,
    subscription_info=subscription_info,
    data=payload,
    vapid_private_key=None,
    vapid_claims=None,
    ttl=86400,
    timeout=10.0
)

Copilot AI changed the title [WIP] Finish UnifiedPush integration Complete UnifiedPush integration with WebPush payload encryption Jun 25, 2026
Copilot finished work on behalf of koo5 June 25, 2026 20:58
Copilot AI requested a review from koo5 June 25, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants