Search by

Tornado Engine module: GAM for Google Workspace, in its own container, for other modules to use.

v0.6.0 2026-11-13 21:02 UTC

This package is auto-updated.

Last update: 2026-11-13 21:03:39 UTC


README

A Tornado Engine module: GAM for Google Workspace, for other modules to use.

GAM runs in its own container (the GAM sidecar), which only the website can reach. It runs any GAM command the website sends, as a list of arguments (never through a shell).

Setup

  1. Add a shared password for the sidecar to .env (make it with openssl rand -hex 32):
    GAM_SIDECAR_TOKEN=
    
  2. Run docker compose up -d twice: the first run installs the module, the second starts its container.
  3. In Administration, upload GAM's oauth2.txt, oauth2service.json and client_secrets.json, then click Check connection.

Using GAM from a module

use TornadoEngine\Gam\Gam;

$gam = app(Gam::class);
$gam->orgUnits();                       // [['path' => '/Staff', 'name' => 'Staff'], ...]
$gam->groups();                         // [['email' => 'teachers@example.org', 'name' => 'Teachers'], ...]
$gam->groupMembers('teachers@example.org'); // ['ann@example.org', ...]
$gam->usersIn('/Staff');                // [['email' => ..., 'name' => ..., 'ou' => ...], ...]

For any other command, $gam->run(['update', 'user', 'ann@example.org', 'org', '/Staff']) returns its exit code and output. A GAM container that can't be reached throws GamException.