← all adapters
google-admin-style
simulates Google Admin SDK Directory API directory_v1
restadapter v0.1.013 routes
verification
use it
# add to stunt.yaml
services:
google-admin:
adapter: embedded:google-admin-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the Google Admin SDK Directory API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Google Admin SDK Directory API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Google Admin SDK Directory API directory_v1 surface — the data is fake, the behavior is real.
backing stores
tokensusersgroupsmembersuser_tokens
api surface (13)
generated from the adapter manifest — exactly what boots, nothing more · covers 10% of the real API's 128 routes (derived from sdk google-api-go-client @ v0.293.0)
13 routes
GET/admin/directory/v1/users
POST/admin/directory/v1/users
GET/admin/directory/v1/users/{userKey}
PUT/admin/directory/v1/users/{userKey}
DELETE/admin/directory/v1/users/{userKey}
GET/admin/directory/v1/users/{userKey}/tokens
GET/admin/directory/v1/groups
POST/admin/directory/v1/groups
GET/admin/directory/v1/groups/{groupKey}
DELETE/admin/directory/v1/groups/{groupKey}
GET/admin/directory/v1/groups/{groupKey}/members
POST/admin/directory/v1/groups/{groupKey}/members
DELETE/admin/directory/v1/groups/{groupKey}/members/{memberKey}
SDK-verified behaviors (8)
- ✓Users.List Customer=my_customer returns the seeded directory
- ✓Users.Insert + Users.Get round-trip by numeric id and email
- ✓Users.List Domain narrows to a single email domain
- ✓Users.List Query isSuspended=true returns only suspended users
- ✓Users.Update renames the primary email; old key stops resolving
- ✓Users.Delete then Get -> decoded googleapi 404
- ✓Groups.Insert + Members.Insert + Members.List round-trip
- ✓Groups.List UserKey returns only the groups holding that member
Not implemented (4)
- No orgunits, roles, roleAssignments, or schemas resources
- No asps, verificationCodes, mobileDevices, or chromeosDevices
- No user/group aliases, user photos, domains, or customers endpoints
- No users.patch/groups.patch, members.get, or members.update endpoints
Differs from the real API (4)
- Users query supports bare terms plus email:/name:/orgUnitPath=/isSuspended= only
- Groups query silently ignores unrecognized query forms
- Static convenience tokens (ya29.mock-admin-token, conformance-token) seeded far-future
- users.list ignores customer/domain exactly-one-of enforcement; real Directory requires one
want more of the Google Admin SDK Directory API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.