Feature Request: Add listAllMappings action to expose both aliases and dynamic whitelist routes
Current Limitation
The current listAliases action only returns endpoints that are explicitly stored in the internal this.aliases array. This works fine for:
- Explicitly defined aliases.
- Auto-generated aliases (when
autoAliases: true).
However, it completely ignores routes configured with autoAliases: false and a whitelist (where mappingPolicy defaults to 'all'). In these cases, the Gateway resolves requests dynamically at runtime, but listAliases returns nothing for them because no static alias objects exist in memory.
The Problem
Because listAliases is missing these dynamically mapped endpoints, tools that rely on introspection to generate documentation (e.g., OpenAPI generators) produce incomplete results. They cannot "see" actions that are effectively public but allowed only via a whitelist.
Proposed Solution
Implement a new internal action called listAllMappings.
This action should:
- Include all results that
listAliasescurrently returns. - Additionally iterate through all routes with
mappingPolicy: 'all'. - For these routes, scan the Service Broker's action registry, apply the route's
whitelist/blacklistlogic, and calculate the resulting endpoint paths on the fly. - Return a comprehensive list of every callable endpoint on the Gateway.
Example Configuration that is currently "invisible":
{
path: "/api",
autoAliases: false,
whitelist: [
"users.list",
"posts.*"
]
}
Current listAliases: Returns [].
Proposed listAllMappings: Should return entries for users.list, posts.find, posts.get, etc.
https://github.com/moleculerjs/moleculer-web/pull/367