x2gobroker.optional_scripts.base_script module

class x2gobroker.optional_scripts.base_script.X2GoBrokerOptionalScript[source]

Bases: object

X2Go Session Broker supports running optional Python code that a site admin can add to the broker installation files.

All those optional scripts need to be inherited from this class.

run_me(username, password, task, profile_id, ip, cookie, authed, server)[source]

Dummy :function:run_me() function. If you deploy your own optional scripts with X2Go Session Broker, make sure that your class overrides this function. The broker frontends will try to execute code presented under this method name at pre-auth, post-auth and session-selected.

Parameters:
  • script_type (str) – name of the script type to be executed (pre_auth_scripts, post_auth_scripts, select_session_scripts)
  • username (str) – name of the X2Go session user a script will run for
  • password (str) – password for the X2Go session
  • task (str) – the broker task that currently being processed
  • profile_id (str) – the session profile ID that is being operated upon
  • ip (str) – the client machine’s IP address
  • cookie (str) – the currently valid authentication cookie
  • authed (bool) – authentication status (already authenticated or not)
  • server (str) – hostname or IP address of the X2Go server being operated upon
Returns:

Pass-through of the return value returned by the to-be-run optional script (i.e., success or failure)

Return type:

bool