kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
870ffbbbd2
commit
320b117470
|
@ -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}')
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue