Implement account public key endpoint
This commit is contained in:
parent
a3cef6e9b5
commit
cba73d6bc1
6 changed files with 66 additions and 52 deletions
19
src/server/activitypub/publickey.ts
Normal file
19
src/server/activitypub/publickey.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import * as express from 'express';
|
||||
import context from '../../common/remote/activitypub/renderer/context';
|
||||
import render from '../../common/remote/activitypub/renderer/key';
|
||||
import config from '../../conf';
|
||||
import withUser from './with-user';
|
||||
|
||||
const app = express();
|
||||
app.disable('x-powered-by');
|
||||
|
||||
app.get('/@:user/publickey', withUser(username => {
|
||||
return `${config.url}/@${username}/publickey`;
|
||||
}, (user, req, res) => {
|
||||
const rendered = render(user);
|
||||
rendered['@context'] = context;
|
||||
|
||||
res.json(rendered);
|
||||
}));
|
||||
|
||||
export default app;
|
||||
Loading…
Add table
Add a link
Reference in a new issue