kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
aa5fac01dd
commit
b237e52d6a
|
@ -85,6 +85,7 @@ representative h-card</a> on %s""" % resp.url)
|
|||
key=key)
|
||||
obj.update({
|
||||
'inbox': '%s/%s/inbox' % (appengine_config.HOST_URL, domain),
|
||||
'outbox': '%s/%s/outbox' % (appengine_config.HOST_URL, domain),
|
||||
})
|
||||
logging.info('Returning: %s', json.dumps(obj, indent=2))
|
||||
|
||||
|
|
|
@ -240,6 +240,7 @@ def postprocess_as2(activity, target=None, key=None):
|
|||
# https://github.com/w3c/activitypub/issues/203#issuecomment-297553229
|
||||
# https://github.com/tootsuite/mastodon/blob/bc2c263504e584e154384ecc2d804aeb1afb1ba3/app/services/activitypub/process_account_service.rb#L77
|
||||
activity['publicKey'] = {
|
||||
'id': activity.get('preferredUsername'),
|
||||
'publicKeyPem': key.public_pem(),
|
||||
}
|
||||
return activity
|
||||
|
@ -334,6 +335,9 @@ def postprocess_as2_actor(actor):
|
|||
actor['id'] = '%s/%s' % (appengine_config.HOST_URL, domain)
|
||||
actor['url'] = redirect_wrap(url)
|
||||
|
||||
# required by pixelfed. https://github.com/snarfed/bridgy-fed/issues/39
|
||||
actor.setdefault('summary', '')
|
||||
|
||||
|
||||
def redirect_wrap(url):
|
||||
"""Returns a URL on our domain that redirects to this URL.
|
||||
|
|
|
@ -118,11 +118,14 @@ class ActivityPubTest(testutil.TestCase):
|
|||
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||
'type' : 'Person',
|
||||
'name': 'Mrs. ☕ Foo',
|
||||
'summary': '',
|
||||
'preferredUsername': 'foo.com',
|
||||
'id': 'http://localhost/foo.com',
|
||||
'url': 'http://localhost/r/https://foo.com/about-me',
|
||||
'inbox': 'http://localhost/foo.com/inbox',
|
||||
'outbox': 'http://localhost/foo.com/outbox',
|
||||
'publicKey': {
|
||||
'id': 'foo.com',
|
||||
'publicKeyPem': MagicKey.get_by_id('foo.com').public_pem(),
|
||||
},
|
||||
}, json.loads(got.body))
|
||||
|
|
Ładowanie…
Reference in New Issue