@ghostdagger/ghostlink-server 0.0.0-stage → 0.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +27 -2
- package/dist/index.d.ts +115 -0
- package/dist/index.js +372 -0
- package/package.json +43 -3
- package/vendor/kaspa/LICENSE +15 -0
- package/vendor/kaspa/README.md +206 -0
- package/vendor/kaspa/kaspa.d.ts +8095 -0
- package/vendor/kaspa/kaspa.js +15629 -0
- package/vendor/kaspa/kaspa_bg.wasm +0 -0
- package/vendor/kaspa/kaspa_bg.wasm.d.ts +881 -0
- package/vendor/kaspa/package.json +20 -0
- package/vendor/provenance.json +15 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GhostDagger contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ghostdagger/ghostlink-server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Node 24 authentication verification, Web handlers, Node HTTP adapter and durable SQLite sessions for Ghostlink.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createGhostlinkServer, createSqliteStorage, createNodeHandler } from '@ghostdagger/ghostlink-server';
|
|
7
|
+
const storage = createSqliteStorage('./data/auth.sqlite');
|
|
8
|
+
const auth = createGhostlinkServer({
|
|
9
|
+
origin: 'https://app.example', loginUri: 'https://app.example/login',
|
|
10
|
+
networks: ['testnet-11'], storage,
|
|
11
|
+
});
|
|
12
|
+
// Web: await auth.handle(request, { ip: trustedPeerAddress });
|
|
13
|
+
// Node: createServer(createNodeHandler(auth)).listen(...);
|
|
14
|
+
// Protected route: await auth.getSession(request);
|
|
15
|
+
// Shutdown: storage.close();
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Mount `/auth/ghostlink/{session,challenge,verify,logout}` on the same origin. The Node adapter validates Host and uses the socket peer for rate limits. Reverse proxies must preserve the trusted host. `getSession` supplies identity, not application authorization or CSRF protection for your own mutations.
|
|
19
|
+
|
|
20
|
+
Defaults: five-minute browser-bound single-use challenges, official Kaspa Schnorr/address checks, 24-hour absolute / 30-minute idle sessions, hashed opaque tokens, HttpOnly/Secure/SameSite=Lax host cookies, CSRF, origin checks, 16-KiB body limit, and persistent rate limits. HTTP requires explicit `allowInsecureLocalhost: true` and a loopback origin. No edge-runtime support.
|
|
21
|
+
|
|
22
|
+
Only standard Schnorr public-key addresses are accepted. Keys can be extracted from those addresses for manual Kaspium login. Server verification prevents replay and enforces the intended message/account/network, but generic message signing is not phishing-resistant. The profile is proposed; no CACAO interoperability or independent audit is claimed.
|
|
23
|
+
|
|
24
|
+
The official rusty-kaspa v2.0.1 Node WASM artifact is packaged unmodified with its ISC license and `vendor/provenance.json` checksums. Do not replace it with a similarly named unofficial npm package. New storage adapters must satisfy `GhostlinkStorage` and `assertStorageConformance` against an empty isolated test store, particularly atomic challenge consumption and session revocation.
|
|
25
|
+
|
|
26
|
+
Pre-release. See the repository's security and live-wallet acceptance documentation before deployment.
|
|
27
|
+
|
|
28
|
+
Beta acceptance status: live protected-API and real testnet transaction checks are deferred. Transaction APIs remain enabled; automated fixtures do not constitute real-wallet certification. See the [compatibility record](https://github.com/ghostdagger-labs/ghostlink/blob/main/docs/testing/compatibility-v1.json).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { Network, AuthChallenge, AuthSession } from '@ghostdagger/ghostlink-core';
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
|
+
|
|
4
|
+
/** Validate a canonical Schnorr public-key address/checksum for the network with the official SDK. Returns identity and hex public key; throws INVALID_REQUEST for unsupported or invalid addresses. */
|
|
5
|
+
declare function validateKaspaAddress(value: string, network: Network): {
|
|
6
|
+
address: string;
|
|
7
|
+
accountId: string;
|
|
8
|
+
publicKey: string;
|
|
9
|
+
};
|
|
10
|
+
/** Verify a 64-byte lowercase hex Schnorr signature against the exact message and address. Returns false on invalid input. Does not check challenge expiry, origin, replay, or application authorization; use createGhostlinkServer for login. */
|
|
11
|
+
declare function verifyKaspaSignature(input: {
|
|
12
|
+
address: string;
|
|
13
|
+
network: Network;
|
|
14
|
+
message: string;
|
|
15
|
+
signature: string;
|
|
16
|
+
publicKey?: string;
|
|
17
|
+
}): boolean;
|
|
18
|
+
|
|
19
|
+
interface BrowserRecord {
|
|
20
|
+
hash: string;
|
|
21
|
+
csrf: string;
|
|
22
|
+
expiresAt: number;
|
|
23
|
+
}
|
|
24
|
+
interface ChallengeRecord extends AuthChallenge {
|
|
25
|
+
browserHash: string;
|
|
26
|
+
issuedAt: number;
|
|
27
|
+
}
|
|
28
|
+
interface SessionRecord {
|
|
29
|
+
hash: string;
|
|
30
|
+
browserHash: string;
|
|
31
|
+
session: AuthSession;
|
|
32
|
+
lastSeen: number;
|
|
33
|
+
receipt: {
|
|
34
|
+
profile: string;
|
|
35
|
+
message: string;
|
|
36
|
+
signature: string;
|
|
37
|
+
publicKey?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** All times are Unix milliseconds. commitLogin MUST atomically consume the challenge and create the session. */
|
|
41
|
+
interface GhostlinkStorage {
|
|
42
|
+
/** Look up an unexpired browser record by its hashed cookie token. */
|
|
43
|
+
getBrowser(hash: string, now: number): Promise<BrowserRecord | null>;
|
|
44
|
+
/** Persist the browser binding and CSRF token. */
|
|
45
|
+
putBrowser(browser: BrowserRecord): Promise<void>;
|
|
46
|
+
/** Store the new challenge, replacing outstanding challenges for the same browser. */
|
|
47
|
+
putChallenge(challenge: ChallengeRecord): Promise<void>;
|
|
48
|
+
/** Look up a challenge only within its bound browser. commitLogin must still enforce expiry. */
|
|
49
|
+
getChallenge(id: string, browserHash: string): Promise<ChallengeRecord | null>;
|
|
50
|
+
/** Atomically consume one unexpired challenge and replace the browser's session. Return false if already consumed, expired, or browser binding is invalid. */
|
|
51
|
+
commitLogin(challengeId: string, browserHash: string, now: number, session: SessionRecord): Promise<boolean>;
|
|
52
|
+
/** Return null for expired/wrong-browser sessions; otherwise refresh lastSeen and idleExpiresAt, capped by absolute expiry. All time arguments are milliseconds. */
|
|
53
|
+
getSession(hash: string, browserHash: string, now: number, idleMs: number): Promise<AuthSession | null>;
|
|
54
|
+
/** Revoke all sessions and outstanding challenges for this browser. */
|
|
55
|
+
revokeBrowser(browserHash: string): Promise<void>;
|
|
56
|
+
/** Atomically consume a request in the given millisecond window; false means the maximum was exceeded. */
|
|
57
|
+
consumeRateLimit(key: string, now: number, windowMs: number, maximum: number): Promise<boolean>;
|
|
58
|
+
/** Remove expired records. now is Unix milliseconds. */
|
|
59
|
+
prune(now: number): Promise<void>;
|
|
60
|
+
/** Optional synchronous shutdown. The storage creator owns calling this when no requests remain. */
|
|
61
|
+
close?(): void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Reusable behavioral checks for a new storage adapter. Run against an isolated, empty test database. */
|
|
65
|
+
declare function assertStorageConformance(store: GhostlinkStorage): Promise<void>;
|
|
66
|
+
|
|
67
|
+
/** Open a Node 24 SQLite store, creating parent directories and schema as needed. Use :memory: for isolated tests; otherwise persist this file. The caller must close the store on shutdown. */
|
|
68
|
+
declare function createSqliteStorage(filename: string): GhostlinkStorage;
|
|
69
|
+
|
|
70
|
+
/** Trusted authentication policy. Origin/network configuration must agree with the browser client. */
|
|
71
|
+
interface GhostlinkServerConfig {
|
|
72
|
+
/** Exact public HTTP(S) origin, including port when present; no path or trailing slash. */
|
|
73
|
+
origin: string;
|
|
74
|
+
/** Absolute same-origin URI included in login messages; no credentials or fragment. */
|
|
75
|
+
loginUri: string;
|
|
76
|
+
/** Persistence adapter. Its creator owns shutdown; use createSqliteStorage for the supplied Node backend. */
|
|
77
|
+
storage: GhostlinkStorage;
|
|
78
|
+
/** Nonempty allowed network list. Defaults to mainnet, testnet-10, and testnet-11. */
|
|
79
|
+
networks?: readonly Network[];
|
|
80
|
+
/** Authentication route prefix without a trailing slash. Defaults to /auth/ghostlink. */
|
|
81
|
+
prefix?: string;
|
|
82
|
+
/** Permit HTTP only for localhost/loopback development. Defaults to false; public origins require HTTPS. */
|
|
83
|
+
allowInsecureLocalhost?: boolean;
|
|
84
|
+
/** Challenge lifetime in milliseconds. Defaults to 300_000 (5 minutes); must be positive and at most 300_000. */
|
|
85
|
+
challengeTtlMs?: number;
|
|
86
|
+
/** Absolute session lifetime in milliseconds. Defaults to 86_400_000 (24 hours); must be a positive safe integer. */
|
|
87
|
+
sessionTtlMs?: number;
|
|
88
|
+
/** Idle session lifetime in milliseconds. Defaults to 1_800_000 (30 minutes); successful getSession calls refresh it, capped by absolute expiry. */
|
|
89
|
+
idleTtlMs?: number;
|
|
90
|
+
/** Future-issued challenge tolerance in milliseconds. Defaults to 30_000; allowed range is 0–30_000. */
|
|
91
|
+
clockSkewMs?: number;
|
|
92
|
+
/** Clock returning Unix milliseconds. Defaults to Date.now; override for deterministic tests. */
|
|
93
|
+
now?: () => number;
|
|
94
|
+
}
|
|
95
|
+
/** Request metadata supplied by a trusted server adapter. */
|
|
96
|
+
interface RequestContext {
|
|
97
|
+
ip?: string;
|
|
98
|
+
}
|
|
99
|
+
/** Create Node authentication handlers with cookie sessions, CSRF checks, and signature verification. Validates policy immediately; does not start an HTTP listener or own storage shutdown. */
|
|
100
|
+
declare function createGhostlinkServer(config: GhostlinkServerConfig): {
|
|
101
|
+
/** Handle session/challenge/verify/logout Web requests under prefix. Pass trusted peer metadata for rate limits; returns HTTP failures as Responses. */
|
|
102
|
+
handle: (request: Request, context?: RequestContext) => Promise<Response>;
|
|
103
|
+
/** Read identity from request cookies, returning null if missing/expired. Refreshes idle expiry. Does not enforce application authorization, origin checks, or CSRF for your own routes. */
|
|
104
|
+
getSession: (request: Request) => Promise<AuthSession | null>;
|
|
105
|
+
/** Validated public origin used for audience and Host checks. */
|
|
106
|
+
origin: string;
|
|
107
|
+
/** Authentication route prefix; mount these routes on the same origin as the browser app. */
|
|
108
|
+
prefix: string;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** Adapt Ghostlink Web handlers to Node HTTP. Mount under server.prefix; validates Host, limits bodies to 16 KiB, forwards cookies, and uses the socket peer for rate limits. Reverse proxies must preserve Host. */
|
|
112
|
+
declare function createNodeHandler(server: ReturnType<typeof createGhostlinkServer>): (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
113
|
+
|
|
114
|
+
export { assertStorageConformance, createGhostlinkServer, createNodeHandler, createSqliteStorage, validateKaspaAddress, verifyKaspaSignature };
|
|
115
|
+
export type { BrowserRecord, ChallengeRecord, GhostlinkServerConfig, GhostlinkStorage, RequestContext, SessionRecord };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
// src/crypto.ts
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { addressPrefix, accountId, GhostlinkError } from "@ghostdagger/ghostlink-core";
|
|
4
|
+
var require2 = createRequire(import.meta.url);
|
|
5
|
+
var kaspa = require2("../vendor/kaspa/kaspa.js");
|
|
6
|
+
function validateKaspaAddress(value, network) {
|
|
7
|
+
let address;
|
|
8
|
+
let key;
|
|
9
|
+
try {
|
|
10
|
+
if (!kaspa.Address.validate(value)) throw new GhostlinkError("INVALID_REQUEST", "The address checksum is invalid. Copy the full receiving address directly from your wallet.");
|
|
11
|
+
address = new kaspa.Address(value);
|
|
12
|
+
if (address.prefix !== addressPrefix(network) || address.toString() !== value) throw new GhostlinkError("INVALID_REQUEST", "The address does not match the selected network or canonical address format.");
|
|
13
|
+
if (address.version !== "PubKey") throw new GhostlinkError("INVALID_REQUEST", "This address type is not supported. Use a standard Schnorr public-key address.");
|
|
14
|
+
key = kaspa.XOnlyPublicKey.fromAddress(address);
|
|
15
|
+
return { address: value, accountId: accountId(value, network), publicKey: key.toString() };
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (error instanceof GhostlinkError) throw error;
|
|
18
|
+
throw new GhostlinkError("INVALID_REQUEST", "Enter a valid Schnorr public-key address for the selected network.");
|
|
19
|
+
} finally {
|
|
20
|
+
key?.free();
|
|
21
|
+
address?.free();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function verifyKaspaSignature(input) {
|
|
25
|
+
let publicKey;
|
|
26
|
+
let derived;
|
|
27
|
+
try {
|
|
28
|
+
const account = validateKaspaAddress(input.address, input.network);
|
|
29
|
+
if (!/^[a-f0-9]{128}$/.test(input.signature)) return false;
|
|
30
|
+
publicKey = new kaspa.PublicKey(input.publicKey ?? account.publicKey);
|
|
31
|
+
derived = publicKey.toAddress(input.network);
|
|
32
|
+
if (derived.toString() !== input.address) return false;
|
|
33
|
+
return kaspa.verifyMessage({ message: input.message, signature: input.signature, publicKey });
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
} finally {
|
|
37
|
+
derived?.free();
|
|
38
|
+
publicKey?.free();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/storage-conformance.ts
|
|
43
|
+
async function assertStorageConformance(store) {
|
|
44
|
+
const assert = (condition, message) => {
|
|
45
|
+
if (!condition) throw new Error(`Storage conformance: ${message}`);
|
|
46
|
+
};
|
|
47
|
+
const now = Date.parse("2026-09-16T12:00:00.000Z");
|
|
48
|
+
await store.putBrowser({ hash: "browser-a", csrf: "csrf", expiresAt: now + 1e4 });
|
|
49
|
+
await store.putBrowser({ hash: "browser-b", csrf: "csrf", expiresAt: now + 1e4 });
|
|
50
|
+
const challenge = { id: "challenge-a", browserHash: "browser-a", profile: "ghostlink-kaspa-v1", address: "fixture-address", network: "testnet-11", message: "fixture", issuedAt: now, expiresAt: new Date(now + 1e3).toISOString() };
|
|
51
|
+
await store.putChallenge(challenge);
|
|
52
|
+
assert(await store.getChallenge(challenge.id, "browser-b") === null, "challenge binding");
|
|
53
|
+
const session = { hash: "session-a", browserHash: "browser-a", lastSeen: now, session: { address: "fixture-address", accountId: "fixture-account", chainId: "kaspa:testnet-11", network: "testnet-11", issuedAt: new Date(now).toISOString(), expiresAt: new Date(now + 4e3).toISOString(), idleExpiresAt: new Date(now + 2e3).toISOString() }, receipt: { profile: "ghostlink-kaspa-v1", message: "fixture", signature: "fixture" } };
|
|
54
|
+
const results = await Promise.all([store.commitLogin(challenge.id, "browser-a", now, session), store.commitLogin(challenge.id, "browser-a", now, { ...session, hash: "session-other" })]);
|
|
55
|
+
assert(results.filter(Boolean).length === 1, "single atomic challenge consumption");
|
|
56
|
+
const winningHash = results[0] ? session.hash : "session-other";
|
|
57
|
+
assert(await store.getSession(winningHash, "browser-b", now, 2e3) === null, "session binding");
|
|
58
|
+
assert(await store.getSession(winningHash, "browser-a", now + 1999, 2e3) !== null, "session idle refresh");
|
|
59
|
+
assert(await store.getSession(winningHash, "browser-a", now + 3999, 2e3) === null, "idle expiry");
|
|
60
|
+
assert(await store.getSession(winningHash, "browser-a", now + 4e3, 5e3) === null, "absolute expiry");
|
|
61
|
+
await store.putChallenge(challenge);
|
|
62
|
+
await store.revokeBrowser("browser-a");
|
|
63
|
+
assert(await store.getChallenge(challenge.id, "browser-a") === null, "revoke outstanding challenges");
|
|
64
|
+
assert(await store.getSession(winningHash, "browser-a", now, 2e3) === null, "revoke sessions");
|
|
65
|
+
await store.putChallenge(challenge);
|
|
66
|
+
assert(await store.commitLogin(challenge.id, "browser-a", now + 1e3, session) === false, "challenge expiry at commit");
|
|
67
|
+
assert(await store.consumeRateLimit("fixture-limit", now, 1e3, 1), "first rate-limit request");
|
|
68
|
+
assert(!await store.consumeRateLimit("fixture-limit", now, 1e3, 1), "rate-limit enforcement");
|
|
69
|
+
assert(await store.consumeRateLimit("fixture-limit", now + 1e3, 1e3, 1), "rate-limit reset");
|
|
70
|
+
await store.prune(now + 1e4);
|
|
71
|
+
assert(await store.getBrowser("browser-a", now) === null, "expired browser pruning");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/sqlite.ts
|
|
75
|
+
import { DatabaseSync } from "node:sqlite";
|
|
76
|
+
import { mkdirSync, chmodSync } from "node:fs";
|
|
77
|
+
import { dirname } from "node:path";
|
|
78
|
+
function createSqliteStorage(filename) {
|
|
79
|
+
if (filename !== ":memory:") mkdirSync(dirname(filename), { recursive: true, mode: 448 });
|
|
80
|
+
const db = new DatabaseSync(filename);
|
|
81
|
+
if (filename !== ":memory:") chmodSync(filename, 384);
|
|
82
|
+
db.exec("PRAGMA journal_mode=WAL; PRAGMA busy_timeout=5000; PRAGMA foreign_keys=ON;");
|
|
83
|
+
const version = db.prepare("PRAGMA user_version").get().user_version;
|
|
84
|
+
if (version > 1) {
|
|
85
|
+
db.close();
|
|
86
|
+
throw new Error("Unsupported Ghostlink storage schema.");
|
|
87
|
+
}
|
|
88
|
+
db.exec(`
|
|
89
|
+
CREATE TABLE IF NOT EXISTS browsers (hash TEXT PRIMARY KEY, csrf TEXT NOT NULL, expires INTEGER NOT NULL);
|
|
90
|
+
CREATE TABLE IF NOT EXISTS challenges (id TEXT PRIMARY KEY, browser TEXT NOT NULL REFERENCES browsers(hash) ON DELETE CASCADE, expires INTEGER NOT NULL, data TEXT NOT NULL);
|
|
91
|
+
CREATE INDEX IF NOT EXISTS challenges_browser ON challenges(browser);
|
|
92
|
+
CREATE TABLE IF NOT EXISTS sessions (hash TEXT PRIMARY KEY, browser TEXT NOT NULL REFERENCES browsers(hash) ON DELETE CASCADE, expires INTEGER NOT NULL, last_seen INTEGER NOT NULL, data TEXT NOT NULL, receipt TEXT NOT NULL);
|
|
93
|
+
CREATE INDEX IF NOT EXISTS sessions_browser ON sessions(browser);
|
|
94
|
+
CREATE TABLE IF NOT EXISTS limits (key TEXT PRIMARY KEY, expires INTEGER NOT NULL, count INTEGER NOT NULL);
|
|
95
|
+
PRAGMA user_version=1;
|
|
96
|
+
`);
|
|
97
|
+
function transaction(work) {
|
|
98
|
+
db.exec("BEGIN IMMEDIATE");
|
|
99
|
+
try {
|
|
100
|
+
const result = work();
|
|
101
|
+
db.exec("COMMIT");
|
|
102
|
+
return result;
|
|
103
|
+
} catch (e) {
|
|
104
|
+
db.exec("ROLLBACK");
|
|
105
|
+
throw e;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
async getBrowser(hash2, now) {
|
|
110
|
+
const r = db.prepare("SELECT hash, csrf, expires AS expiresAt FROM browsers WHERE hash=? AND expires>?").get(hash2, now);
|
|
111
|
+
return r ? r : null;
|
|
112
|
+
},
|
|
113
|
+
async putBrowser(b) {
|
|
114
|
+
db.prepare("INSERT INTO browsers VALUES (?, ?, ?)").run(b.hash, b.csrf, b.expiresAt);
|
|
115
|
+
},
|
|
116
|
+
async putChallenge(c) {
|
|
117
|
+
transaction(() => {
|
|
118
|
+
db.prepare("DELETE FROM challenges WHERE browser=?").run(c.browserHash);
|
|
119
|
+
db.prepare("INSERT INTO challenges VALUES (?, ?, ?, ?)").run(c.id, c.browserHash, Date.parse(c.expiresAt), JSON.stringify(c));
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
async getChallenge(id, browserHash) {
|
|
123
|
+
const r = db.prepare("SELECT data FROM challenges WHERE id=? AND browser=?").get(id, browserHash);
|
|
124
|
+
return r ? JSON.parse(r.data) : null;
|
|
125
|
+
},
|
|
126
|
+
async commitLogin(id, browserHash, now, record) {
|
|
127
|
+
return transaction(() => {
|
|
128
|
+
const browser = db.prepare("SELECT hash FROM browsers WHERE hash=? AND expires>?").get(browserHash, now);
|
|
129
|
+
if (!browser) return false;
|
|
130
|
+
const consumed = db.prepare("DELETE FROM challenges WHERE id=? AND browser=? AND expires>? RETURNING id").get(id, browserHash, now);
|
|
131
|
+
if (!consumed) return false;
|
|
132
|
+
db.prepare("DELETE FROM sessions WHERE browser=?").run(browserHash);
|
|
133
|
+
db.prepare("INSERT INTO sessions VALUES (?, ?, ?, ?, ?, ?)").run(record.hash, browserHash, Date.parse(record.session.expiresAt), record.lastSeen, JSON.stringify(record.session), JSON.stringify(record.receipt));
|
|
134
|
+
return true;
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
async getSession(hash2, browserHash, now, idleMs) {
|
|
138
|
+
return transaction(() => {
|
|
139
|
+
const r = db.prepare("SELECT data, expires FROM sessions WHERE hash=? AND browser=? AND expires>? AND last_seen>?").get(hash2, browserHash, now, now - idleMs);
|
|
140
|
+
if (!r) return null;
|
|
141
|
+
db.prepare("UPDATE sessions SET last_seen=? WHERE hash=?").run(now, hash2);
|
|
142
|
+
return { ...JSON.parse(r.data), idleExpiresAt: new Date(Math.min(r.expires, now + idleMs)).toISOString() };
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
async revokeBrowser(hash2) {
|
|
146
|
+
transaction(() => {
|
|
147
|
+
db.prepare("DELETE FROM challenges WHERE browser=?").run(hash2);
|
|
148
|
+
db.prepare("DELETE FROM sessions WHERE browser=?").run(hash2);
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
async consumeRateLimit(key, now, windowMs, maximum) {
|
|
152
|
+
return transaction(() => {
|
|
153
|
+
db.prepare("INSERT INTO limits VALUES (?, ?, 1) ON CONFLICT(key) DO UPDATE SET count=CASE WHEN expires<=? THEN 1 ELSE count+1 END, expires=CASE WHEN expires<=? THEN excluded.expires ELSE expires END").run(key, now + windowMs, now, now);
|
|
154
|
+
return Number(db.prepare("SELECT count FROM limits WHERE key=?").get(key).count) <= maximum;
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
async prune(now) {
|
|
158
|
+
transaction(() => {
|
|
159
|
+
db.prepare("DELETE FROM browsers WHERE expires<=?").run(now);
|
|
160
|
+
db.prepare("DELETE FROM challenges WHERE expires<=?").run(now);
|
|
161
|
+
db.prepare("DELETE FROM sessions WHERE expires<=?").run(now);
|
|
162
|
+
db.prepare("DELETE FROM limits WHERE expires<=?").run(now);
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
close() {
|
|
166
|
+
db.close();
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/server.ts
|
|
172
|
+
import { randomBytes, createHash, timingSafeEqual } from "node:crypto";
|
|
173
|
+
import { PROFILE, NETWORKS, serializeLoginMessage, isNetwork, chainId, GhostlinkError as GhostlinkError2 } from "@ghostdagger/ghostlink-core";
|
|
174
|
+
var token = () => randomBytes(32).toString("hex");
|
|
175
|
+
var hash = (value) => createHash("sha256").update(value).digest("hex");
|
|
176
|
+
var equal = (a, b) => a.length === b.length && timingSafeEqual(Buffer.from(a), Buffer.from(b));
|
|
177
|
+
var hexToken = (s) => typeof s === "string" && /^[a-f0-9]{64}$/.test(s);
|
|
178
|
+
function cookies(request) {
|
|
179
|
+
const result = /* @__PURE__ */ Object.create(null);
|
|
180
|
+
for (const part of (request.headers.get("cookie") ?? "").split(";")) {
|
|
181
|
+
const i = part.indexOf("=");
|
|
182
|
+
if (i < 0) continue;
|
|
183
|
+
const name = part.slice(0, i).trim();
|
|
184
|
+
result[name] = name in result ? "" : part.slice(i + 1).trim();
|
|
185
|
+
}
|
|
186
|
+
return result;
|
|
187
|
+
}
|
|
188
|
+
async function boundedJson(request) {
|
|
189
|
+
if (!/^application\/json(?:\s*;|$)/i.test(request.headers.get("content-type") ?? "")) throw new GhostlinkError2("INVALID_REQUEST", "Expected application/json.");
|
|
190
|
+
if (Number(request.headers.get("content-length") ?? 0) > 16384) throw new GhostlinkError2("INVALID_REQUEST", "Request is too large.");
|
|
191
|
+
const reader = request.body?.getReader();
|
|
192
|
+
if (!reader) throw new GhostlinkError2("INVALID_REQUEST", "Missing request body.");
|
|
193
|
+
let bytes = 0;
|
|
194
|
+
const parts = [];
|
|
195
|
+
while (true) {
|
|
196
|
+
const next = await reader.read();
|
|
197
|
+
if (next.done) break;
|
|
198
|
+
bytes += next.value.length;
|
|
199
|
+
if (bytes > 16384) {
|
|
200
|
+
await reader.cancel();
|
|
201
|
+
throw new GhostlinkError2("INVALID_REQUEST", "Request is too large.");
|
|
202
|
+
}
|
|
203
|
+
parts.push(next.value);
|
|
204
|
+
}
|
|
205
|
+
try {
|
|
206
|
+
const value = JSON.parse(Buffer.concat(parts).toString("utf8"));
|
|
207
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error();
|
|
208
|
+
return value;
|
|
209
|
+
} catch {
|
|
210
|
+
throw new GhostlinkError2("INVALID_REQUEST", "Invalid JSON request.");
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function createGhostlinkServer(config) {
|
|
214
|
+
const origin = new URL(config.origin);
|
|
215
|
+
const uri = new URL(config.loginUri);
|
|
216
|
+
if (origin.origin !== config.origin || uri.origin !== origin.origin || uri.username || uri.password || uri.hash) throw new Error("Configure an exact trusted origin and a same-origin login URI.");
|
|
217
|
+
const insecure = origin.protocol === "http:" && !!config.allowInsecureLocalhost && ["localhost", "127.0.0.1", "[::1]"].includes(origin.hostname);
|
|
218
|
+
if (origin.protocol !== "https:" && !insecure) throw new Error("HTTPS is required except for explicitly configured loopback development.");
|
|
219
|
+
const prefix = config.prefix ?? "/auth/ghostlink";
|
|
220
|
+
if (!/^\/[a-zA-Z0-9/_-]+$/.test(prefix) || prefix.endsWith("/")) throw new Error("Invalid authentication path prefix.");
|
|
221
|
+
const store = config.storage;
|
|
222
|
+
const now = config.now ?? Date.now;
|
|
223
|
+
const challengeTtl = config.challengeTtlMs ?? 3e5;
|
|
224
|
+
const sessionTtl = config.sessionTtlMs ?? 864e5;
|
|
225
|
+
const idleTtl = config.idleTtlMs ?? 18e5;
|
|
226
|
+
const skew = config.clockSkewMs ?? 3e4;
|
|
227
|
+
for (const v of [challengeTtl, sessionTtl, idleTtl]) if (!Number.isSafeInteger(v) || v <= 0) throw new Error("Session and challenge durations must be positive integers.");
|
|
228
|
+
if (challengeTtl > 3e5 || !Number.isSafeInteger(skew) || skew < 0 || skew > 3e4) throw new Error("Challenge duration or clock skew exceeds the profile limit.");
|
|
229
|
+
const networks = config.networks ?? NETWORKS;
|
|
230
|
+
if (!networks.length || networks.some((n) => !isNetwork(n))) throw new Error("Configure supported Kaspa networks.");
|
|
231
|
+
const browserName = insecure ? "ghostlink-browser" : "__Host-ghostlink-browser";
|
|
232
|
+
const sessionName = insecure ? "ghostlink-session" : "__Host-ghostlink-session";
|
|
233
|
+
const browserTtl = Math.max(6048e5, sessionTtl);
|
|
234
|
+
function cookie(name, value, maxAge) {
|
|
235
|
+
return `${name}=${value}; Path=/; HttpOnly; SameSite=Lax; Max-Age=${Math.floor(maxAge / 1e3)}${insecure ? "" : "; Secure"}`;
|
|
236
|
+
}
|
|
237
|
+
function response(data, status = 200, setCookies = []) {
|
|
238
|
+
const headers = new Headers({ "Content-Type": "application/json; charset=utf-8", "Cache-Control": "no-store", "X-Content-Type-Options": "nosniff", "Vary": "Cookie, Origin" });
|
|
239
|
+
for (const c of setCookies) headers.append("Set-Cookie", c);
|
|
240
|
+
return new Response(JSON.stringify(data), { status, headers });
|
|
241
|
+
}
|
|
242
|
+
function checkOrigin(request) {
|
|
243
|
+
if (new URL(request.url).origin !== origin.origin || request.headers.get("sec-fetch-site") === "cross-site") throw new GhostlinkError2("INVALID_REQUEST", "Untrusted request origin.");
|
|
244
|
+
const supplied = request.headers.get("origin");
|
|
245
|
+
if (supplied !== null && supplied !== origin.origin || request.method !== "GET" && supplied !== origin.origin) throw new GhostlinkError2("INVALID_REQUEST", "Untrusted request origin.");
|
|
246
|
+
}
|
|
247
|
+
async function browserFor(request) {
|
|
248
|
+
const value = cookies(request)[browserName];
|
|
249
|
+
return hexToken(value) ? store.getBrowser(hash(value), now()) : null;
|
|
250
|
+
}
|
|
251
|
+
async function getSession(request) {
|
|
252
|
+
const b = await browserFor(request);
|
|
253
|
+
const value = cookies(request)[sessionName];
|
|
254
|
+
if (!b || !hexToken(value)) return null;
|
|
255
|
+
return store.getSession(hash(value), b.hash, now(), idleTtl);
|
|
256
|
+
}
|
|
257
|
+
async function handle(request, context = {}) {
|
|
258
|
+
try {
|
|
259
|
+
checkOrigin(request);
|
|
260
|
+
const path = new URL(request.url).pathname;
|
|
261
|
+
if (!path.startsWith(`${prefix}/`)) return response({ error: "Not found." }, 404);
|
|
262
|
+
const endpoint = path.slice(prefix.length);
|
|
263
|
+
if (!["/session", "/challenge", "/verify", "/logout"].includes(endpoint)) return response({ error: "Not found." }, 404);
|
|
264
|
+
if (endpoint === "/session" && request.method !== "GET" || endpoint !== "/session" && request.method !== "POST") return response({ error: "Method not allowed." }, 405);
|
|
265
|
+
const time = now();
|
|
266
|
+
if (!await store.consumeRateLimit(`peer:${hash(context.ip ?? "shared")}`, time, 6e4, 180)) return response({ code: "SERVER_ERROR", error: "Too many requests. Wait a minute and try again." }, 429);
|
|
267
|
+
await store.prune(time);
|
|
268
|
+
let browser = await browserFor(request);
|
|
269
|
+
if (endpoint === "/session") {
|
|
270
|
+
const setCookies = [];
|
|
271
|
+
if (!browser) {
|
|
272
|
+
const value2 = token();
|
|
273
|
+
browser = { hash: hash(value2), csrf: token(), expiresAt: time + browserTtl };
|
|
274
|
+
await store.putBrowser(browser);
|
|
275
|
+
setCookies.push(cookie(browserName, value2, browserTtl));
|
|
276
|
+
}
|
|
277
|
+
const session2 = await getSession(request);
|
|
278
|
+
return response({ session: session2, csrfToken: browser.csrf }, 200, setCookies);
|
|
279
|
+
}
|
|
280
|
+
const csrf = request.headers.get("x-ghostlink-csrf") ?? "";
|
|
281
|
+
if (!browser || !hexToken(csrf) || !equal(csrf, browser.csrf)) return response({ code: "UNAUTHENTICATED", error: "Reload this application before signing in." }, 403);
|
|
282
|
+
if (!await store.consumeRateLimit(`browser:${browser.hash}`, time, 6e4, 30)) return response({ code: "SERVER_ERROR", error: "Too many requests. Wait a minute and try again." }, 429);
|
|
283
|
+
const body = await boundedJson(request);
|
|
284
|
+
if (endpoint === "/logout") {
|
|
285
|
+
await store.revokeBrowser(browser.hash);
|
|
286
|
+
return response({ ok: true }, 200, [cookie(sessionName, "", 0)]);
|
|
287
|
+
}
|
|
288
|
+
if (endpoint === "/challenge") {
|
|
289
|
+
if (!isNetwork(body.network) || !networks.includes(body.network) || typeof body.address !== "string") throw new GhostlinkError2("INVALID_REQUEST", "Unsupported account or network.");
|
|
290
|
+
const a = validateKaspaAddress(body.address, body.network);
|
|
291
|
+
const expiresAt = new Date(time + challengeTtl).toISOString();
|
|
292
|
+
const message = serializeLoginMessage({ domain: origin.host, address: a.address, network: body.network, uri: uri.href, nonce: token(), issuedAt: new Date(time).toISOString(), expiresAt });
|
|
293
|
+
const record = { id: token(), profile: PROFILE, message, address: a.address, network: body.network, expiresAt, issuedAt: time, browserHash: browser.hash };
|
|
294
|
+
await store.putChallenge(record);
|
|
295
|
+
const { browserHash: _browser, issuedAt: _issued, ...challenge2 } = record;
|
|
296
|
+
return response(challenge2);
|
|
297
|
+
}
|
|
298
|
+
if (!hexToken(body.challengeId) || typeof body.message !== "string" || body.message.length > 2e3 || typeof body.signature !== "string" || !/^[a-f0-9]{128}$/.test(body.signature) || body.publicKey !== void 0 && (typeof body.publicKey !== "string" || !/^(?:[a-fA-F0-9]{64}|0[23][a-fA-F0-9]{64})$/.test(body.publicKey))) throw new GhostlinkError2("INVALID_REQUEST", "Invalid verification request.");
|
|
299
|
+
const challenge = await store.getChallenge(body.challengeId, browser.hash);
|
|
300
|
+
if (!challenge || Date.parse(challenge.expiresAt) <= time || challenge.issuedAt > time + skew) throw new GhostlinkError2("EXPIRED", "The challenge expired or was already used. Generate a new message.");
|
|
301
|
+
if (body.message !== challenge.message || !networks.includes(challenge.network)) throw new GhostlinkError2("INVALID_SIGNATURE", "The signed message does not match this login request.");
|
|
302
|
+
if (!verifyKaspaSignature({ address: challenge.address, network: challenge.network, message: challenge.message, signature: body.signature, publicKey: body.publicKey })) throw new GhostlinkError2("INVALID_SIGNATURE", "The signature does not match the signing address and message.");
|
|
303
|
+
const verifiedTime = now();
|
|
304
|
+
const value = token();
|
|
305
|
+
const session = { accountId: validateKaspaAddress(challenge.address, challenge.network).accountId, address: challenge.address, network: challenge.network, chainId: chainId(challenge.network), issuedAt: new Date(verifiedTime).toISOString(), expiresAt: new Date(verifiedTime + sessionTtl).toISOString(), idleExpiresAt: new Date(verifiedTime + Math.min(idleTtl, sessionTtl)).toISOString() };
|
|
306
|
+
const committed = await store.commitLogin(challenge.id, browser.hash, verifiedTime, { hash: hash(value), browserHash: browser.hash, lastSeen: verifiedTime, session, receipt: { profile: PROFILE, message: challenge.message, signature: body.signature, publicKey: body.publicKey } });
|
|
307
|
+
if (!committed) throw new GhostlinkError2("EXPIRED", "The challenge expired or was already used. Generate a new message.");
|
|
308
|
+
return response(session, 200, [cookie(sessionName, value, sessionTtl)]);
|
|
309
|
+
} catch (error) {
|
|
310
|
+
if (error instanceof GhostlinkError2) return response({ code: error.code, error: error.message }, error.code === "INVALID_REQUEST" ? 400 : 401);
|
|
311
|
+
return response({ code: "SERVER_ERROR", error: "The authentication service could not complete this request." }, 500);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return {
|
|
315
|
+
/** Handle session/challenge/verify/logout Web requests under prefix. Pass trusted peer metadata for rate limits; returns HTTP failures as Responses. */
|
|
316
|
+
handle,
|
|
317
|
+
/** Read identity from request cookies, returning null if missing/expired. Refreshes idle expiry. Does not enforce application authorization, origin checks, or CSRF for your own routes. */
|
|
318
|
+
getSession,
|
|
319
|
+
/** Validated public origin used for audience and Host checks. */
|
|
320
|
+
origin: origin.origin,
|
|
321
|
+
/** Authentication route prefix; mount these routes on the same origin as the browser app. */
|
|
322
|
+
prefix
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// src/node.ts
|
|
327
|
+
function createNodeHandler(server) {
|
|
328
|
+
return async (req, res) => {
|
|
329
|
+
res.setHeader("Cache-Control", "no-store");
|
|
330
|
+
res.setHeader("X-Content-Type-Options", "nosniff");
|
|
331
|
+
try {
|
|
332
|
+
if (req.headers.host !== new URL(server.origin).host) {
|
|
333
|
+
res.writeHead(400);
|
|
334
|
+
res.end("Untrusted host");
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
const chunks = [];
|
|
338
|
+
let size = 0;
|
|
339
|
+
for await (const chunk of req) {
|
|
340
|
+
size += chunk.length;
|
|
341
|
+
if (size > 16384) {
|
|
342
|
+
res.writeHead(413);
|
|
343
|
+
res.end("Request too large");
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
chunks.push(chunk);
|
|
347
|
+
}
|
|
348
|
+
const headers = new Headers();
|
|
349
|
+
for (const [name, value] of Object.entries(req.headers)) if (value !== void 0) headers.set(name, Array.isArray(value) ? value.join(", ") : value);
|
|
350
|
+
const request = new Request(new URL(req.url ?? "/", server.origin), { method: req.method, headers, ...!["GET", "HEAD"].includes(req.method ?? "GET") ? { body: Buffer.concat(chunks) } : {} });
|
|
351
|
+
const response = await server.handle(request, { ip: req.socket.remoteAddress });
|
|
352
|
+
res.statusCode = response.status;
|
|
353
|
+
response.headers.forEach((value, key) => {
|
|
354
|
+
if (key !== "set-cookie") res.setHeader(key, value);
|
|
355
|
+
});
|
|
356
|
+
const setCookies = response.headers.getSetCookie();
|
|
357
|
+
if (setCookies.length) res.setHeader("Set-Cookie", setCookies);
|
|
358
|
+
res.end(Buffer.from(await response.arrayBuffer()));
|
|
359
|
+
} catch {
|
|
360
|
+
if (!res.headersSent) res.writeHead(500);
|
|
361
|
+
res.end("Authentication service unavailable");
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
export {
|
|
366
|
+
assertStorageConformance,
|
|
367
|
+
createGhostlinkServer,
|
|
368
|
+
createNodeHandler,
|
|
369
|
+
createSqliteStorage,
|
|
370
|
+
validateKaspaAddress,
|
|
371
|
+
verifyKaspaSignature
|
|
372
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghostdagger/ghostlink-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Server verification and revocable sessions for Ghostlink",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"vendor",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=24 <25"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@ghostdagger/ghostlink-core": "0.1.0-beta.1"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/ghostdagger-labs/ghostlink.git",
|
|
31
|
+
"directory": "packages/ghostlink-server"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://github.com/ghostdagger-labs/ghostlink#readme",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/ghostdagger-labs/ghostlink/issues"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"registry": "https://registry.npmjs.org/",
|
|
39
|
+
"access": "public",
|
|
40
|
+
"tag": "candidate"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsup src/index.ts --format esm --dts --clean",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
45
|
+
}
|
|
6
46
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2024 Kaspa developers
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|