Interface Resolver

All Known Subinterfaces:
NoAuthResolver
All Known Implementing Classes:
CompositeResolver, ErrorsJSONResolver, ErrorsPageResolver, ExtensionJSONResolver, FiltersJSONResolver, FunctionalResolverWrapper, GraphsJSONResolver, JSONResolver, LocaleJSONResolver, LoginPageResolver, LoginResolver, LogoutResolver, ManagePageResolver, MetadataJSONResolver, NetworkMetadataJSONResolver, NetworkPerformanceJSONResolver, NetworkTabJSONResolver, PlayerJoinAddressJSONResolver, PlayerJSONResolver, PlayerKillsJSONResolver, PlayerPageResolver, PlayersJSONResolver, PlayersPageResolver, PlayersTableJSONResolver, PluginHistoryJSONResolver, PreferencesJSONResolver, PublicHtmlResolver, QueryJSONResolver, QueryPageResolver, RegisterPageResolver, RegisterResolver, RetentionJSONResolver, RootPageResolver, ServerIdentityJSONResolver, ServerPageResolver, ServerTabJSONResolver, SessionsJSONResolver, StaticResourceResolver, StorePreferencesJSONResolver, SwaggerJsonResolver, SwaggerPageResolver, VersionJSONResolver, WebGroupDeleteJSONResolver, WebGroupJSONResolver, WebGroupPermissionJSONResolver, WebGroupSaveJSONResolver, WebPermissionJSONResolver, WhoAmIJSONResolver

public interface Resolver
Interface for resolving requests of Plan webserver.
See Also:
  • Method Details

    • canAccess

      boolean canAccess(Request request)
      Implement access control if authorization is enabled.

      Is not called when access control is not active.

      Parameters:
      request - HTTP request, contains all information necessary to check access.
      Returns:
      true if allowed or invalid target, false if response should be 403 (forbidden)
      See Also:
    • usedWebPermissions

      default Set<String> usedWebPermissions()
      Override this to tell Plan what web permissions this endpoint uses.

      This allows:

      • Plan to store these permissions in the permission list
      • Users can grant/deny the permission for a group
      • Plan can show what endpoints specific permission gives access to

      Requires PAGE_EXTENSION_USER_PERMISSIONS capability

      Returns:
      Set of permissions eg. [plugin.custom.permission, plugin.custom.permission.child.node]
      See Also:
    • resolve

      Optional<Response> resolve(Request request)
      Implement request resolution.
      Parameters:
      request - HTTP request, contains all information necessary to resolve the request.
      Returns:
      Response or empty if the response should be 404 (not found).
      See Also:
    • newResponseBuilder

      default ResponseBuilder newResponseBuilder()
      Creates a new ResponseBuilder for a Response.
      Returns:
      a new builder.
    • requiresAuth

      default boolean requiresAuth(Request request)
      Used to check if the resolver requires authentication to be used.
      Parameters:
      request - Incoming request that you can use to figure out if authentication is required.
      Returns:
      true if you want 401 to be given when user has not logged in.