3b729295b0
Migrates proxy's hostModal (the modal this session's app.modal tabs/footer/
url support was originally modeled on) off its old always-in-DOM static
element and onto the shared app.modal component (@simpleworkjs/frontend
0.2.6), continuing the entity-modal standardization started with
sso-manager-node's resource modal.
Unlike the resource modal, this one already had 6 tabs and Host's audit
trail (created_by/created_on/updated_by/updated_on) already existed and was
already populated correctly by routes/host.js -- no model or route changes
needed there. The tab markup itself is kept as one hand-built bodyHtml
string rather than going through app.modal's own `tabs` array option: that
option builds the tab-content div itself, and there'd be no way to wrap a
<form> around just that piece without extending app.modal again, whereas
this modal's tabs already are exactly the pattern app.modal's own tabs
option was modeled on.
Key correctness points, found and handled:
- The one JS binding that was unsafe under DOM rebuild -- a `keyup` handler
driving the Let's-Encrypt challenge-type/wildcard visibility, previously
bound once directly against a captured selector -- is now delegated via
app.modal.on(), the same bug class already found and fixed in the
resource modal.
- hostLoadAuthSuggestions() (fills the SSO allow-list autocomplete
datalists) now re-runs on every modal open, not just once at page load,
since the datalists are rebuilt fresh (empty) each time.
- .actionMessage moved from a sibling of the old modal's <form> into a
descendant of it: formAJAX's error/success target resolution
(app.messages.action's closest('div.card') then a find('.actionMessage')
fallback) only succeeds via the fallback path once app.modal owns the
DOM, since app.modal's .modal-content carries no 'card' class.
- The footer's audit dates needed the explicit 'x' (unix ms) format token
for moment() -- Host's created_on/updated_on come back as redis-hash
strings, and moment's bare fallback parser silently produces "Invalid
date" for a numeric string without it (this app's own hostParseRow
already does this correctly elsewhere; the new footer code needed the
same treatment).
Also adds GET /hosts/:host (mirroring sso-manager-node's /directory/:slug)
plus a client-side deep-link check, threaded through a new onLoaded
callback on hostPopulate().
Verified live against the running dev stack: all 6 tabs render and save
correctly; the footer shows real created/updated-by/on dates; the SSO
autocomplete has options on a second modal open (not just the first);
the challenge-type keyup logic fires correctly on a second-ever modal
open (confirmed via the actual GET /api/host/wildcard-parent/... network
request); the address bar updates to /hosts/{host} and reverts on close;
a direct load of /hosts/{host} auto-opens the right host's modal; and a
real save (PUT) closes the modal and live-updates the row via the existing
pubsub subscription, end to end.
61 lines
2.8 KiB
JSON
61 lines
2.8 KiB
JSON
{
|
|
"name": "proxy-api",
|
|
"version": "1.5.3",
|
|
"author": [
|
|
{
|
|
"name": "William Mantly",
|
|
"email": "wmantly@gmail.com"
|
|
}
|
|
],
|
|
"scripts": {
|
|
"start": "node ./bin/www",
|
|
"dev": "npx nodemon --ignore public/ ./bin/www",
|
|
"test": "node --test test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/host_sso.test.js test/unit/unix_socket.test.js test/unit/no_native_dialogs.test.js test/integration/dns_provider.test.js",
|
|
"test:unit": "node --test test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/host_sso.test.js test/unit/unix_socket.test.js test/unit/no_native_dialogs.test.js",
|
|
"test:integration": "node --test test/integration/dns_provider.test.js",
|
|
"test:watch": "node --test --watch test/unit/callback_queue.test.js test/unit/host_lookup.test.js test/unit/wildcard_matchany.test.js test/unit/roles.test.js test/unit/oidc.test.js test/unit/safe_redirect.test.js test/unit/host_features.test.js test/unit/dynamic_record.test.js test/unit/hostname_validate.test.js test/unit/password_policy.test.js test/unit/basicauth.test.js test/unit/host_sso.test.js test/unit/unix_socket.test.js test/unit/no_native_dialogs.test.js test/integration/dns_provider.test.js"
|
|
},
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@fortawesome/fontawesome-free": "^7.3.0",
|
|
"@popperjs/core": "^2.11.8",
|
|
"@simpleworkjs/app-stack": "^1.0.0",
|
|
"@simpleworkjs/conf": "^1.2.0",
|
|
"@simpleworkjs/frontend": "^0.2.6",
|
|
"@simpleworkjs/ldap": "^1.0.0",
|
|
"@simpleworkjs/oidc-client": "^1.0.0",
|
|
"acme-client": "^5.4.0",
|
|
"axios": "^1.13.5",
|
|
"bcrypt": "^6.0.0",
|
|
"bootstrap": "^5.3.8",
|
|
"compression": "^1.8.1",
|
|
"ejs": "^3.1.10",
|
|
"express": "^5.2.1",
|
|
"express-rate-limit": "^8.5.2",
|
|
"extend": "^3.0.2",
|
|
"jq-repeat": "^2.2.0",
|
|
"jquery": "^4.0.0",
|
|
"ldapts": "^8.1.8",
|
|
"linux-sys-user": "^1.2.0",
|
|
"marked": "^9.1.6",
|
|
"model-redis": "^1.6.0",
|
|
"moment": "^2.30.1",
|
|
"mustache": "^4.2.0",
|
|
"p2psub": "^0.2.0",
|
|
"redis": "^6.1.0",
|
|
"socket.io": "^4.8.3",
|
|
"tld-extract": "^2.1.0",
|
|
"xss": "^1.0.15"
|
|
},
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/theta42/proxy.git"
|
|
},
|
|
"devDependencies": {
|
|
"nodemon": "^3.1.11"
|
|
}
|
|
}
|