Commit Graph

674 Commits

Author SHA1 Message Date
Peter Steinberger
04b66fbdee fix(secrets): tighten token verification tests (#270) (thanks @zerone0x)
Some checks failed
ci / test (push) Has been cancelled
ci / worker (push) Has been cancelled
ci / windows (push) Has been cancelled
ci / darwin-cgo-build (push) Has been cancelled
2026-03-07 22:55:41 +00:00
zerone0x
81ded37565 fix(secrets): verify token persisted after keyring write
On macOS, the Keychain can silently write 0-byte entries when it is
locked in a headless/server environment, even though Set returns no
error.  The pre-flight check (EnsureKeychainAccess) does not catch
every case because the Keychain can appear unlocked yet still drop
data.

Add a read-back verification after SetToken writes the primary token.
If the read-back fails or returns empty data, return an actionable
error that suggests switching to the file-based keyring backend.

Fixes #206

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-07 22:54:28 +00:00
Peter Steinberger
5d5ce28d47 fix(help): reuse full-help mode constant 2026-03-07 22:53:59 +00:00
Peter Steinberger
52f91e36b8 fix(calendar): harden primary timezone fallback 2026-03-07 22:52:19 +00:00
Peter Steinberger
248623f1df docs(changelog): note recurring timezone fix (#392) (thanks @salmonumbrella) 2026-03-07 22:47:24 +00:00
salmonumbrella
f3a957a1bc fix(lint): avoid err shadow in recurrence timezone enrichment 2026-03-07 22:47:24 +00:00
salmonumbrella
bc6d342e60 fix(calendar): preserve RRULE values and enforce recurring timezone 2026-03-07 22:47:24 +00:00
doodaaatimmy-creator
e50dba7a4a docs(changelog): note remote auth replay fix 2026-03-07 22:46:35 +00:00
doodaaatimmy-creator
43724ba380 fix(auth): preserve remote step 2 replay flags 2026-03-07 22:46:35 +00:00
Peter Steinberger
373f267d3c chore(deps): refresh runtime and workflow dependencies 2026-03-07 22:43:47 +00:00
Peter Steinberger
b543668003 test(ci): skip duplicate vet work 2026-03-07 21:10:11 +00:00
salmonumbrella
09bfedfea0
fix(ci): harden release workflow against tag script injection (#299)
* fix(ci): harden workflow_dispatch tag handling in release

* fix(ci): land release workflow hardening note (#299) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 18:00:48 +00:00
salmonumbrella
752dae2cab
fix(groups): include required label filter in transitive group search (#315)
* fix(groups): add required labels filter for list query

* fix(groups): land transitive label filter note (#315) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 17:59:16 +00:00
Peter Steinberger
a2f001e3df fix(auth): persist rotated refresh tokens (#373) (thanks @joshp123) 2026-03-07 17:57:37 +00:00
the sun gif man
59ab29458c
fix(auth): persist rotated refresh tokens during API calls (#373)
Why
- gogcli refreshed access tokens from a stored refresh token but never wrote back
  a rotated refresh token returned by Google.
- In multi-process CLI usage this can leave keyring state stale across invocations
  and eventually cause invalid_grant when the old token is retired.

What
- add persistingTokenSource wrapper in internal/googleapi/client.go
- wrap oauth2.Config TokenSource in tokenSourceForAccountScopes
- persist rotated refresh token back into secrets store when it changes
- keep persistence failures non-fatal (warn, return token)
- add unit tests for rotate/no-rotate/persist-failure paths

Tests
- go test ./internal/googleapi
2026-03-07 17:57:23 +00:00
Peter Steinberger
5adb20f5a5 fix(calendar): land SA timezone lookup note (#325) (thanks @markwatson) 2026-03-07 17:53:57 +00:00
Mark Watson
a16a8016b1
fix(calendar): use Calendars.Get for TZ lookup to fix SA 404 (#325) 2026-03-07 17:53:45 +00:00
Peter Steinberger
e8e7f9c87a fix(gmail): land charset fallback note (#428) (thanks @WinnCook) 2026-03-07 17:52:11 +00:00
Winn Cook
f68f022cb8
fix(gmail): decode mime-type charset fallback (#428)
Co-authored-by: doodaaatimmy-creator <doodaaatimmy@gmail.com>
2026-03-07 17:51:57 +00:00
Peter Steinberger
5ca86b1526 test(calendar): harden subscribe coverage 2026-03-07 16:59:58 +00:00
Peter Steinberger
b15ccd4166 feat(calendar): add subscribe command (#327) (thanks @cdthompson) 2026-03-07 16:55:08 +00:00
Christopher D Thompson
d8650ad908
feat(calendar): add subscribe command for calendarList.insert API (#327)
Add new `calendar subscribe` command to add an existing calendar to the
user's calendar list. Supports optional flags for color, hidden state,
and selection state.

Aliases: sub, add-calendar

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-07 16:54:57 +00:00
Peter Steinberger
abed3d8ad9 fix(calendar): hide cancelled events in list output (#362) (thanks @sharukh010) 2026-03-07 16:52:53 +00:00
Pathan Sharukh Khan
d2acfa48ac
Fix/filter cancelled events (#362)
* fix: filter cancelled events from calendar list by default

* fix(contacts): fix bool/string type mismatch in apply helpers.
2026-03-07 16:52:43 +00:00
Peter Steinberger
845cb7f9b7 fix(contacts): send required other-contact copy mask (#384) (thanks @rbansal42) 2026-03-07 16:50:08 +00:00
Rahul Bansal
1dffd30af8
fix: populate CopyMask in contacts other delete to fix 400 error (#384)
The deleteOtherContact function called CopyOtherContactToMyContactsGroup
with an empty CopyOtherContactToMyContactsGroupRequest{}, but the Google
People API requires the CopyMask field to specify which fields to copy.
Omitting it causes a 400 badRequest error: 'copyMask is required'.

Fix by setting CopyMask to include all relevant contact fields.

Fixes #383

Co-authored-by: Rahul Bansal <rahul@hudle.in>
2026-03-07 16:49:59 +00:00
Peter Steinberger
484faeae30 fix(auth): isolate Keep service account fallback (#414) (thanks @jgwesterlund) 2026-03-07 16:48:19 +00:00
John Westerlund
fae24e3b1d
fix(auth): restrict Keep service account to Keep API calls only (#414)
When a Keep-specific service account file (keep-sa-*.json) exists,
tokenSourceForServiceAccountScopes falls back to it for all API calls,
not just Keep. This causes 401 errors on Calendar, Gmail, Drive, and
other services that should use OAuth.

Only use keep-sa and legacy Keep SA files when serviceLabel is "keep",
allowing other services to fall through to OAuth authentication.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:47:39 +00:00
Peter Steinberger
8036c597a1 fix(googleapi): scope timeout landing cleanup (#425) (thanks @laihenyi) 2026-03-07 16:44:51 +00:00
laihenyi
449beff88b
fix(googleapi): replace Client.Timeout with transport-level ResponseHeaderTimeout (#425)
* feat(drive): include shortcutDetails in drive get fields

Add shortcutDetails to the Drive Get API fields to enable resolving
shortcut target file IDs and MIME types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(googleapi): replace Client.Timeout with transport-level ResponseHeaderTimeout

The global http.Client.Timeout (30s) applied to the entire request
lifecycle, causing large Drive file downloads (videos, backups, etc.)
to time out. Replace it with http.Transport.ResponseHeaderTimeout
which only limits the time waiting for the server to begin responding.
Once response headers arrive and the body starts streaming, there is
no hard cap — large transfers complete naturally.

- Set ResponseHeaderTimeout=30s on the base transport
- Remove http.Client.Timeout from the API client
- Keep a dedicated tokenExchangeTimeout=30s for OAuth2 token refreshes
- Add tests verifying the new transport configuration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 16:44:37 +00:00
Peter Steinberger
4403350a18 ci: cancel stale runs and cache tool installs 2026-03-07 15:35:06 +00:00
Peter Steinberger
0287bf3b9d fix: land sheets create parent move semantics (#424) (thanks @ManManavadaria) 2026-03-07 15:32:19 +00:00
Man Manavadaria
56398222f1
sheets create: add --parent flag and move spreadsheet to parent folder using Drive service (#424) 2026-03-07 15:31:47 +00:00
Peter Steinberger
6fa8b66941 fix(ci): satisfy nilnil lint in watch serve test 2026-03-07 15:01:27 +00:00
Peter Steinberger
8bf794a0b1 docs: backfill changelog entry for watch serve client override (#411) 2026-03-07 15:00:01 +00:00
Chrys Bader
2ee9860712
fix(gmail): preserve --client in watch serve push handler contexts (#411)
Ensure gmail watch serve re-applies the selected OAuth client to request-time contexts before creating Gmail services, so push handling does not fall back to client default in multi-client setups.
2026-03-07 14:59:29 +00:00
salmonumbrella
4abcd03da7
fix(gmail): allow Workspace native aliases with empty verification status (#407)
* fix(gmail): allow workspace native aliases for --from

* fix: land Workspace alias send fix and changelog (#407) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 14:56:25 +00:00
salmonumbrella
caf38a3d33
fix(gmail-watch): delay history fetch in watch serve (#397)
* fix(gmail-watch): delay history fetch in watch serve

* fix: land gmail watch fetch delay and changelog (#397) (thanks @salmonumbrella)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-03-07 14:54:54 +00:00
Viz
4b1d1d429d
fix: embed IANA timezone database for Windows support (#388)
- Import time/tzdata in cmd/gog/main.go to bundle the IANA tz database
  into the binary (~450KB), fixing time.LoadLocation on Windows
- Add tzdata_test.go verifying LoadLocation works for representative zones
- Add windows-latest CI job running the full gate (fmt, lint, test, build)
2026-03-07 14:53:06 +00:00
laihenyi
e208a50128
fix(contacts): correct parameter types in contacts apply helpers (#355)
* fix(contacts): correct parameter types in contacts apply helpers

Go's parameter grouping syntax caused `given` and `org` to be typed as
`bool` instead of `string` in contactsApplyPersonName and
contactsApplyPersonOrganization, resulting in a build failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(contacts): resolve lint errors from upstream refactor

- Rewrite if-else chain to switch statement (gocritic)
- Rename `clear` variable to `clearAll` to avoid shadowing predeclared
  identifier (predeclared)
- Remove unused `primaryURL` function (unused)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 14:51:46 +00:00
Peter Steinberger
0ed89978d3 fix(sheets): cover rich-text hyperlinks in links command (#374) (thanks @omothm) 2026-03-03 05:25:56 +00:00
Omar Othman
ddc1a232e0 feat(sheets): add links command to retrieve cell hyperlinks
Add `gog sheets links` (alias: hyperlinks) command that retrieves
hyperlinks embedded in cells via spreadsheets.get with IncludeGridData.
Mirrors the existing `notes` command pattern using the CellData.Hyperlink field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 05:25:56 +00:00
Peter Steinberger
9eb42121e9 docs: update drive ls --all docs/changelog (#107) (thanks @struong) 2026-03-03 05:06:17 +00:00
Steven Truong
14af8f2604 feat(drive): add --all flag to ls for global file listing 2026-03-03 05:06:17 +00:00
Peter Steinberger
e909bc8aad fix: honor dry-run for gmail bulk shortcuts (#385) (thanks @yeager) 2026-03-03 04:33:41 +00:00
Daniel Nylander
74d8089a15 feat(gmail): add archive, read, unread, trash convenience commands
New top-level Gmail commands for common label operations:

- `gog gmail archive` — remove INBOX label (archive)
- `gog gmail read` — remove UNREAD label (mark as read)
- `gog gmail unread` — add UNREAD label (mark as unread)
- `gog gmail trash` — add TRASH + remove INBOX label

All commands support:
- Message IDs as positional args: `gog gmail archive ID1 ID2`
- Query-based bulk ops: `gog gmail archive -q 'is:unread older_than:7d'`
- `--max` to limit query results (default 100)
- JSON output with `--json`
- Automatic batching (1000 per request, Gmail API limit)

These wrap the existing `gog gmail batch modify` with ergonomic
shortcuts for the most common Gmail operations.
2026-03-03 04:33:41 +00:00
Peter Steinberger
7abf494408 fix(ci): clear pre-existing lint baseline and docs updates 2026-03-03 04:06:29 +00:00
Peter Steinberger
0041b1f86a fix(auth): document gmail scope + readonly scope behavior (#113) (thanks @salmonumbrella) 2026-03-03 03:58:53 +00:00
salmonumbrella
59fb51276f fix(auth): resolve main rebase fallout 2026-03-03 03:58:53 +00:00
salmonumbrella
6eab7fd95a fix(lint): add blank lines for wsl_v5 linter
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-03 03:58:53 +00:00