chore #14740: remove claude config and customer selection
Summaries are not coming to the desktop app, and the customer is chosen in the web UI after the upload: - drop the Anthropic key (Service::Anthropic, Settings field) and delete a leftover keyring entry best-effort at startup - drop the Summary model, the store's summary accessors and the "Zusammenfassung" tab; the transcript is the detail's only content - drop the mocked customer accounts, list_accounts/set_account and the "Kunde" dropdown; calls.account_id and summaries stay in the schema Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,6 @@ pub const KEYRING_SERVICE: &str = "eu.euvino.callrecorder";
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Service {
|
||||
DeepScript,
|
||||
Anthropic,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
@@ -23,7 +22,6 @@ impl Service {
|
||||
pub fn user(self) -> &'static str {
|
||||
match self {
|
||||
Service::DeepScript => "deepscript",
|
||||
Service::Anthropic => "anthropic",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +43,10 @@ pub trait SecretStore: Send + Sync {
|
||||
fn delete(&self, s: Service) -> Result<()>;
|
||||
}
|
||||
|
||||
/// Keyring users of keys that earlier versions stored and this one no
|
||||
/// longer uses: the Anthropic key of the dropped Claude summary.
|
||||
const UNUSED_USERS: [&str; 1] = ["anthropic"];
|
||||
|
||||
/// The OS keyring.
|
||||
pub struct KeyringSecrets;
|
||||
|
||||
@@ -53,6 +55,21 @@ impl KeyringSecrets {
|
||||
keyring::Entry::new(KEYRING_SERVICE, s.user())
|
||||
.map_err(|e| SecretError::Keyring(e.to_string()))
|
||||
}
|
||||
|
||||
/// Best-effort deletes the keys earlier versions stored and this one no
|
||||
/// longer uses, so no stale secret lingers in the keyring. Missing
|
||||
/// entries and failures are only logged (never the key).
|
||||
pub fn remove_unused_keys() {
|
||||
for user in UNUSED_USERS {
|
||||
let result =
|
||||
keyring::Entry::new(KEYRING_SERVICE, user).and_then(|e| e.delete_credential());
|
||||
match result {
|
||||
Ok(()) => log::info!("removed the unused keyring entry {user:?}"),
|
||||
Err(keyring::Error::NoEntry) => {}
|
||||
Err(e) => log::info!("could not remove the unused keyring entry {user:?}: {e}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl SecretStore for KeyringSecrets {
|
||||
@@ -100,6 +117,8 @@ impl SecretStore for MemorySecrets {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
const SERVICES: &[Service] = &[Service::DeepScript];
|
||||
|
||||
#[test]
|
||||
fn memory_secrets_roundtrip() {
|
||||
let secrets = MemorySecrets::default();
|
||||
@@ -107,16 +126,22 @@ mod tests {
|
||||
|
||||
secrets.set(Service::DeepScript, "ds-key").unwrap();
|
||||
assert_eq!(secrets.get(Service::DeepScript).as_deref(), Some("ds-key"));
|
||||
assert_eq!(secrets.get(Service::Anthropic), None);
|
||||
|
||||
secrets.delete(Service::DeepScript).unwrap();
|
||||
assert_eq!(secrets.get(Service::DeepScript), None);
|
||||
secrets.delete(Service::DeepScript).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unused_keys_never_include_a_key_in_use() {
|
||||
for &s in SERVICES {
|
||||
assert!(!UNUSED_USERS.contains(&s.user()), "{s:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn service_serializes_as_keyring_user() {
|
||||
for s in [Service::DeepScript, Service::Anthropic] {
|
||||
for &s in SERVICES {
|
||||
let json = serde_json::to_string(&s).unwrap();
|
||||
assert_eq!(json, format!("\"{}\"", s.user()));
|
||||
assert_eq!(serde_json::from_str::<Service>(&json).unwrap(), s);
|
||||
|
||||
Reference in New Issue
Block a user