Upgrade deps

This commit is contained in:
Alex Gleason 2023-08-04 14:48:37 -05:00
parent f418496bbb
commit dc6b52f6d8
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
5 changed files with 21 additions and 17 deletions

View File

@ -14,6 +14,10 @@ lint:
stage: test stage: test
script: deno lint script: deno lint
check:
stage: test
script: deno task check
test: test:
stage: test stage: test
script: deno task test script: deno task test

View File

@ -3,7 +3,8 @@
"lock": false, "lock": false,
"tasks": { "tasks": {
"start": "deno run --allow-read --allow-write=data --allow-env --allow-net --unstable --watch src/server.ts", "start": "deno run --allow-read --allow-write=data --allow-env --allow-net --unstable --watch src/server.ts",
"test": "deno test --allow-read --allow-write=data --allow-env --unstable src" "test": "deno test --allow-read --allow-write=data --allow-env --unstable src",
"check": "deno check --unstable src/server.ts"
}, },
"imports": { "imports": {
"@/": "./src/" "@/": "./src/"

View File

@ -29,7 +29,7 @@ const Conf = {
get cryptoKey() { get cryptoKey() {
return crypto.subtle.importKey( return crypto.subtle.importKey(
'raw', 'raw',
secp.utils.hexToBytes(Conf.seckey), secp.etc.hexToBytes(Conf.seckey),
{ name: 'HMAC', hash: 'SHA-256' }, { name: 'HMAC', hash: 'SHA-256' },
false, false,
['sign', 'verify'], ['sign', 'verify'],

View File

@ -3,12 +3,12 @@ export {
type Env as HonoEnv, type Env as HonoEnv,
type Handler, type Handler,
Hono, Hono,
HTTPException,
type MiddlewareHandler, type MiddlewareHandler,
} from 'https://deno.land/x/hono@v3.0.2/mod.ts'; } from 'https://deno.land/x/hono@v3.3.4/mod.ts';
export { HTTPException } from 'https://deno.land/x/hono@v3.0.2/http-exception.ts'; export { cors, logger } from 'https://deno.land/x/hono@v3.3.4/middleware.ts';
export { cors, logger } from 'https://deno.land/x/hono@v3.0.2/middleware.ts';
export { z } from 'https://deno.land/x/zod@v3.21.4/mod.ts'; export { z } from 'https://deno.land/x/zod@v3.21.4/mod.ts';
export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.5.3'; export { Author, RelayPool } from 'https://dev.jspm.io/nostr-relaypool@0.6.28';
export { export {
type Filter, type Filter,
finishEvent, finishEvent,
@ -21,24 +21,23 @@ export {
nip19, nip19,
nip21, nip21,
verifySignature, verifySignature,
} from 'npm:nostr-tools@^1.12.1'; } from 'npm:nostr-tools@^1.14.0';
export { findReplyTag } from 'https://gitlab.com/soapbox-pub/mostr/-/raw/c67064aee5ade5e01597c6d23e22e53c628ef0e2/src/nostr/tags.ts'; export { findReplyTag } from 'https://gitlab.com/soapbox-pub/mostr/-/raw/c67064aee5ade5e01597c6d23e22e53c628ef0e2/src/nostr/tags.ts';
export { parseFormData } from 'npm:formdata-helper@^0.3.0'; export { parseFormData } from 'npm:formdata-helper@^0.3.0';
// @deno-types="npm:@types/lodash@4.14.194" // @deno-types="npm:@types/lodash@4.14.194"
export { default as lodash } from 'https://esm.sh/lodash@4.17.21'; export { default as lodash } from 'https://esm.sh/lodash@4.17.21';
export { default as linkify } from 'npm:linkifyjs@^4.1.0'; export { default as linkify } from 'npm:linkifyjs@^4.1.1';
export { default as linkifyStr } from 'npm:linkify-string@^4.1.0'; export { default as linkifyStr } from 'npm:linkify-string@^4.1.1';
import 'npm:linkify-plugin-hashtag@^4.1.0'; import 'npm:linkify-plugin-hashtag@^4.1.1';
// @deno-types="npm:@types/mime@3.0.0" // @deno-types="npm:@types/mime@3.0.0"
export { default as mime } from 'npm:mime@^3.0.0'; export { default as mime } from 'npm:mime@^3.0.0';
export { unfurl } from 'npm:unfurl.js@^6.3.2'; export { unfurl } from 'npm:unfurl.js@^6.3.2';
export { default as TTLCache } from 'npm:@isaacs/ttlcache@^1.4.0'; export { default as TTLCache } from 'npm:@isaacs/ttlcache@^1.4.1';
export { default as uuid62 } from 'npm:uuid62@^1.0.2'; export { default as uuid62 } from 'npm:uuid62@^1.0.2';
// @deno-types="npm:@types/sanitize-html@2.9.0" // @deno-types="npm:@types/sanitize-html@2.9.0"
export { default as sanitizeHtml } from 'npm:sanitize-html@^2.10.0'; export { default as sanitizeHtml } from 'npm:sanitize-html@^2.11.0';
export { default as ISO6391 } from 'npm:iso-639-1@2.1.15'; export { default as ISO6391 } from 'npm:iso-639-1@2.1.15';
export { Dongoose } from 'https://raw.githubusercontent.com/alexgleason/dongoose/68b7ad9dd7b6ec0615e246a9f1603123c1709793/mod.ts'; export { createPentagon } from 'https://deno.land/x/pentagon@v0.1.4/mod.ts';
export { createPentagon } from 'https://deno.land/x/pentagon@v0.1.1/mod.ts';
export { export {
type ParsedSignature, type ParsedSignature,
pemToPublicKey, pemToPublicKey,
@ -47,7 +46,7 @@ export {
verifyRequest, verifyRequest,
} from 'https://gitlab.com/soapbox-pub/fedisign/-/raw/v0.2.1/mod.ts'; } from 'https://gitlab.com/soapbox-pub/fedisign/-/raw/v0.2.1/mod.ts';
export { generateSeededRsa } from 'https://gitlab.com/soapbox-pub/seeded-rsa/-/raw/v1.0.0/mod.ts'; export { generateSeededRsa } from 'https://gitlab.com/soapbox-pub/seeded-rsa/-/raw/v1.0.0/mod.ts';
export * as secp from 'npm:@noble/secp256k1@^1.7.1'; export * as secp from 'npm:@noble/secp256k1@^2.0.0';
export { LRUCache } from 'npm:lru-cache@^10.0.0'; export { LRUCache } from 'npm:lru-cache@^10.0.0';
export { DB as Sqlite } from 'https://deno.land/x/sqlite@v3.7.0/mod.ts'; export { DB as Sqlite } from 'https://deno.land/x/sqlite@v3.7.3/mod.ts';
export * as dotenv from 'https://deno.land/std@0.197.0/dotenv/mod.ts'; export * as dotenv from 'https://deno.land/std@0.197.0/dotenv/mod.ts';

View File

@ -11,7 +11,7 @@ async function buildSeed(pubkey: string): Promise<string> {
const key = await Conf.cryptoKey; const key = await Conf.cryptoKey;
const data = new TextEncoder().encode(pubkey); const data = new TextEncoder().encode(pubkey);
const signature = await window.crypto.subtle.sign('HMAC', key, data); const signature = await window.crypto.subtle.sign('HMAC', key, data);
return secp.utils.bytesToHex(new Uint8Array(signature)); return secp.etc.bytesToHex(new Uint8Array(signature));
} }
async function getPublicKeyPem(pubkey: string): Promise<string> { async function getPublicKeyPem(pubkey: string): Promise<string> {