Skip to content

fix(connect): clean Google device-code rejection + Trimble unregistered fail-fast (#151, #153)#155

Merged
pawellisowski merged 3 commits into
mainfrom
fix/connect-oauth-device-guards
May 24, 2026
Merged

fix(connect): clean Google device-code rejection + Trimble unregistered fail-fast (#151, #153)#155
pawellisowski merged 3 commits into
mainfrom
fix/connect-oauth-device-guards

Conversation

@pawellisowski
Copy link
Copy Markdown
Contributor

Summary

Two connect/auth UX fixes for the bundled first-party apps.

#153 follow-up (separate, needs portal access): register a real first-party Trimble Identity app and wire its client_id like #145 did for M365/Google. Until then BYO is the path.

Review

Codex (codex exec review --base main) — 3 rounds, all findings addressed, final pass clean (over-gating of BYO Google device-code; test env isolation).

Test plan

  • cargo test --bin aware (381) + connect_byo integration tests green; new unit + integration coverage for both paths, env-isolated
  • Changed files fmt + clippy clean (pre-existing crate drift in untouched lines unchanged)

…unregistered Trimble (#151, #153)

- #151: the bundled Google client is a Desktop/loopback client and can't do the
  device-authorization flow, so `--device-code` hit /device/code and leaked a raw
  401. Google now defaults to no device endpoint → the flow reports it unsupported
  and points at `--oauth` (which works), matching Trimble. A BYO profile that sets
  a device-capable endpoint still opts in.
- #153: `trimble-connect --oauth` sent the literal AWARE_AECO_PLACEHOLDER client_id
  to Trimble ("Unregistered client"). connect now fails fast when the resolved
  client_id is still a placeholder, pointing the user at a BYO profile (#146).
  Adds IntegrationConfig::is_placeholder_client. (Registering a real first-party
  Trimble app remains a separate follow-up.)
…undled (#151 review)

The first cut disabled Google device-code for any config lacking an explicit
device endpoint override — including BYO Google clients (env/profile client_id)
that may be device-capable. Only the bundled first-party Desktop client can't do
device-code; a BYO client now gets an explicit override or Google's standard
device endpoint. Gated on IntegrationConfig::is_first_party. Found by Codex.
- Google device-code regression test clears AWARE_OAUTH_GOOGLE_CLIENT_ID/SECRET
  so a BYO env override can't turn Google device-capable and hit the network.
- trimble placeholder unit test guards against AWARE_OAUTH_TRIMBLE_CLIENT_ID
  resolving a real BYO client. Found by Codex review.
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