verification
use it
# add to stunt.yaml
services:
google-cloudtasks:
adapter: embedded:google-cloudtasks-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the Google Cloud Tasks API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Google Cloud Tasks 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 Cloud Tasks API v2 surface — the data is fake, the behavior is real.
api surface (16)
generated from the adapter manifest — exactly what boots, nothing more
16 routes
GET/v2/projects/{project}/locations
GET/v2/projects/{project}/locations/{location}
GET/v2/projects/{project}/locations/{location}/cmekConfig
PATCH/v2/projects/{project}/locations/{location}/cmekConfig
POST/v2/projects/{project}/locations/{location}/queues
GET/v2/projects/{project}/locations/{location}/queues
GET/v2/projects/{project}/locations/{location}/queues/{queue}
PATCH/v2/projects/{project}/locations/{location}/queues/{queue}
DELETE/v2/projects/{project}/locations/{location}/queues/{queue}
POST/v2/projects/{project}/locations/{location}/queues/{queue_verb}
POST/v2/projects/{project}/locations/{location}/queues/{queue}/tasks
GET/v2/projects/{project}/locations/{location}/queues/{queue}/tasks
POST/v2/projects/{project}/locations/{location}/queues/{queue}/tasks:buffer
POST/v2/projects/{project}/locations/{location}/queues/{queue}/tasks/{task_verb}
GET/v2/projects/{project}/locations/{location}/queues/{queue}/tasks/{task}
DELETE/v2/projects/{project}/locations/{location}/queues/{queue}/tasks/{task}
Derived behaviors (static — not SDK-verified)
- params ×16
- stateful ×14
- query ×8
- body ×7
- clock ×5
- paginate ×3
Not implemented (7)
- No background dispatch loop — tasks are never auto-delivered at scheduleTime; only tasks.run drives attempts
- No gRPC transport (REST only); google-cloud-* client libraries default to gRPC
- oauthToken/oidcToken are stored verbatim — no token minting at dispatch time
- stackdriverLoggingConfig is stored but no logs are written
- IAM policies are stored but not enforced — testIamPermissions always grants
- No App Engine queue.yaml/xml semantics (DISABLED state, queue-file overrides)
- CMEK config is metadata-only; nothing is encrypted
Differs from the real API (7)
- Any OAuth2 bearer token is accepted; real Google validates tokens and IAM permissions
- tasks.run models the worker instead of calling it — success completes and deletes the task; the failing-worker profile simulates a 500 with retryConfig backoff
- queues.list filter supports only name/state with =, !=, and : containment (subset of the real filter grammar)
- tasks.list returns creation order; the real service defines no order
- Generated task IDs are counter-based 19-digit decimals, not random
- Purge is synchronous; real purge can take up to 60s to complete
- Deleted-task tombstones hold names exactly 24h (real retention is up to 24h, 9 days for queue.yaml queues)
want more of the Google Cloud Tasks 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.