ActivityPubでリモートのオブジェクトをGETするときのリクエストをHTTP Signatureで署名するオプション (#6731)

* Sign ActivityPub GET

* Fix v12, v12.48.0 UI bug
This commit is contained in:
MeiMei 2020-10-18 01:46:40 +09:00 committed by GitHub
parent ba3c62bf9c
commit 85a0f696bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 298 additions and 8 deletions

View file

@ -0,0 +1,17 @@
import { createSystemUser } from './create-system-user';
import { ILocalUser } from '../models/entities/user';
import { Users } from '../models';
const ACTOR_USERNAME = 'instance.actor' as const;
export async function getInstanceActor(): Promise<ILocalUser> {
const user = await Users.findOne({
host: null,
username: ACTOR_USERNAME
});
if (user) return user as ILocalUser;
const created = await createSystemUser(ACTOR_USERNAME);
return created as ILocalUser;
}