orama/sdk/package.json
anonpenguin23 bcfb2b7868 fix(gateway): give namespace gateways the API-key HMAC secret
Namespace gateways never received the API-key HMAC secret, so
auth.Service.HashAPIKey returned keys UNCHANGED (service.go:172). One gap,
two symptoms — both confirmed live on devnet:

1. A namespace gateway could not authenticate ANY key from the authoritative
   core registry: core stores 64-char HMAC-SHA256 hashes, the namespace
   gateway looked up the 39-char raw key. Valid key on main gateway :6001 =>
   200, same key on namespace gateway :10004 => 401. This is what broke
   serverless WASM http_fetch calls to /v1/auth/token (bugboard #160).
2. Keys the namespace gateway wrote were stored in PLAINTEXT, against
   docs/SECURITY.md:54-59. The anchat-test namespace RQLite holds 361
   39-char plaintext keys vs 64-char hashes in core.

The main gateway reads the secret from <oramaDir>/secrets/api-key-hmac-secret
(node/gateway.go:50). The namespace spawner never passed it and the gateway
YAML had no field for it, so it could not have been passed at all.

- cmd/gateway/config.go: new api_key_hmac_secret YAML field
- namespace/systemd_spawner.go: read the same secret file at spawn and emit
  it; a missing or blank secret now fails the spawn loudly rather than
  booting a gateway that cannot authenticate anything
- config file mode pinned to 0600 by test (it already was)

Also reverts the API-key lookup change from 0.122.97. That change pointed
namespace gateways at their own RQLite, which split the system into two
disagreeing key registries and caused the internal 401s above. apiKeyDB()
now resolves authClient (global) -> client, never sqlDB. GlobalRQLiteDSN's
"API key validation" comment was correct: keys live in the core registry.

Verified on devnet 0.122.99 across both gateways and all nodes: external
200, internal namespace gateway 200, bogus 401. Full suite green.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-27 15:49:12 +03:00

83 lines
1.8 KiB
JSON

{
"name": "@debros/orama",
"version": "0.122.99",
"description": "TypeScript SDK for Orama Network - Database, PubSub, Cache, Storage, Vault, and more",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
"author": "DeBrosOfficial",
"keywords": [
"debros",
"network",
"sdk",
"typescript",
"database",
"rqlite",
"pubsub",
"websocket",
"cache",
"olric",
"ipfs",
"storage",
"wasm",
"serverless",
"distributed",
"gateway",
"vault",
"secrets",
"shamir",
"encryption",
"guardian"
],
"repository": {
"type": "git",
"url": "https://github.com/DeBrosOfficial/network",
"directory": "sdk"
},
"bugs": {
"url": "https://github.com/DeBrosOfficial/network/issues"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"files": [
"dist",
"src"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"typecheck": "tsc --noEmit",
"lint": "eslint src tests",
"test": "vitest",
"test:e2e": "vitest run tests/e2e",
"release:npm": "npm publish --access public --registry=https://registry.npmjs.org/",
"release:gh": "npm publish --registry=https://npm.pkg.github.com"
},
"dependencies": {
"@noble/ciphers": "^0.5.3",
"@noble/hashes": "^1.4.0",
"isomorphic-ws": "^5.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitest/coverage-v8": "^1.0.0",
"dotenv": "^17.2.3",
"eslint": "^8.0.0",
"tsup": "^8.0.0",
"typedoc": "^0.25.0",
"typescript": "^5.3.0",
"vitest": "^1.0.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
}
}