Skip to content

feat: add Google Contacts (People API) provider#355

Open
cfis wants to merge 1 commit into
onecli:mainfrom
cfis:feat/google-contacts-provider
Open

feat: add Google Contacts (People API) provider#355
cfis wants to merge 1 commit into
onecli:mainfrom
cfis:feat/google-contacts-provider

Conversation

@cfis
Copy link
Copy Markdown
Contributor

@cfis cfis commented Jun 5, 2026

Summary

Adds Google Contacts as a new OAuth app provider, routing people.googleapis.com through OneCLI's standard Google OAuth + refresh flow. Mirrors the existing Google Workspace app pattern (single-host subdomain → Bearer auth → shared GOOGLE_REFRESH config).

Default scopes: contacts.readonly + contacts.other.readonly. Full write (contacts) and directory (directory.readonly) available as toggleable permissions in the UI.

Files

  • packages/api/src/apps/google-contacts.ts — app definition (mirrors google-docs.ts)
  • packages/api/src/apps/app-permissions/google-contacts.ts — tool/scope definitions for the permissions UI
  • packages/api/src/apps/registry.ts — register in static apps list
  • packages/api/src/apps/app-permissions/index.ts — register permissions
  • apps/gateway/src/apps.rs — new AppProvider entry routing people.googleapis.com with Bearer + GOOGLE_REFRESH, plus 4 test entries
  • apps/web/public/icons/google-contacts.svgplaceholder icon (Material Design contacts glyph in Google blue #1A73E8); maintainers may want to swap for an official asset

Test plan

  • cargo fmt --check passes
  • cargo clippy -- -D warnings passes
  • cargo test apps:: — 117 passed, 0 failed (4 new assertions added to existing test functions + 2 new dedicated tests: google_contacts_api_uses_bearer, provider_for_host_google_contacts)
  • pnpm check-types, pnpm lint, pnpm format:check all pass (run via husky pre-push)
  • Manual: connect via Apps → Google Contacts in the OneCLI web UI, confirm OAuth grants the contacts scope, and verify a request to https://people.googleapis.com/v1/people/me/connections returns 200 with injected bearer

Mirrors the existing Google Workspace app pattern. Routes
people.googleapis.com through Bearer + GOOGLE_REFRESH, sharing
OAuth config fields with other Google providers. Scopes:
contacts.readonly, contacts.other.readonly (default); contacts
and directory.readonly available as toggleable permissions.

Tests: 4 new assertions in apps.rs covering host routing, bearer
injection, and provider-for-host lookup. cargo test apps:: → 117
passed, 0 failed.

Note: included icon is a placeholder using Material Design's
contacts glyph in Google blue (#1A73E8); maintainers may want to
swap for an official Google Contacts brand asset.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@cfis cfis force-pushed the feat/google-contacts-provider branch from cc15790 to aa582d7 Compare June 6, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant