d27763e556
The shipped join flow (v2.2.0-v2.3.0) was a one-time snapshot: a spoke's catalog never updated after joining. This adds the two pieces that were explicitly designed but missing: - Live replication: a spoke registers its own endpoint with the master right after joining (POST /api/site/spokes, Bearer join-key), receiving a pushToken. Every successful catalog write on the master now fires a fire-and-forget resync ping (utils/site_replicate.js) at every known spoke, concurrently -- one unreachable spoke never blocks or delays another (wired into the existing write-gate middleware in api_directory_admin.js). The spoke's POST /api/site/resync handler reuses the already-tested export+import path rather than applying a partial diff. - Identical directories: POST /api/site/export now best-effort includes the master's agent-signing key; a spoke adopts it via agent_keys.adopt() on both join and every resync, so every site's sso-manager can validly sign a command for any agent enrolled anywhere -- the accepted tradeoff discussed for this deployment's scale (blast radius for simplicity). New SiteSpoke model tracks registered spokes (endpoint + pushToken); registered it in models/index.js (a real bug the e2e test below caught -- SiteSpoke.list() 500'd with "Cannot read properties of null (reading 'adapter')" until the model was added to initORM's model list). Verified end-to-end against docker-compose.multisite-e2e.yml: mint join key -> join with selfUrl -> write a NEW resource on master post-join -> poll the spoke -> it shows up within a few seconds via the resync push, no manual re-join needed. MULTISITE E2E PASS. Unit tests: nodejs/tests/site_replicate.test.js (concurrent fan-out, one failing spoke doesn't block another, empty-registry and list()-throws edge cases).
71 lines
1.9 KiB
JSON
Executable File
71 lines
1.9 KiB
JSON
Executable File
{
|
|
"name": "t42-theta-directory",
|
|
"version": "2.3.0",
|
|
"description": "A very simple LDAP management and SSO system",
|
|
"author": [
|
|
{
|
|
"name": "William Mantly",
|
|
"email": "wmantly@gmail.com"
|
|
}
|
|
],
|
|
"scripts": {
|
|
"start": "node ./bin/www",
|
|
"dev": "npx nodemon --ignore public/ ./bin/www",
|
|
"test": "NODE_ENV=test jest tests/groups.test.js tests/subtypes.test.js tests/site_join.test.js tests/site_config.test.js tests/site_replicate.test.js --forceExit"
|
|
},
|
|
"jest": {
|
|
"testEnvironment": "node",
|
|
"testMatch": [
|
|
"**/tests/**/*.test.js"
|
|
],
|
|
"globalSetup": "./tests/globalSetup.js"
|
|
},
|
|
"dependencies": {
|
|
"@fortawesome/fontawesome-free": "^7.3.0",
|
|
"@popperjs/core": "^2.11.8",
|
|
"@simpleworkjs/app-stack": "^1.0.0",
|
|
"@simpleworkjs/bao-conf": "^1.0.1",
|
|
"@simpleworkjs/conf": "^1.2.0",
|
|
"@simpleworkjs/directory-schema": "^1.1.0",
|
|
"@simpleworkjs/frontend": "^0.2.7",
|
|
"@simpleworkjs/ldap": "^1.0.0",
|
|
"@simpleworkjs/orm": "^0.2.8",
|
|
"bcrypt": "^6.0.0",
|
|
"bootstrap": "^5.3.8",
|
|
"bullmq": "^6.0.3",
|
|
"compression": "^1.8.1",
|
|
"ejs": "^3.1.10",
|
|
"express": "^5.2.1",
|
|
"express-rate-limit": "^8.5.2",
|
|
"extend": "^3.0.2",
|
|
"http-proxy-middleware": "^2.0.10",
|
|
"ioredis": "^6.0.0",
|
|
"jq-repeat": "^2.2.0",
|
|
"jquery": "^4.0.0",
|
|
"jsonwebtoken": "^9.0.3",
|
|
"ldapts": "^8.1.8",
|
|
"lru-cache": "^11.5.1",
|
|
"marked": "^9.1.6",
|
|
"model-redis": "^1.6.0",
|
|
"moment": "^2.30.1",
|
|
"mustache": "^4.2.0",
|
|
"node-fetch": "^2.7.0",
|
|
"node-nmap": "^4.0.0",
|
|
"nodemailer": "^9.0.0",
|
|
"p2psub": "^0.2.0",
|
|
"socket.io": "^4.8.3",
|
|
"ws": "^8.21.1",
|
|
"xss": "^1.0.15"
|
|
},
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/theta42/sso-manager-node.git"
|
|
},
|
|
"devDependencies": {
|
|
"jest": "^30.4.2",
|
|
"nodemon": "^3.1.11",
|
|
"supertest": "^7.2.2"
|
|
}
|
|
}
|