Skip to content

Feature Request: Add listAllMappings action to expose both aliases and dynamic whitelist routes #368

Description

@JS-AK

Current Limitation
The current listAliases action only returns endpoints that are explicitly stored in the internal this.aliases array. This works fine for:

  1. Explicitly defined aliases.
  2. 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:

  1. Include all results that listAliases currently returns.
  2. Additionally iterate through all routes with mappingPolicy: 'all'.
  3. For these routes, scan the Service Broker's action registry, apply the route's whitelist/blacklist logic, and calculate the resulting endpoint paths on the fly.
  4. 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.

#367

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions