Class VSViewerAccess

java.lang.Object
com.iizix.server.vsviewer.VSViewerAccess

public final class VSViewerAccess extends Object
The rules of who may look at what with the VSViewer, in one place (CC-FIX-VSVIEWER-APPS-LINK, the owner's rule of 2026-11-11):
  • A production server has no VSViewer at all. Its page, its initialization data and its WebSocket are refused at their own end points, whatever link or URL is used, each with a WARNING line (isAllowedOn(ServerShell), logRefusedOnProduction(String,String)). The VSViewer exists on a development server only: the server class JettyRunConfiguration itself, started in the run mode RunMode.SERVER_DEVELOPMENT - both, so that neither signal alone opens it.
  • The sessions of a member of the group "Administrators" are never shown, for any application: not listed in the initialization data, not attached to, and a viewer attached to a session is closed when that session's user signs in as such a member (isHidden(AppSessionGyro), onUserSignedIn(AppSessionGyro)). THE ONLY enabler is the system property "iizi.allow.vsviewer.admin" set to true at the start of the server's JVM (-Diizi.allow.vsviewer.admin=true); nothing else - a launch from iiziGo or Eclipse, a launch configuration, the Designer run mode - lets them through.
  • The VirtualSpaces of the SignIn module are never mirrored - not the module's own, not the virtualized ones of a session - unless the server was started with that same property (isHiddenModule(ModuleProjectPropCnr), isHiddenReference(String,String[]); CC-FIX-VSVIEWER-FOLLOWUP): a viewer attached to a session BEFORE its sign-in mirrored what was typed into the sign-in screens, the password included.
  • A viewer reaches only the sessions of a server environment the host of its request reaches: in the initialization data, and at the WebSocket when it names the application, user and session itself (isEnvironmentReached(AppFactory,IWebSocketComm), CC-FIX-VSVIEWER-FOLLOWUP).
The filter is applied here, on the server, to what a viewer is sent; the page decides nothing.

Who is an administrator here: a user who is, in the database NOW, in a group named GroupInfo.ADMIN_GROUP_NAME (compared without regard to case) - whether that group or the user is disabled or not: the widest reading, since this rule hides and never grants. A session nobody has signed in to has no user and is not hidden. When the groups cannot be read, the session is hidden (logged).

The property is read ONCE, when this class is loaded, which the start of the server does (logAtServerStart(boolean)): setting it in a running server changes nothing.

Author:
Christopher Mindus
  • Field Details

    • ALLOW_ADMINISTRATORS_PROPERTY

      public static final String ALLOW_ADMINISTRATORS_PROPERTY
      The system property that lets the VSViewer of a development server show the sessions of the members of the group "Administrators": iizi.allow.vsviewer.admin, the value true. The only enabler; without effect on a production server.
      See Also:
  • Method Details

    • isAllowedOn

      public static boolean isAllowedOn(ServerShell server)
      Checks if a server has a VSViewer: a development server only - the class JettyRunConfiguration itself in the run mode RunMode.SERVER_DEVELOPMENT. Every other server (the standard server, the runtime builder server, a server of a subclass) is a production server here and refuses the VSViewer.
      Parameters:
      server - The server, null for none.
      Returns:
      true when the server has a VSViewer, false when it refuses it.
    • logRefusedOnProduction

      public static void logRefusedOnProduction(String what, String remote)
      Logs the refusal of a VSViewer request by a production server: one WARNING line that names what was asked for and by whom, and nothing of the request's query.
      Parameters:
      what - What was refused: the target of the request, without its query.
      remote - The address of the remote party, null when it is not known.
    • getRefusedOnProductionReason

      public static String getRefusedOnProductionReason(String what, String remote)
      Gets the text of the refusal of a VSViewer request by a production server, as logRefusedOnProduction(String,String) logs it: the reason a refused page carries to the web server, which logs it in its one WARNING line (RefusedTargetException, CC-FIX-VSVIEWER-FOLLOWUP).
      Parameters:
      what - What was refused: the target of the request, without its query.
      remote - The address of the remote party, null when it is not known.
      Returns:
      The text, with nothing of the request's query.
    • logAtServerStart

      public static void logAtServerStart(boolean hasVSViewer)
      Logs at the start of the server what its VSViewer does with the sessions of administrators, and loads this class, which reads the property "iizi.allow.vsviewer.admin".
      Parameters:
      hasVSViewer - true for a server that has a VSViewer (isAllowedOn(ServerShell)).
    • areAdministratorsAllowed

      public static boolean areAdministratorsAllowed()
      Checks if this server's VSViewer shows the sessions of administrators: the property "iizi.allow.vsviewer.admin" as it was at the start of the JVM.
      Returns:
      true when they are shown.
    • isHidden

      public static boolean isHidden(AppSessionGyro appGyro)
      Checks if an application session is hidden from the VSViewer: its signed-in user is a member of the group "Administrators" and the server was not started with "iizi.allow.vsviewer.admin". The user is read from the database again, so that a user put into the group while signed in counts at once.
      Parameters:
      appGyro - The application session.
      Returns:
      true when the session must not be listed, attached to or shown.
    • isHiddenModule

      public static boolean isHiddenModule(ModuleProjectPropCnr module)
      Checks if the VirtualSpaces of a module are hidden from the VSViewer: those of the SignIn module are - the module the server setting $signIn.module names, told by its application ID (AppFactory.isSignInModule(ModuleProjectPropCnr)) - unless the server was started with "iizi.allow.vsviewer.admin". A viewer attached to a session before its sign-in mirrored what was typed into the sign-in screens, the password included (CC-FIX-VSVIEWER-FOLLOWUP; AL-D-2 of CC-FIX-VSVIEWER-APPS-LINK, ruled 2026-11-12).
      Parameters:
      module - A module project of the application.
      Returns:
      true when a viewer mirrors nothing of the module: not its VirtualSpaces, not the virtualized ones of a session (isHiddenReference(String,String[])).
    • isEnvironmentReached

      public static boolean isEnvironmentReached(AppFactory app, IWebSocketComm comm)
      Checks if a request reaches an application: the server environment of the application allows the host the request came to (ServerConfigEnvProps.isDomainAccessAllowed(String,boolean)). It is the rule by which the applications and the sessions of the initialization data are listed (ServerShell.getAccessibleEnvironments), asked here for the VSViewer's WebSocket: a viewer that names the application, user and session of another environment is not attached (CC-FIX-VSVIEWER-FOLLOWUP; AL-D-7 of CC-FIX-VSVIEWER-APPS-LINK).
      Parameters:
      app - The application the viewer asks for.
      comm - The WebSocket communication of the request, null when the implementation has none.
      Returns:
      true when the host of the request reaches the environment of the application. False when it does not, and when it cannot be told: no communication instance, no host, no environment.
    • logRefusedEnvironment

      public static void logRefusedEnvironment(AppFactory app, IWebSocketComm comm)
      Logs the refusal of a viewer that asks for an application of a server environment the host of its request does not reach: one WARNING line that names the application, the host and the remote party, and nothing of the request's query.
      Parameters:
      app - The application the viewer asked for.
      comm - The WebSocket communication of the request, null when the implementation has none.
    • onUserSignedIn

      public static void onUserSignedIn(AppSessionGyro appGyro)
      Called by an application session when a user has been recorded as its signed-in user (AppSessionGyro.signInAuthenticatedUser): every viewer attached to that session is closed when the session is hidden now (isHidden(AppSessionGyro)), as it is when the application ends. Costs nothing while no viewer is attached to any session, which is always so on a production server. Never throws: a sign-in does not fail because of a viewer.
      Parameters:
      appGyro - The application session.