Translate/remove new comments

This commit is contained in:
Norm 2022-07-30 18:59:04 -04:00
parent c1547c9159
commit 4753b5058c
Signed by: norm
GPG Key ID: 7123E30E441E80DE
3 changed files with 6 additions and 9 deletions

View File

@ -39,7 +39,7 @@ export default async (job: Bull.Job<InboxJobData>): Promise<string> => {
return `Blocked request: ${host}`;
}
// 非公開モードなら許可なインスタンスのみ
// Only permitted instances if in private mode.
if (meta.privateMode && !meta.allowedHosts.includes(host)) {
return `Blocked request: ${host}`;
}

View File

@ -37,31 +37,28 @@ export default async function checkFetch(req: IncomingMessage): Promise<number>
const dbResolver = new DbResolver();
// HTTP-Signature keyIdを元にDBから取得
// Get user from database based on HTTP-Signature keyId
let authUser = await dbResolver.getAuthUserFromKeyId(signature.keyId);
// keyIdでわからなければ、resolveしてみる
// If keyid is unknown, try resolving it
if (authUser == null) {
try {
keyId.hash = '';
authUser = await dbResolver.getAuthUserFromApId(getApId(keyId.toString()));
} catch (e) {
// できなければ駄目
return 403;
}
}
// publicKey がなくても終了
if (authUser?.key == null) {
return 403;
}
// もう一回チェック
if (authUser.user.host !== host) {
return 403;
}
// HTTP-Signatureの検証
// HTTP-Signature validation
const httpSignatureValidated = httpSignature.verifySignature(signature, authUser.key.keyPem);
if (!httpSignatureValidated) {

View File

@ -693,8 +693,8 @@ export interface IEndpointMeta {
readonly secure?: boolean;
/**
*
* false
* If in private mode, whether credentials are required when making a request to this endpoint.
* If omitted, this is interpreted as false.
*/
readonly requireCredentialPrivateMode?: boolean;