diff options
Diffstat (limited to 'internal/api/google_tasks.go')
| -rw-r--r-- | internal/api/google_tasks.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/api/google_tasks.go b/internal/api/google_tasks.go index 644f124..9188bc7 100644 --- a/internal/api/google_tasks.go +++ b/internal/api/google_tasks.go @@ -20,11 +20,19 @@ type GoogleTasksClient struct { displayTZ *time.Location } -// NewGoogleTasksClient creates a client for Google Tasks. +// NewGoogleTasksClient creates a client for Google Tasks authenticated via +// the given option (e.g. option.WithHTTPClient for OAuth -- see +// NewGoogleTasksOAuthClient in google_tasks_oauth.go). Service-account auth +// (option.WithCredentialsFile) does NOT work for Tasks: a service account +// has no path to a regular user's personal task lists, unlike Calendar, +// which supports sharing a calendar with any email including a service +// account's. Confirmed 2026-07-14 (see project_doot_google_tasks_oauth_limitation +// memory) -- always returns exactly one list ("My Tasks") with zero items, +// the service account's own empty default list, never the real user's. // tasklistID can be "@default" for the primary list, or a specific list ID. // Multiple lists can be comma-separated. -func NewGoogleTasksClient(ctx context.Context, credentialsFile, tasklistID, timezone string) (*GoogleTasksClient, error) { - srv, err := tasks.NewService(ctx, option.WithCredentialsFile(credentialsFile)) +func NewGoogleTasksClient(ctx context.Context, clientOpt option.ClientOption, tasklistID, timezone string) (*GoogleTasksClient, error) { + srv, err := tasks.NewService(ctx, clientOpt) if err != nil { return nil, fmt.Errorf("unable to create Tasks client: %v", err) } |
