Ryan Barrett 2022-11-16 10:09:24 -08:00
rodzic 870ffbbbd2
commit 320b117470
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 6BE31FDF4776E9D4
5 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -100,6 +100,7 @@ def actor(domain):
obj.update({
'preferredUsername': domain,
'inbox': f'{request.host_url}{domain}/inbox',
'sharedInbox': f'{request.host_url}inbox',
'outbox': f'{request.host_url}{domain}/outbox',
'following': f'{request.host_url}{domain}/following',
'followers': f'{request.host_url}{domain}/followers',
@ -112,9 +113,10 @@ def actor(domain):
})
@app.post(f'/inbox')
@app.post(f'/<regex("{common.DOMAIN_RE}"):domain>/inbox')
def inbox(domain):
"""Accepts POSTs to /[DOMAIN]/inbox and converts to outbound webmentions."""
"""Handles ActivityPub inbox delivery."""
body = request.get_data(as_text=True)
logger.info(f'Got: {body}')

Wyświetl plik

@ -43,7 +43,7 @@ class User(StringIdModel):
# while depending on the amount of randomness available.
pubexp, mod, privexp = magicsigs.generate()
user = User(id=domain, mod=mod, public_exponent=pubexp,
private_exponent=privexp)
private_exponent=privexp)
user.put()
return user

Wyświetl plik

@ -174,6 +174,7 @@ class ActivityPubTest(testutil.TestCase):
'id': 'http://localhost/foo.com',
'url': 'http://localhost/r/https://foo.com/about-me',
'inbox': 'http://localhost/foo.com/inbox',
'sharedInbox': 'http://localhost/inbox',
'outbox': 'http://localhost/foo.com/outbox',
'following': 'http://localhost/foo.com/following',
'followers': 'http://localhost/foo.com/followers',

Wyświetl plik

@ -63,6 +63,10 @@ class WebfingerTest(testutil.TestCase):
'rel': 'inbox',
'type': 'application/activity+json',
'href': 'http://localhost/foo.com/inbox'
}, {
'rel': 'sharedInbox',
'type': 'application/activity+json',
'href': 'http://localhost/inbox'
}, {
'rel': 'http://schemas.google.com/g/2010#updates-from',
'type': 'application/atom+xml',

Wyświetl plik

@ -123,6 +123,13 @@ class Actor(flask_util.XrdOrJrd):
'rel': 'inbox',
'type': common.CONTENT_TYPE_AS2,
'href': f'{request.host_url}{domain}/inbox',
}, {
# AP reads this from the AS2 actor, not webfinger, so strictly
# speaking, it's probably not needed here.
# https://www.w3.org/TR/activitypub/#sharedInbox
'rel': 'sharedInbox',
'type': common.CONTENT_TYPE_AS2,
'href': f'{request.host_url}inbox',
},
# OStatus