- commit
- 5d7e3a563da6fc261255adefd4f35abf47b6c9d2
- parent
- bf7b437c8fb6825d2b8c2391a1c05da85aff9908
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 2 | +- |
| M | src/ | 2 | +- |
| M | src/ | 2 | +- |
| M | src/ | 2 | +- |
| M | src/ | 3 | --- |
| M | src/ | 2 | +- |
| M | src/ | 10 | ++-------- |
| M | test/ | 2 | +- |
@@ -10,7 +10,7 @@
1010 import { validate, type Event } from "./event.ts";1111 import { parseFilter, type Filter } from "./filter.ts";1212 import { hllOffset } from "./hll.ts";13-import { verifyNIP98 } from "./manage.ts";13+import { verifyNIP98 } from "./auth.ts";1414 import { readGate } from "./gates.ts";1515 import type { Relay } from "./relay.ts";1616 @@ -5,7 +5,7 @@
55 // The file is streamed in pages by sequence into an R2 multipart upload, so66 // a large relay never holds its history in memory. Every part but the last77 // is exactly PART bytes, which is what R2 requires.8-import { verifyNIP98 } from "./manage.ts";8+import { verifyNIP98 } from "./auth.ts";99 import { can } from "./roles.ts";1010 import type { Relay } from "./relay.ts";1111 @@ -6,7 +6,7 @@
66 // rule does not: the owner asked for these. The file counts as media while77 // it exists and is deleted when the job is done.88 import { validate, now, type Event } from "./event.ts";9-import { verifyNIP98 } from "./manage.ts";9+import { verifyNIP98 } from "./auth.ts";1010 import { can } from "./roles.ts";1111 import { ERR_DUPLICATE } from "./store.ts";1212 import { newJobID, type Job } from "./jobs.ts";@@ -4,7 +4,7 @@
44 import { Relay, type Env } from "./relay.ts";55 import { landing } from "./landing.ts";66 import { FAVICON_SVG } from "./ui.ts";7-import { verifyNIP98 } from "./manage.ts";7+import { verifyNIP98 } from "./auth.ts";88 import { leaseNames, leaseDays, validName } from "./names.ts";99 import { now } from "./event.ts";1010 import { clientIP, customHost, hostnameKnown, leaseAllowed } from "./edge.ts";@@ -12,7 +12,6 @@ import { inviteCreator, listInvites, memberInviteGate, mintInvite, revokeInvite
1212 import { descriptor, type Blob } from "./blossom.ts";1313 import { badBlockedWord, blockedWords, gateFields, isWriteRule, limitFields, viewFields, type Policy, type Settings } from "./settings.ts";1414 import { isReplaceable, isProtected, publicFields, dumpFields, validIP } from "./settings.ts";15-export { validIP };1615 import { checkPullURL } from "./pull.ts";1716 import { VIEWS, publishView, viewsSummary } from "./views.ts";1817 import { MAX_PINS } from "./groups.ts";@@ -23,9 +22,7 @@ import { can, type Action, type Role } from "./roles.ts";
2322 import { detailOf } from "./audit.ts";2423 import { PRESETS, applyPreset, findPreset } from "./presets.ts";2524 import { addDomain, checkDomain, listDomains, removeDomain } from "./domains.ts";26-2725 import { verifyNIP98 } from "./auth.ts";28-export { verifyNIP98 };2926 3027 // A call: the relay and the request, who is calling and as what, the3128 // parameters with their readers, and how to answer.@@ -12,7 +12,7 @@
1212 import { sha256 } from "@noble/hashes/sha2.js";1313 import { tagValues } from "./event.ts";1414 import { bytesToHex } from "./negentropy.ts";15-import { verifyNIP98 } from "./manage.ts";15+import { verifyNIP98 } from "./auth.ts";1616 import { can } from "./roles.ts";1717 import { EXT, blobBlocked, blobURL, blossom, nip94Tags, storeBlob, type Blob } from "./blossom.ts";1818 import type { Relay } from "./relay.ts";@@ -11,29 +11,24 @@ import { discovery } from "./nip66.ts";
1111 import { Audit } from "./audit.ts";1212 import { ERR_DUPLICATE, ERR_TOO_BIG, Store, type Access } from "./store.ts";1313 import { Settings, isReplaceable, isProtected } from "./settings.ts";14+import { blobBytes, type Blob } from "./blossom.ts";15+import { DIGEST_DAYS, digestText, notify, fuelLow, fuelText } from "./notify.ts";1416 import { Succession } from "./succession.ts";1517 import { isGated, route } from "./routes.ts";1618 import { guestPass, readGate, writeGate } from "./gates.ts";1719 import { Fuel, fuelConfig, acceptReceipt, type Fetcher, type LnurlParams } from "./fuel.ts";1820 import { Identity } from "./identity.ts";1921 import { Bucket } from "./ratelimit.ts";20-import { blobBytes } from "./blossom.ts";2122 import { dumpBytes, dumpDue, writeDump } from "./dumps.ts";2223 import { importBytes } from "./imports.ts";23-import { DIGEST_DAYS, digestText } from "./notify.ts";2424 import { claimFromProfile } from "./nip05.ts";25-import { checkInvite, claimInviteRequest, invitePage, termsPage } from "./invites.ts";26-import { verifyNIP98, whoAsks } from "./auth.ts";2725 import type { PullFilter, PullJob, PullResult } from "./pull.ts";2826 import { leaseDays, leaseNames, validName } from "./names.ts";2927 import { MAX_JOBS, MAX_STANDING, checkJob, finishRun, newJobID, pruneFinished, pullView, runRound, startRun, type Job, type JobSpec } from "./jobs.ts";3028 import { Hostnames, forgetDomains } from "./domains.ts";3129 import { hostOf } from "./edge.ts";3230 import { groupFacts, handleGroupEvent, isGroupManagement, isNIP43Request } from "./groups.ts";33-import { isPagePath, pages } from "./pages.ts";34-import { notify, fuelLow, fuelText } from "./notify.ts";3531 import { markView, notePresence, viewsTick } from "./views.ts";36-import type { Blob } from "./blossom.ts";3732 import { KIND_VANISH, KIND_AUTH, KIND_REPORT, KIND_NOSTR_CONNECT, KIND_GROUP_MEMBERS, KIND_GROUP_PINS, KIND_RELAY_DISCOVERY } from "./kinds.ts";3833 3934 export interface Env {@@ -428,7 +423,6 @@ export class Relay extends DurableObject<Env> {
428423 429424 // mayUpload applies the write policy to Blossom uploads. "" allows.430425 mayUpload(pubkey: string, host: string): string {431- const p = this.settings.policy;432426 if (this.settings.isUnclaimed()) return "restricted: this relay is unclaimed";433427 if (this.settings.leaseExpired(now())) return "restricted: this temporary relay has expired";434428 if (this.settings.isBanned(pubkey)) return "blocked: this pubkey is banned from this relay";@@ -37,7 +37,7 @@ async function seed(name: string) {
3737 3838 describe("NIP-77 across a wake", () => {3939 it("carries a sync on from the store after the session left memory", async () => {40- const { host, c, notes, stray, mine } = await seed("syncwake");40+ const { c, notes, stray, mine } = await seed("syncwake");4141 const neg = new Negentropy(mine.map(item), sha256);4242 c.send("NEG-OPEN", "s1", { kinds: [1] }, bytesToHex(neg.initiate()));4343 const first = await c.expect("NEG-MSG");