Repository navigation
Conversation
install-module now accepts packages in the instance's own team library
scope ('@flowfuse-<teamId>/'). The team id comes from the runtime
settings, never from the caller, and the package must be listed in the
team's npm catalogue, which the platform only injects together with the
npmrc entry routing that scope to the FlowFuse registry. Other teams'
scopes and third-party packages are still refused.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
automation/install-modulenow installs packages from the instance's own team library (subflows exported as modules, scope@flowfuse-<teamId>/) without a confirmation, as it already does for FlowFuse and certified nodes. Packages from other teams and third-party packages are still refused.RED.settings.flowforge.teamIDon the server and sends it to the editor onnr-assistant/initialiseasteamLibrary: { teamId }. It is only sent when it is a plain hashid. The caller never supplies the team.@flowfuse-<teamId>/is accepted only when<teamId>is the instance's own team. Any other@flowfuse-*scope getsMODULE_NOT_ALLOWED./api/v1/teams/<teamId>/npm/catalogueinpalette.catalogues. The platform only adds that catalogue together with the npmrc entry that routes the team scope to the FlowFuse registry. So a listing guarantees npm does not look the scope up on the public registry, where anyone could register aflowfuse-<id>org. The catalogue version is pinned, as for certified nodes.forgeURLcan be an internal address (for examplehttp://forge.<namespace>on Kubernetes), while the catalogue uses the platform's public URL. So the URL is matched on its path for the instance's own team.Screenshot
This shows that it got installed

Closes https://github.com/FlowFuse/engineering/issues/448
Testing
Unit tests cover the server-side team id and every install path. Tested end to end on a local platform with a team npm registry, using a subflow published to the team library:
@flowfuse-aBcD3fGh1J/test-subflowINSTALL_STARTED, installed from the team registry with the catalogue version (0.1.0), subflow type in the palette@flowfuse-otherTeam1/test-subflowMODULE_NOT_ALLOWED; the error lists the instance's own team scope as the only team scope allowed@flowfuse-aBcD3fGh1J/not-publishedMODULE_NOT_ENTITLED, no install requestnode-red-contrib-influxdbMODULE_NOT_ALLOWED)The registry log confirmed the package was fetched with the instance's own npm token.
Checklist