node-red-contrib-knx-ultimate 4.2.13 → 4.2.14

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/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@
6
6
 
7
7
  # CHANGELOG
8
8
 
9
+ **Version 4.2.14** - April 2026<br/>
10
+
11
+ - FIX: **KNX Logger** XML download now works also with Node-RED authentication enabled by appending the active editor `access_token` and respecting `httpAdminRoot` when opening the download URL.<br/>
12
+ - FIX: **KNX Logger** admin download route now normalizes `access_token` from query into `Authorization: Bearer ...` before permission checks, then removes it from query parameters to avoid auth conflicts.<br/>
13
+ - FIX: resolved authenticated XML export failures (`401 Unauthorized`) reported in issue #502.<br/>
14
+
9
15
  **Version 4.2.13** - April 2026<br/>
10
16
 
11
17
  - FIX: **KNX AI Web** hardened authenticated requests by always attaching Bearer auth on API/audio calls (query token or Node-RED stored editor token fallback), preventing silent audio failures in authenticated sessions.<br/>
@@ -8,6 +8,7 @@ const dptlib = require('knxultimate').dptlib
8
8
  const customHTTP = require('./utils/http')
9
9
  const KNXClient = require('knxultimate').KNXClient
10
10
  const sysLogger = require('./utils/sysLogger')
11
+ const { normalizeAuthFromAccessTokenQuery } = require('./utils/httpAdminAccessToken')
11
12
 
12
13
  // DATAPONT MANIPULATION HELPERS
13
14
  // ####################
@@ -328,7 +329,7 @@ module.exports = (RED) => {
328
329
  })
329
330
 
330
331
  // 2025-12 Download logger XML file configured in a knxUltimateLogger node
331
- RED.httpAdmin.get('/knxUltimateLoggerDownload', RED.auth.needsPermission('knxUltimate-config.read'), (req, res) => {
332
+ RED.httpAdmin.get('/knxUltimateLoggerDownload', normalizeAuthFromAccessTokenQuery, RED.auth.needsPermission('knxUltimate-config.read'), (req, res) => {
332
333
  try {
333
334
  const nodeId = (req.query.nodeId || req.query.id || '').toString()
334
335
  if (!nodeId) {
@@ -39,6 +39,21 @@
39
39
  });
40
40
 
41
41
  const nodeId = this.id;
42
+ const resolveAdminRoot = () => {
43
+ const raw = (RED.settings && typeof RED.settings.httpAdminRoot === "string") ? RED.settings.httpAdminRoot : "/";
44
+ const trimmed = String(raw || "/").trim();
45
+ if (trimmed === "" || trimmed === "/") return "";
46
+ return "/" + trimmed.replace(/^\/+|\/+$/g, "");
47
+ };
48
+ const resolveAccessToken = () => {
49
+ try {
50
+ const tokens = (RED.settings && typeof RED.settings.get === "function") ? RED.settings.get("auth-tokens") : null;
51
+ const token = tokens && typeof tokens.access_token === "string" ? tokens.access_token.trim() : "";
52
+ return token;
53
+ } catch (error) {
54
+ return "";
55
+ }
56
+ };
42
57
 
43
58
  const toggleFilePath = () => {
44
59
  const isEmitSave = $("#node-input-saveMode").val() === "emit_save";
@@ -67,8 +82,16 @@
67
82
  }
68
83
  return;
69
84
  }
70
- const url = "knxUltimateLoggerDownload?nodeId=" + encodeURIComponent(nodeId) + "&_=" + new Date().getTime();
71
- window.open(url, "_blank");
85
+ const adminRoot = resolveAdminRoot();
86
+ const targetBase = adminRoot + "/knxUltimateLoggerDownload";
87
+ const params = new URLSearchParams();
88
+ if (nodeId) params.set("nodeId", nodeId);
89
+ params.set("_", String(Date.now()));
90
+ const accessToken = resolveAccessToken();
91
+ if (accessToken) params.set("access_token", accessToken);
92
+ const target = targetBase + "?" + params.toString();
93
+ const wnd = window.open(target, "_blank", "noopener,noreferrer");
94
+ try { if (wnd && typeof wnd.focus === "function") wnd.focus(); } catch (e) { }
72
95
  });
73
96
  },
74
97
  oneditsave: function () {
@@ -151,4 +174,4 @@
151
174
  </p>
152
175
  </div>
153
176
  </div>
154
- </script>
177
+ </script>
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "engines": {
4
4
  "node": ">=20.18.1"
5
5
  },
6
- "version": "4.2.13",
6
+ "version": "4.2.14",
7
7
  "description": "Control your KNX and KNX Secure intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control, ETS group address importer, and KNX routing between interfaces. Easy to use and highly configurable.",
8
8
  "files": [
9
9
  "nodes/",