From a0db62f0fd89c12108d3bdd33eeb3e626fa883fd Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Thu, 24 Apr 2025 23:00:22 -0400 Subject: [PATCH] don't use this thing --- .../lib/api_clients/openai_sora_client/src/credentials.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/lib/api_clients/openai_sora_client/src/credentials.rs b/crates/lib/api_clients/openai_sora_client/src/credentials.rs index c9f4a68a31..b15c91080c 100644 --- a/crates/lib/api_clients/openai_sora_client/src/credentials.rs +++ b/crates/lib/api_clients/openai_sora_client/src/credentials.rs @@ -7,13 +7,18 @@ use errors::AnyhowResult; pub const USER_AGENT : &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"; #[derive(Clone, Deserialize)] +#[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub struct SoraCredentials { + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub bearer_token: String, + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub cookie: String, + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub sentinel: Option, } impl SoraCredentials { + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub fn authorization_header_value(&self) -> String { match self.bearer_token.get(0..6) { Some("bearer") | Some("Bearer") => self.bearer_token.clone(), @@ -21,6 +26,7 @@ impl SoraCredentials { } } + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub fn from_env() -> AnyhowResult { let bearer = std::env::var("SORA_BEARER_TOKEN")?; let cookie = std::env::var("SORA_COOKIE")?; @@ -29,12 +35,14 @@ impl SoraCredentials { Ok(Self { bearer_token: bearer, cookie, sentinel }) } + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub fn from_toml_file>(filename: P) -> AnyhowResult { let contents = std::fs::read_to_string(filename)?; let credentials = toml::from_str(&contents)?; Ok(credentials) } + #[deprecated(note="Use `SoraCredentialSet` instead as it has auto-healing behavior and doesn't require a bearer token initially.")] pub fn add_credential_headers_to_request(&self, request: RequestBuilder) -> RequestBuilder { let bearer_header = self.authorization_header_value();