mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-25 09:30:33 +00:00
pylint fixes
This commit is contained in:
parent
c7adb62831
commit
56a062d01f
3 changed files with 4 additions and 4 deletions
|
@ -540,7 +540,7 @@ async def sign_and_send(
|
||||||
|
|
||||||
digest = make_digest(data)
|
digest = make_digest(data)
|
||||||
signature = make_signature(
|
signature = make_signature(
|
||||||
"post", sender, destination, now, digest, kwargs.get("use_legacy_key")
|
"post", sender, destination, now, digest=digest, use_legacy_key=kwargs.get("use_legacy_key")
|
||||||
)
|
)
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
|
|
|
@ -23,7 +23,7 @@ def create_key_pair():
|
||||||
|
|
||||||
|
|
||||||
def make_signature(
|
def make_signature(
|
||||||
method, sender, destination, date, digest=None, use_legacy_key=False
|
method, sender, destination, date, **kwargs
|
||||||
):
|
):
|
||||||
"""uses a private key to sign an outgoing message"""
|
"""uses a private key to sign an outgoing message"""
|
||||||
inbox_parts = urlparse(destination)
|
inbox_parts = urlparse(destination)
|
||||||
|
@ -33,6 +33,7 @@ def make_signature(
|
||||||
f"date: {date}",
|
f"date: {date}",
|
||||||
]
|
]
|
||||||
headers = "(request-target) host date"
|
headers = "(request-target) host date"
|
||||||
|
digest = kwargs.get("digest")
|
||||||
if digest is not None:
|
if digest is not None:
|
||||||
signature_headers.append(f"digest: {digest}")
|
signature_headers.append(f"digest: {digest}")
|
||||||
headers = "(request-target) host date digest"
|
headers = "(request-target) host date digest"
|
||||||
|
@ -43,7 +44,7 @@ def make_signature(
|
||||||
# For legacy reasons we need to use an incorrect keyId for older Bookwyrm versions
|
# For legacy reasons we need to use an incorrect keyId for older Bookwyrm versions
|
||||||
key_id = (
|
key_id = (
|
||||||
f"{sender.remote_id}#main-key"
|
f"{sender.remote_id}#main-key"
|
||||||
if use_legacy_key
|
if kwargs.get("use_legacy_key")
|
||||||
else f"{sender.remote_id}/#main-key"
|
else f"{sender.remote_id}/#main-key"
|
||||||
)
|
)
|
||||||
signature = {
|
signature = {
|
||||||
|
|
|
@ -3,7 +3,6 @@ import json
|
||||||
import re
|
import re
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from urllib.parse import urldefrag
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from django.http import HttpResponse, Http404
|
from django.http import HttpResponse, Http404
|
||||||
|
|
Loading…
Reference in a new issue