BlueGit

ict rusty-teams

Files

rusty-teams / docs / decisions / 0009-bundled-google-oauth-client.md

0009-bundled-google-oauth-client.md

0009-bundled-google-oauth-client.md 1.5 KiB Download Raw

--- status: accepted date: 2026-11-13 ---

ADR 0009: Bundled Google OAuth Desktop client

Context

Google Calendar Connect needs an OAuth Desktop client id. Asking every user to create one in Google Cloud Console, or to export shell variables before starting the Mac .app, fails for Dock and Start Menu launches. A settings field for the client id would still dump Cloud Console work on end users.

Options were: env vars only, a settings field for the client id, or one project client baked into release builds.

Decision

Official release builds compile in the project Desktop client id (and optional secret) via option_env!. Runtime env vars still override for developers. Users only click Connect Google; tokens stay on the device (see ADR 0002). Release CI must supply the client id at compile time so Dock and Start Menu launches are not Outlook-only by accident.

A client id and secret saved in Settings override both the environment and this compiled client (ADR 0024). When those fields are empty, this decision still applies.

Consequences

  • Connect works from a Dock-started macOS .app and from Windows/Linux installers without a terminal.
  • The project owns the Google Cloud consent screen and verification path for the sensitive calendar scope.
  • Local cargo run without the secret stays Outlook-only unless the developer exports the env vars.
  • The client id is visible in the binary; the secret must never appear in UI, logs, or the store. A secret the user types is stored in the OS keyring (ADR 0024) and is not shown again after save.
Source
1---
2status: accepted
3date: 2026-11-13
4---
5
6# ADR 0009: Bundled Google OAuth Desktop client
7
8## Context
9
10Google Calendar Connect needs an OAuth Desktop client id. Asking every user to create one in Google Cloud Console, or to export shell variables before starting the Mac `.app`, fails for Dock and Start Menu launches. A settings field for the client id would still dump Cloud Console work on end users.
11
12Options were: env vars only, a settings field for the client id, or one project client baked into release builds.
13
14## Decision
15
16Official release builds compile in the project Desktop client id (and optional secret) via `option_env!`. Runtime env vars still override for developers. Users only click Connect Google; tokens stay on the device (see ADR 0002). Release CI must supply the client id at compile time so Dock and Start Menu launches are not Outlook-only by accident.
17
18A client id and secret saved in Settings override both the environment and this compiled client (ADR 0024). When those fields are empty, this decision still applies.
19
20## Consequences
21
22- Connect works from a Dock-started macOS `.app` and from Windows/Linux installers without a terminal.
23- The project owns the Google Cloud consent screen and verification path for the sensitive `calendar` scope.
24- Local `cargo run` without the secret stays Outlook-only unless the developer exports the env vars.
25- The client id is visible in the binary; the secret must never appear in UI, logs, or the store. A secret the user types is stored in the OS keyring (ADR 0024) and is not shown again after save.