Metadata-Version: 2.4
Name: google-auth-core
Version: 0.2.0
Summary: Shared Google OAuth token store and authorized-service factory for CLIs and MCP servers
Author: Nitai Aharoni
License-Expression: MIT
Project-URL: Homepage, https://github.com/nitaiaharoni1/google-auth-core
Project-URL: Repository, https://github.com/nitaiaharoni1/google-auth-core
Keywords: google,oauth,authentication,credentials,mcp,cli
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: google-api-python-client>=2.0.0
Requires-Dist: google-auth>=2.0.0
Requires-Dist: google-auth-oauthlib>=0.5.0
Requires-Dist: google-auth-httplib2>=0.1.0
Requires-Dist: click>=8.0.0
Dynamic: license-file

# google-auth-core

Single source of truth for the `~/.google` credential store, shared by the
Google CLIs (`gmail-cli`, `google-calendar-cli`) and the Google Workspace MCP
servers (`gmail-mcp`, `gcal-mcp`, `gsheets-mcp`, `gdocs-mcp`, `gdrive-mcp`).

## What it provides

- A unified per-account token store under `~/.google/tokens/google_<account>.json`
  holding all scopes (Gmail + Calendar + Sheets + Docs + Drive), so one consent covers every
  service for both CLIs and MCP servers.
- Account management: default account, aliases (`work`, `personal`), env and
  directory overrides.
- `get_service(api, version, account)`: an authorized `googleapiclient` service,
  cached per `(account, api, version)` for persistent, multi-account-safe use.
- A consistent error taxonomy (`AuthError`, `NotFoundError`, `RateLimitError`,
  `InvalidArgumentError`, `UpstreamError`) and `map_http_error`.

## CLI

```bash
google-auth login [account]        # one-time OAuth, writes a unified token
google-auth list                   # accounts, default, aliases
google-auth alias work you@work.com
google-auth status                 # token health per account
google-auth default you@work.com
google-auth logout you@work.com
```

Place your OAuth client (Desktop app) at `~/.google/credentials.json` first.
