{"_id":"@aaqu/node-red-dashboard-2-portal-auth","_rev":"7-df7ebfee1a12ec1aa813c27fa9811fd4","name":"@aaqu/node-red-dashboard-2-portal-auth","dist-tags":{"latest":"1.0.3"},"versions":{"0.1.0":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"0.1.0","keywords":["portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@0.1.0","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/portal-auth/issues"},"dist":{"shasum":"95c92173573f5b7ef214e15beb8805408cfc21d0","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-0.1.0.tgz","fileCount":5,"integrity":"sha512-hqJwYyDrBPpwO2ZvMm6vHp7zoCcksRQgGUk4Em0ND1zOjxK5Z53Q2nJnegX2os/yS3v/AIJQe7xxKxqvOTGV2A==","signatures":[{"sig":"MEQCIG1+DKXC2r6yjlM/FCF0+UviytPj85/HQI7e3xVCwK1XAiAeo3xO6/BObx3yBRWR/Azeb4KyAaRIfqu/XGXZXI5U3A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18152},"main":"index.js","gitHead":"0d5ea68d1ea009c2565959b2bc4601e26aab31aa","_npmUser":{"name":"aaqu","email":"aaquteam@gmail.com"},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/portal-auth.git","type":"git"},"_npmVersion":"11.3.0","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"22.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_0.1.0_1747823560274_0.0822508272930007","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"0.1.1","keywords":["portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@0.1.1","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/portal-auth/issues"},"dist":{"shasum":"d49eee31321eebb1be6ee147c53f451b8028dec7","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-0.1.1.tgz","fileCount":5,"integrity":"sha512-L892mO4cVeFErcot2xHSpaUjqg4qGJO94Kd7D4Tn9NEt/D9o13B+pA+BhvqBeGTYzXgdLg/C4/nebBHiBFwuFQ==","signatures":[{"sig":"MEYCIQCr3gXxud9Qi10jkVX3fsyssLU34jgWKG+dSp9qeRbsNgIhAPiI+vIsam9jlq1zvf6F2aT8HlCkW1MO9qS7YrXlONvA","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18119},"main":"index.js","gitHead":"fc6e5f99d97b51d7fbc9fff777d086246c5e7b6f","_npmUser":{"name":"aaqu","email":"aaquteam@gmail.com"},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/portal-auth.git","type":"git"},"_npmVersion":"11.3.0","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"22.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_0.1.1_1747824269470_0.6511307263921335","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"0.1.2","keywords":["portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@0.1.2","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/portal-auth/issues"},"dist":{"shasum":"84e33d7d7d896d08f2fb8c04225010534559e5c3","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-0.1.2.tgz","fileCount":5,"integrity":"sha512-hVho3Mf2YXazH7vU0zVYZBnc7iaCEhmHolvIEH3R+l81nTtQRb1SWtCZRtx6k6ptKFCB82Do883AldI6kNwO4g==","signatures":[{"sig":"MEUCIEVTVJUAznEQGHcPP20TY7U7Q3ezwUzh1udiw4p4pdrqAiEAkoRjXLY1dxvmj//7hnvVwe3R5/g6Rv4FnP6L5oBcQiU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20936},"main":"index.js","gitHead":"a83fab129abb6d845cf78251cfb69106437d4d4c","_npmUser":{"name":"aaqu","email":"aaquteam@gmail.com"},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/portal-auth.git","type":"git"},"_npmVersion":"11.3.0","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"22.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_0.1.2_1748983067749_0.9115474240791988","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"0.1.3","keywords":["portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert","email":"kontakt@mazuralbert.pl"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@0.1.3","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/aaqu-portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/aaqu-portal-auth/issues"},"dist":{"shasum":"b8a72e08376306670de00d7ae33637d14ccafeaf","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-0.1.3.tgz","fileCount":6,"integrity":"sha512-mh4xsbpTvP5iVwENJPMS7dg6hRNLMt9jTQCtUS9Pi1E9ZFD/4pNdjcLt8TTSsc/8WtVMWS/DMEhYN58YWaIhvw==","signatures":[{"sig":"MEQCIFZP+BOSob0lANH2Y1j2cFR3aYPmGcNimRXS374ogvYdAiB+3TgekVlumUWvBCBlzNofPmG7FA4b6+HPcoDDZ23x1Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aaqu%2fnode-red-dashboard-2-portal-auth@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":22779},"main":"index.js","gitHead":"82de21bb0c9c323e6f121d4b9b9f14c7eef1f2d8","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfc9fd0a-6f9a-41aa-b93b-241dd599858a"}},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/aaqu-portal-auth.git","type":"git"},"_npmVersion":"11.6.2","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"20.19.5","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_0.1.3_1762708200851_0.26143141885792787","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"1.0.0","keywords":["portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert","email":"kontakt@mazuralbert.pl"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@1.0.0","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/aaqu-portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/aaqu-portal-auth/issues"},"dist":{"shasum":"f1ffc2ef467978131dffb705b95602806b07ac2e","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-1.0.0.tgz","fileCount":6,"integrity":"sha512-bwHtQ3FamyoByNjb2040l42DMQDxEi/QLbdJc07dm+H0HT6vj3Qkfp6iWwt6QW4ckwVy87IAgPcdSlP8yYytrw==","signatures":[{"sig":"MEUCIQDuQrPND+5wfCSQyniDHR1FrLcM5210nuexxsA60N3H2QIgeG1wbN8vJ710nKPF7ed835fCWY7sZeos8fta0wMcRac=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aaqu%2fnode-red-dashboard-2-portal-auth@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":18179},"main":"index.js","gitHead":"579a0316f6513aa6d3d5f74a44b621f1135d7337","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfc9fd0a-6f9a-41aa-b93b-241dd599858a"}},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/aaqu-portal-auth.git","type":"git"},"_npmVersion":"11.11.1","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"20.20.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_1.0.0_1773270476532_0.9109765087143098","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"1.0.2","keywords":["fromcubes","portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"author":{"url":"https://mazuralbert.pl","name":"Mazur Albert","email":"kontakt@mazuralbert.pl"},"license":"Apache-2.0","_id":"@aaqu/node-red-dashboard-2-portal-auth@1.0.2","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"homepage":"https://github.com/Aaqu/aaqu-portal-auth#readme","bugs":{"url":"https://github.com/Aaqu/aaqu-portal-auth/issues"},"dist":{"shasum":"03db3a98097fceb75a37095e1b8dd5c6e02ba726","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-1.0.2.tgz","fileCount":6,"integrity":"sha512-0cIYM4JSnvM/dgpBoVPF4Edgf9aKuVnQlE+G6Qxfo4O5ICAMUhj4fb5vZBbpT+i0+7VNOSsjpOW6GmNPAQzx0A==","signatures":[{"sig":"MEUCIDFR+vgvgWC3DyiTPLy6bGmDPZgycHP8/06pqhZE9OnTAiEAzqxjKop1ucYyBDZNljIqWM/CRagjsXEi4qUWJ81NPFw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aaqu%2fnode-red-dashboard-2-portal-auth@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":18583},"main":"index.js","gitHead":"2588a6a7631a430096e6f5ba68001092231fdc2d","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfc9fd0a-6f9a-41aa-b93b-241dd599858a"}},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"repository":{"url":"git+https://github.com/Aaqu/aaqu-portal-auth.git","type":"git"},"_npmVersion":"11.11.1","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","directories":{},"_nodeVersion":"20.20.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/node-red-dashboard-2-portal-auth_1.0.2_1773271302121_0.691675151811368","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@aaqu/node-red-dashboard-2-portal-auth","version":"1.0.3","description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","keywords":["fromcubes","portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"main":"index.js","author":{"name":"Mazur Albert","email":"kontakt@mazuralbert.pl","url":"https://mazuralbert.pl"},"repository":{"type":"git","url":"git+https://github.com/Aaqu/aaqu-portal-auth.git"},"node-red":{"plugins":{"node-red-dashboard-2-portal-auth":"index.js"}},"license":"Apache-2.0","dependencies":{},"publishConfig":{"access":"public"},"gitHead":"efba8fc8725bbe4ae208a6659e1fb557fac183c4","_id":"@aaqu/node-red-dashboard-2-portal-auth@1.0.3","bugs":{"url":"https://github.com/Aaqu/aaqu-portal-auth/issues"},"homepage":"https://github.com/Aaqu/aaqu-portal-auth#readme","_nodeVersion":"20.20.0","_npmVersion":"11.11.1","dist":{"integrity":"sha512-hQ8rq33gaD2yGhW1F3ZtViDAE7M+RYnNtp25IQnqDyoNcLy4Zbz7EnBtJVu+XTvCurihC05XnCOyX1DkXz1Gtw==","shasum":"c7836423571cc7497e52d4ea9feeb06cf48f49f6","tarball":"https://registry.npmjs.org/@aaqu/node-red-dashboard-2-portal-auth/-/node-red-dashboard-2-portal-auth-1.0.3.tgz","fileCount":6,"unpackedSize":18569,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@aaqu%2fnode-red-dashboard-2-portal-auth@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD3TYCdsfYso0Mm4Slhc5dnrTuISPtrFEgG3soxEfsRewIhAL0DaLhT7cKeqg/CqVlTXUWpZv8AahbvNw23Fr72tbJL"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfc9fd0a-6f9a-41aa-b93b-241dd599858a"}},"directories":{},"maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-red-dashboard-2-portal-auth_1.0.3_1773272658903_0.6236107580439598"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-21T10:32:40.159Z","modified":"2026-03-11T23:44:19.328Z","0.1.0":"2025-05-21T10:32:40.461Z","0.1.1":"2025-05-21T10:44:29.625Z","0.1.2":"2025-06-03T20:37:47.944Z","0.1.3":"2025-11-09T17:10:01.068Z","1.0.0":"2026-03-11T23:07:56.749Z","1.0.2":"2026-03-11T23:21:42.270Z","1.0.3":"2026-03-11T23:44:19.056Z"},"bugs":{"url":"https://github.com/Aaqu/aaqu-portal-auth/issues"},"author":{"name":"Mazur Albert","email":"kontakt@mazuralbert.pl","url":"https://mazuralbert.pl"},"license":"Apache-2.0","homepage":"https://github.com/Aaqu/aaqu-portal-auth#readme","keywords":["fromcubes","portal","aaqu","auth","node-red","dashboard","node-red-dashboard"],"repository":{"type":"git","url":"git+https://github.com/Aaqu/aaqu-portal-auth.git"},"description":"portal-auth is an authentication module for dashboard 2, designed specifically for Portal, the instance manager for Node-RED","maintainers":[{"name":"aaqu","email":"aaquteam@gmail.com"}],"readme":"## Important Information\n\nYour support in the ongoing development of this library would be sincerely appreciated. 🙂\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%23FFDD00?style=for-the-badge&logo=buymeacoffee&logoColor=black)](https://buymeacoffee.com/mazuralbert)\n\n# portal-auth\n\nportal-auth is an authentication module for Dashboard 2.0,\ndesigned specifically for Portal, the instance manager for Node-RED.\n\n## How it works\n\nAuthentication is handled by the Nginx reverse proxy that sits in front of Node-RED. Nginx verifies the user session and injects `X-Portal-*` headers into every request (including WebSocket upgrade). This plugin reads those headers and populates `msg._client` with user identity and group permissions.\n\nNo middleware configuration or environment variables are needed in Node-RED.\n\n### Portal headers injected by Nginx\n\n| Header | Type | Description |\n|---|---|---|\n| `X-Portal-User-Id` | string | Unique user ID |\n| `X-Portal-User-Name` | string | Display name |\n| `X-Portal-User-Username` | string | Login username |\n| `X-Portal-User-Email` | string | Email |\n| `X-Portal-User-Role` | string | `\"admin\"` or `\"user\"` |\n| `X-Portal-User-Groups` | JSON string | Groups with link permissions |\n\n### X-Portal-User-Groups format\n\n```json\n[\n  {\n    \"id\": \"group-uuid-1\",\n    \"name\": \"Dashboards\",\n    \"links\": [\"link-uuid-1\", \"link-uuid-2\"]\n  }\n]\n```\n\n- **Admin** — receives all groups and all links\n- **User** — receives only groups/links they have permission for\n- **Empty `[]`** — user has no link permissions\n\n### msg._client structure\n\nAfter processing by the plugin, each message contains:\n\n```json\n{\n  \"socketId\": \"abc123\",\n  \"portalUserId\": \"cm5abc123...\",\n  \"portalUserName\": \"Jan Kowalski\",\n  \"portalUsername\": \"jkowalski\",\n  \"portalUserEmail\": \"jan@example.com\",\n  \"portalUserRole\": \"admin\",\n  \"portalGroups\": [\n    {\n      \"id\": \"group-uuid\",\n      \"name\": \"Dashboards\",\n      \"links\": [\"link-uuid-1\"]\n    }\n  ]\n}\n```\n\n## Install\n\n```bash\nnpm install @aaqu/node-red-dashboard-2-portal-auth\n```\n\n## Notes\n\n- Headers are set per-request by Nginx after session verification\n- If the session expires, Nginx returns 401 and redirects to `/auth/login`\n- `X-Portal-*` headers cannot be spoofed externally — Nginx overwrites them with values from verify-proxy\n\n## Changelog\n\n- **1.0.3** (2026-03-12) — short to Fromcubes Portal authentication.\n- **1.0.2** (2026-03-12) — Renamed package to `@aaqu/node-red-dashboard-2-portal-auth`.\n- **1.0.1** (2026-03-12) — Renamed package to `@aaqu/node-red-dashboard-2-fromcubes-portal-auth`.\n- **1.0.0** (2026-03-12) — Complete rewrite. Replaced cookie-based auth endpoint approach with Nginx `X-Portal-*` headers. Removed `onSetup` hook and middleware/env configuration.\n","readmeFilename":"README.md"}