monkeeShark/src/remote/activitypub/renderer/key.ts
2019-04-08 03:35:02 +09:00

10 lines
364 B
TypeScript

import config from '../../../config';
import { ILocalUser } from '../../../models/entities/user';
import { UserKeypair } from '../../../models/entities/user-keypair';
export default (user: ILocalUser, key: UserKeypair) => ({
id: `${config.url}/users/${user.id}/publickey`,
type: 'Key',
owner: `${config.url}/users/${user.id}`,
publicKeyPem: key.publicKey
});