YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(connect): wire real OAuth client IDs for QuickBooks + Google Sheets
Louis Beaumont2efc78836dd3
diff --git a/crates/screenpipe-connect/src/connections/google_sheets.rs b/crates/screenpipe-connect/src/connections/google_sheets.rsindex eabeb3754..733f0876d 100644--- a/crates/screenpipe-connect/src/connections/google_sheets.rs+++ b/crates/screenpipe-connect/src/connections/google_sheets.rs@@ -23,16 +23,9 @@ static DEF: IntegrationDef = IntegrationDef {fields: &[],};-// TODO: create a new OAuth 2.0 client in the screenpipe GCP project-// (https://console.cloud.google.com/ → APIs & Services → Credentials),-// add http://localhost:3030/connections/oauth/callback as an authorised redirect URI,-// enable the Google Sheets API, then:-// • replace GOOGLE_SHEETS_CLIENT_ID_PLACEHOLDER with the new client_id-// • set OAUTH_GOOGLE_SHEETS_CLIENT_ID / OAUTH_GOOGLE_SHEETS_CLIENT_SECRET env vars-// on the screenpi.pe backend (website/app/api/oauth/exchange/route.ts).static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://accounts.google.com/o/oauth2/v2/auth",- client_id: "GOOGLE_SHEETS_CLIENT_ID_PLACEHOLDER",+ client_id: "7048263620-6k41um04kbtd7v51k6tv9r5jtohs8iic.apps.googleusercontent.com",extra_auth_params: &[("scope",@@ -74,14 +67,11 @@ impl Integration for GoogleSheets {_creds: &Map<String, Value>,secret_store: Option<&SecretStore>,) -> Result<String> {- let token =- oauth::get_valid_token_instance(secret_store, client, "google-sheets", None)- .await- .ok_or_else(|| {- anyhow!(- "not connected — connect Google Sheets in Settings > Connections"- )- })?;+ let token = oauth::get_valid_token_instance(secret_store, client, "google-sheets", None)+ .await+ .ok_or_else(|| {+ anyhow!("not connected — connect Google Sheets in Settings > Connections")+ })?;let resp: Value = client.get("https://www.googleapis.com/oauth2/v2/userinfo")diff --git a/crates/screenpipe-connect/src/connections/mod.rs b/crates/screenpipe-connect/src/connections/mod.rsindex d63c74b92..4e1d45c6d 100644--- a/crates/screenpipe-connect/src/connections/mod.rs+++ b/crates/screenpipe-connect/src/connections/mod.rs@@ -23,7 +23,6 @@ pub mod glean;pub mod gmail;pub mod google_calendar;pub mod google_sheets;-pub mod quickbooks;pub mod granola;pub mod hubspot;pub mod intercom;@@ -43,6 +42,7 @@ pub mod otter;pub mod perplexity;pub mod pipedrive;pub mod pushover;+pub mod quickbooks;pub mod salesforce;pub mod sentry;pub mod slack;diff --git a/crates/screenpipe-connect/src/connections/quickbooks.rs b/crates/screenpipe-connect/src/connections/quickbooks.rsindex a80c67fd7..8f4b16aa5 100644--- a/crates/screenpipe-connect/src/connections/quickbooks.rs+++ b/crates/screenpipe-connect/src/connections/quickbooks.rs@@ -25,14 +25,9 @@ static DEF: IntegrationDef = IntegrationDef {fields: &[],};-// TODO: register an app at https://developer.intuit.com/ (sandbox or production),-// set redirect URI to http://localhost:3030/connections/oauth/callback,-// then replace QUICKBOOKS_CLIENT_ID_PLACEHOLDER with the real client_id and-// set OAUTH_QUICKBOOKS_CLIENT_ID / OAUTH_QUICKBOOKS_CLIENT_SECRET env vars on the-// screenpi.pe backend (website/app/api/oauth/exchange/route.ts).static OAUTH: OAuthConfig = OAuthConfig {auth_url: "https://appcenter.intuit.com/connect/oauth2",- client_id: "QUICKBOOKS_CLIENT_ID_PLACEHOLDER",+ client_id: "ABNRiJAvFPuyXbm2qHmb6RHdKCjvlNIDJWqc31JNMxyC44aIdr",extra_auth_params: &[("scope", "com.intuit.quickbooks.accounting")],redirect_uri_override: None,};@@ -68,14 +63,11 @@ impl Integration for QuickBooks {_creds: &Map<String, Value>,secret_store: Option<&SecretStore>,) -> Result<String> {- let token =- oauth::get_valid_token_instance(secret_store, client, "quickbooks", None)- .await- .ok_or_else(|| {- anyhow!(- "not connected — connect QuickBooks Online in Settings > Connections"- )- })?;+ let token = oauth::get_valid_token_instance(secret_store, client, "quickbooks", None)+ .await+ .ok_or_else(|| {+ anyhow!("not connected — connect QuickBooks Online in Settings > Connections")+ })?;let stored = oauth::load_oauth_json(secret_store, "quickbooks", None).awaitdiff --git a/crates/screenpipe-engine/src/connections_api.rs b/crates/screenpipe-engine/src/connections_api.rsindex b57162573..61119aeee 100644--- a/crates/screenpipe-engine/src/connections_api.rs+++ b/crates/screenpipe-engine/src/connections_api.rs@@ -923,9 +923,7 @@ async fn oauth_callback(Query(params): Query<OAuthCallbackQuery>) -> (StatusCode// For providers that return extra callback params (e.g. QuickBooks realmId),// encode them alongside the code as JSON so the Tauri command can extract both.let payload = match params.realm_id {- Some(ref rid) => {- serde_json::json!({"code": code, "realmId": rid}).to_string()- }+ Some(ref rid) => serde_json::json!({"code": code, "realmId": rid}).to_string(),None => code,};let _ = tx.send(payload);@@ -1095,12 +1093,9 @@ async fn connection_proxy(let raw_creds = mgr.get_credentials(&id).await.ok().flatten();let creds: Option<Map<String, Value>> = {let mut merged = raw_creds.unwrap_or_default();- if let Some(oauth_json) = screenpipe_connect::oauth::load_oauth_json(- state.secret_store.as_deref(),- &id,- None,- )- .await+ if let Some(oauth_json) =+ screenpipe_connect::oauth::load_oauth_json(state.secret_store.as_deref(), &id, None)+ .await{const SKIP: &[&str] = &["access_token",