Cleaned up code a bit
This commit is contained in:
parent
326c549670
commit
744d0ace84
@ -139,7 +139,7 @@ class Notifications:
|
|||||||
algorithm="ES256",
|
algorithm="ES256",
|
||||||
)
|
)
|
||||||
|
|
||||||
def create_encrypted_payload(self, endpoint: str, auth: str, p256dh: str, payload: str):
|
def create_notification_info_with_payload(self, endpoint: str, auth: str, p256dh: str, payload: str):
|
||||||
message_private_key = ec.generate_private_key(ec.SECP256R1(), default_backend())
|
message_private_key = ec.generate_private_key(ec.SECP256R1(), default_backend())
|
||||||
|
|
||||||
message_public_key_bytes = message_private_key.public_key().public_bytes(
|
message_public_key_bytes = message_private_key.public_key().public_bytes(
|
||||||
|
@ -84,7 +84,7 @@ class PushView(BaseFormView):
|
|||||||
"url": "/web.html",
|
"url": "/web.html",
|
||||||
}
|
}
|
||||||
|
|
||||||
notification_info = notifications.create_encrypted_payload(
|
notification_info = notifications.create_notification_info_with_payload(
|
||||||
body['endpoint'],
|
body['endpoint'],
|
||||||
body["keys"]["auth"],
|
body["keys"]["auth"],
|
||||||
body["keys"]["p256dh"],
|
body["keys"]["p256dh"],
|
||||||
|
Loading…
Reference in New Issue
Block a user