Add service-account auth and Workspace Events subscriptions - #213
Conversation
- auth_mode config (oauth default | service-account-dwd | service-account-app) with fail-closed, mutually exclusive mode validation and actionable errors - Service-account JWT token sources; DWD sets the impersonated subject, key material is never printed or persisted - App mode never pre-mints credentials and rejects all regular service clients (events-only surface); DWD follows user scope resolution - New 'events' service scope set for OAuth logins - Unit tests for every invalid mode combination, token-source error paths (incl. no key material in errors), and app-mode client isolation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- events subscriptions list/get/create/update/renew/delete/reactivate plus events decode (Pub/Sub CloudEvent from stdin) - GA-only boundary: Chat space/user events incl. read-state, baseline Drive file (v3.added et al.) + permission events, Meet conference/ participant/recording/transcript/smartNote; Preview families rejected with explanatory errors (customer targets, Drive comment/reply/ approval/access-proposal, chat.app.all.*, batch events output-only) - Least-privilege scopes per subscription class and auth mode; app-mode mutations derive exact granular chat.app scopes from the existing subscription (chat.bot Get first); list requires an event_types filter - Pub/Sub topic validated (projects/P/topics/T), never provisioned - CloudEvent decode: ce-source = subscription, ce-subject = target, base64 payload decoding, push envelope or bare message - auth login fails fast in service-account modes; auth status reports the configured service-account mode - Deterministic unit + httptest mock-server tests for validation, scopes, request shapes, lifecycle flows, and decoding Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- README: service-account auth configuration (auth_mode table, env examples, key-safety notes) and Events command reference section - CLAUDE.md: events command row and auth mode note - New skills/events skill: SKILL.md + references/commands.md covering lifecycle commands, GA targets/event types, Preview exclusions, existing-topic constraint, auth modes/scopes, and decode I/O - skills/auth: service-account modes section + setup-guide additions (DWD domain-admin authorization, app admin-approval boundary, no auth login in SA modes, events service in scoped login) - plugins/gws mirrors kept in sync (version-stripped SKILL.md, identical references, agents/openai.yaml for events) - skills tests: events added to expectedSkills, both servicesWithCommands lists, and the file-count inventory Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Makefile VERSION, Claude and Codex plugin manifests to 1.43.0 - CLAUDE.md Current Version describes service-account auth + events; service count/list updated to include Workspace Events - Workspace Events added to rootCmd service list, README feature inventory, and both plugin manifest descriptions - Manifest version test expectations updated to the 1.43.0 baseline Local release-candidate only: no tag, push, PR, or release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SummaryAdds service-account authentication and a new Workspace Events command suite covering subscription lifecycle and Pub/Sub notification decoding, with tests and documentation. What looks good
Issues foundCritical
Warning
Testing note: |
- auth status no longer reports authenticated:true for a merely configured service-account mode: it validates the key file locally (existence + JSON parse, no token mint, no network call) and reports configured/key_valid with surfaced missing/malformed-key errors - events subscriptions update rejects --event-types values that parse to an empty list (e.g. ",,") as a usage error instead of sending a PATCH with an empty update mask; regression test added - setup-guide wording clarified (configured != authenticated), mirror synced Meet recording/transcript/smartNote started/ended event types are intentionally retained: the official Meet events guide lists all three actions per family. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SummaryAdds service-account authentication modes and a new Workspace Events command group covering subscription lifecycle and CloudEvent decoding. What looks good
Issues found
Tests could not be executed because the read-only environment prevented Go from creating its module cache. |
Summary
v1.43.0: explicit service-account authentication and a
gws eventscommand group for the Workspace Events API.Service-account authentication
auth_modeconfig (GWS_AUTH_MODE):oauth(default, unchanged),service-account-dwd,service-account-app, withservice_account_key_fileandimpersonate_usersettings. Validation is fail-closed and mutually exclusive with actionable errors; key material is never persisted, printed, or echoed.gws auth loginfails fast in service-account modes;gws auth statusreports the configured mode.Workspace Events (
gws events)subscriptions list | get | create | update | renew | delete | reactivateplusevents decode(Pub/Sub CloudEvent from stdin: push envelope or bare message, base64 payload decoding,ce-source= subscription,ce-subject= target).spaceReadState/threadReadState, baseline Drive file (google.workspace.drive.file.v3.addedet al.) + permission events, and Meet conference/participant/recording/transcript/smartNote events. Rejected with explanatory errors: customer-wide Chat targets, Drive comment/reply/approval/access-proposal families,chat.app.all.*scopes (all Developer Preview), Chat availability events, and output-only batch events.drive.metadatafor Drive,meetings.space.readonly/createdfor Meet, per-class Chat readonly scopes). App-mode read/delete ops usechat.bot; mutations Get the existing subscription first and mint only the matching granularchat.app.*.readonlyscopes.projects/PROJECT/topics/TOPICand must already exist — never created or modified. List requires anevent_typesfilter (rejected locally otherwise).Docs & skills
skills/events(SKILL.md, references/commands.md) and updatedskills/auth+ setup guide;plugins/gwsmirrors synchronized (version-stripped SKILL.md,agents/openai.yaml); skills-test inventory extended.Validation
go test -count=1 ./...— all packages passgo vet ./...— cleanmake build— embeds Version=1.43.0 (verified via./bin/gws version)make release-check— all checks passed on a clean tree🤖 Generated with Claude Code