From 79fd506d30eef3d113f4a8e3ab9ebd9004f1e8cc Mon Sep 17 00:00:00 2001 From: João Augusto Costa Branco Marado Torres Date: Sat, 28 Jun 2025 18:14:22 -0300 Subject: feat: index page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Augusto Costa Branco Marado Torres --- src/lib/pgp/trust.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib/pgp/trust.ts') diff --git a/src/lib/pgp/trust.ts b/src/lib/pgp/trust.ts index cf022b4..34d454b 100644 --- a/src/lib/pgp/trust.ts +++ b/src/lib/pgp/trust.ts @@ -1,19 +1,20 @@ import type { Key } from "npm:openpgp@^6.1.1"; -import { TRUSTED_KEYS_DIR } from "../../consts.ts"; import { createKeysFromDir } from "./create.ts"; import type { AsyncYieldType } from "../../utils/iterator.ts"; import { equal, getCall } from "../../utils/anonymous.ts"; +import { env } from "../env.ts"; let trusted: | Iterable>> | undefined = undefined; const fingerprints = () => + // deno-lint-ignore no-undef Iterator.from(trusted ?? []).map(getCall("getFingerprint")); export async function keyTrust(key: Key): Promise { if (trusted === undefined) { - trusted = await Array.fromAsync(createKeysFromDir(TRUSTED_KEYS_DIR)); + trusted = await Array.fromAsync(createKeysFromDir(env.TRUSTED_KEYS_DIR)); } return fingerprints().some(equal(key.getFingerprint())) ? 255 : 0; } -- cgit v1.2.3