tornado-engine / gam
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
Requires
- php: ^8.4
- illuminate/support: ^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
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
- Add a shared password for the sidecar to
.env(make it withopenssl rand -hex 32):GAM_SIDECAR_TOKEN= - Run
docker compose up -dtwice: the first run installs the module, the second starts its container. - In Administration, upload GAM's
oauth2.txt,oauth2service.jsonandclient_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.