Remove ZED_SECRET_CLIENT_TOKEN

This commit is contained in:
Conrad Irwin 2024-01-23 10:34:00 -07:00
parent ba5b969e10
commit ff60d886f6
5 changed files with 5 additions and 21 deletions

View File

@ -1,7 +1,7 @@
mod update_notification;
use anyhow::{anyhow, Context, Result};
use client::{Client, TelemetrySettings, ZED_APP_PATH, ZED_APP_VERSION, ZED_SECRET_CLIENT_TOKEN};
use client::{Client, TelemetrySettings, ZED_APP_PATH, ZED_APP_VERSION};
use db::kvp::KEY_VALUE_STORE;
use db::RELEASE_CHANNEL;
use gpui::{
@ -248,9 +248,7 @@ impl AutoUpdater {
)
})?;
let mut url_string = format!(
"{server_url}/api/releases/latest?token={ZED_SECRET_CLIENT_TOKEN}&asset=Zed.dmg"
);
let mut url_string = format!("{server_url}/api/releases/latest?asset=Zed.dmg");
cx.update(|cx| {
if let Some(param) = cx
.try_global::<ReleaseChannel>()

View File

@ -68,7 +68,6 @@ lazy_static! {
std::env::var("ZED_ALWAYS_ACTIVE").map_or(false, |e| e.len() > 0);
}
pub const ZED_SECRET_CLIENT_TOKEN: &str = "618033988749894";
pub const INITIAL_RECONNECTION_DELAY: Duration = Duration::from_millis(100);
pub const CONNECTION_TIMEOUT: Duration = Duration::from_secs(5);

View File

@ -1,6 +1,6 @@
mod event_coalescer;
use crate::{TelemetrySettings, ZED_SECRET_CLIENT_TOKEN, ZED_SERVER_URL};
use crate::{TelemetrySettings, ZED_SERVER_URL};
use chrono::{DateTime, Utc};
use futures::Future;
use gpui::{AppContext, AppMetadata, BackgroundExecutor, Task};
@ -51,7 +51,6 @@ lazy_static! {
#[derive(Serialize, Debug)]
struct EventRequestBody {
token: &'static str,
installation_id: Option<Arc<str>>,
session_id: Option<Arc<str>>,
is_staff: Option<bool>,
@ -527,7 +526,6 @@ impl Telemetry {
{
let state = this.state.lock();
let request_body = EventRequestBody {
token: ZED_SECRET_CLIENT_TOKEN,
installation_id: state.installation_id.clone(),
session_id: state.session_id.clone(),
is_staff: state.is_staff.clone(),

View File

@ -2,7 +2,7 @@ use std::{ops::RangeInclusive, sync::Arc, time::Duration};
use anyhow::{anyhow, bail};
use bitflags::bitflags;
use client::{Client, ZED_SECRET_CLIENT_TOKEN, ZED_SERVER_URL};
use client::{Client, ZED_SERVER_URL};
use db::kvp::KEY_VALUE_STORE;
use editor::{Editor, EditorEvent};
use futures::AsyncReadExt;
@ -46,7 +46,6 @@ struct FeedbackRequestBody<'a> {
installation_id: Option<Arc<str>>,
system_specs: SystemSpecs,
is_staff: bool,
token: &'a str,
}
bitflags! {
@ -305,7 +304,6 @@ impl FeedbackModal {
installation_id,
system_specs,
is_staff: is_staff.unwrap_or(false),
token: ZED_SECRET_CLIENT_TOKEN,
};
let json_bytes = serde_json::to_vec(&request)?;
let request = Request::post(feedback_endpoint)

View File

@ -493,7 +493,6 @@ struct Panic {
#[derive(Serialize)]
struct PanicRequest {
panic: Panic,
token: String,
}
static PANIC_COUNT: AtomicU32 = AtomicU32::new(0);
@ -657,11 +656,7 @@ async fn upload_previous_panics(
});
if let Some(panic) = panic {
let body = serde_json::to_string(&PanicRequest {
panic,
token: client::ZED_SECRET_CLIENT_TOKEN.into(),
})
.unwrap();
let body = serde_json::to_string(&PanicRequest { panic }).unwrap();
let request = Request::post(&panic_report_url)
.redirect_policy(isahc::config::RedirectPolicy::Follow)
@ -727,10 +722,6 @@ async fn upload_previous_crashes(
let request = Request::post(&crash_report_url)
.redirect_policy(isahc::config::RedirectPolicy::Follow)
.header("Content-Type", "text/plain")
.header(
"Authorization",
format!("token {}", client::ZED_SECRET_CLIENT_TOKEN),
)
.body(body.into())?;
let response = http.send(request).await.context("error sending crash")?;