Compare commits

...

2 Commits

Author SHA1 Message Date
wmantly 8c4ec67282 Merge pull request #35 from theta42/fix/jump-target-filter-v1.17.2
fix(jump-host): Filter SSH connection targets to managed hosts only v1.17.2
2026-08-03 13:57:38 -04:00
wmantly 36e7dbf8aa fix(jump-host): Filter SSH connection targets to managed hosts only v1.17.2
Pull Request Tests / Run Tests (20.x) (push) Failing after 1m4s
Pull Request Tests / Run Tests (22.x) (push) Failing after 1m3s
Pull Request Tests / Test Summary (push) Failing after 4s
2026-08-03 13:57:11 -04:00
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "t42-jump-host",
"version": "1.17.1",
"version": "1.17.2",
"description": "SSH jump host for the theta42 stack — LDAP-authenticated, directory-driven host bridging with audit and metrics",
"author": [
{
+12 -2
View File
@@ -46,9 +46,19 @@ if (conf.standalone && conf.standalone.enabled) {
// Every host in the inventory, unfiltered — for admins (the web UI's own
// account is already gated by requireAdmin before this is ever called).
function isManagedHost(r) {
if (!r || r.kind !== 'host') return false;
// If managed attribute is present, require it to be true/truthy
if (r.metadata && r.metadata.managed !== undefined) {
return r.metadata.managed === true || r.metadata.managed === 'true';
}
// Default to true for manually created hosts that lack explicit managed metadata
return true;
}
async function allHosts({ fetchImpl = fetch } = {}) {
const resources = await directoryClient({ fetchImpl }).getResourcesByGroup(undefined, { kind: 'host' });
return resources.filter(r => r.kind === 'host');
return resources.filter(isManagedHost);
}
async function accessibleHosts(user, { fetchImpl = fetch } = {}) {
@@ -62,7 +72,7 @@ if (conf.standalone && conf.standalone.enabled) {
console.error(`[access] ${error.message}`);
}
const hosts = resources.filter(r => r.kind === 'host');
const hosts = resources.filter(isManagedHost);
cache.set(user.uid, { at: Date.now(), hosts });
return hosts;
}