Class RouterDisplayHelper

java.lang.Object
google.registry.request.RouterDisplayHelper

public class RouterDisplayHelper extends Object
Utility class to help in dumping routing maps.

Each of the App Engine services (frontend, backend, and tools) has a Dagger component used for routing requests (e.g., FrontendRequestComponent). This class produces a text file representation of the routing configuration, showing what paths map to what action classes, as well as the properties of the action classes' annotations (which cover things like allowable HTTP methods, authentication settings, etc.). The text file can be useful for documentation, and is also used in unit tests to check against golden routing maps to find possibly unexpected changes.

The file has fixed-width columns with a header row. The width of the columns is determined by the content to be displayed. The columns are:

  1. the GKE service this action lives on
  2. the URL path which maps to this action (with a "(*)" after it if the prefix flag is set)
  3. the simple name of the action class
  4. the allowable HTTP methods
  5. whether to automatically print "ok" in the response
  6. the minimum authentication level
  7. the user policy

See the Auth class for more information about authentication settings.

  • Constructor Details

    • RouterDisplayHelper

      public RouterDisplayHelper()
  • Method Details

    • extractHumanReadableRoutesFromComponent

      public static String extractHumanReadableRoutesFromComponent(Class<?> componentClass)
      Returns a string representation of the routing map in the specified component.
    • extractHumanReadableRoutesWithWrongService

      public static com.google.common.collect.ImmutableList<String> extractHumanReadableRoutesWithWrongService(Class<?> componentClass, Action.Service expectedService)