This differential implements a function that encrypts parts of iOS notification payload that are important to user's privacy
Details
Details
- Pull cookie of currently logged in user from MariaDB.
- Call this function in the keyserver code where iOS notification is constructed with hardcoded cookie id.
- Send notification to the physical iOS device. Log content of send notification and ensure relevant fields are encrypted.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-3026
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
Comment Actions
- Validate every notification field before encryption attempt
- Encrypt more fields in notification payload
Comment Actions
One request inline; please address before landing, or feel free to re-request review if you disagree or if I'm missing something
keyserver/src/push/crypto.js | ||
---|---|---|
41 ↗ | (On Diff #26554) | Can we construct a new Notification rather than mutating the existing one? |
Comment Actions
I should have been more specific
keyserver/src/push/crypto.js | ||
---|---|---|
12 ↗ | (On Diff #26611) | Rather than cloning the existing notification, can you create a new empty one, and fill in its fields as necessary? |
Comment Actions
Return apn.Notifications object in case of encryption failure. Previous apprhac used '...' syntax, and it failed further since the returned object didn't have 'length()' method.
keyserver/src/push/crypto.js | ||
---|---|---|
12 ↗ | (On Diff #26651) | Let's construct a new apn.Notification instead of cloning the one we're passed in |
We definitely should return something from this lambda since otherwise it is useless to assign it to variable.
If we find that we don't have permissions then just calling await this.requestAndroidNotificationsPermission(); would result in a prompt asking for notifications permissions. However if the user grants those permissions then hasPermissions is still falsy (since promise returned nothing), so deviceToken will be set to null. Nevertheless permissions are actually granted byt the OS, so the state on the device and keyserver would heal itself on next render.
This differential fixes this case so that if user grants permissions correct state is achieved immediately without need for additional re-render to heal the state.