Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add /notify endpoint #17

Merged
merged 1 commit into from
Mar 2, 2024
Merged

feat: add /notify endpoint #17

merged 1 commit into from
Mar 2, 2024

Conversation

link2xt
Copy link
Contributor

@link2xt link2xt commented Feb 27, 2024

Going to use OpenPGP to encrypt tokens.

@link2xt link2xt force-pushed the link2xt/notify-endpoint branch from 6b5393e to f475be5 Compare February 27, 2024 13:55
src/server.rs Outdated
async fn notify_device(mut req: tide::Request<State>) -> tide::Result<tide::Response> {
let token_encrypted = req.body_string().await?; // or body_bytes for Vec<u8>
info!("Got direct notification for {token_encrypted}.");
// TODO decrypt token with pgp and notify that it got new messages.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for a first landing of PRs we could also not do the encryption/decryption ... the chatmail instance then sees the cleartext token but it's unclear anyway how much this is a problem. I regard the core2notification-server encryption as an optimization that could come after it works (maybe even on a new endpoint then).

@link2xt link2xt force-pushed the link2xt/notify-endpoint branch 3 times, most recently from 5a0170a to 1367a96 Compare February 29, 2024 19:31
@link2xt link2xt marked this pull request as ready for review February 29, 2024 19:36
Copy link
Member

@r10s r10s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apart from the localisation IDs and the default wording, lgtm

Co-authored-by: bjoern <r10s@b44t.com>
@link2xt link2xt force-pushed the link2xt/notify-endpoint branch from 6862166 to 7874c0e Compare March 2, 2024 23:25
@link2xt link2xt merged commit 7874c0e into main Mar 2, 2024
2 checks passed
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.

3 participants