feat #14740: admin backend client and transcript upload text
recorder-core side of linking the app to the euvino admin backend: - backend: BackendClient (create a key with the admin's session cookie, check a key, upload a transcript; redirects never followed), German error messages, the login-window decision (LoginStep) and the upload flow with login, one retry after a refused key and no loop - call_view: the upload text (header + merged, renamed lines) and the upload fields on the call - store: schema v3 with crm_transcript_id and uploaded_at - settings: backend_url (validated https), the app-managed login fields, kept on edit and cleared when the backend URL changes - secrets: Service::Backend; http: per-request follow_redirects; FakeTransport can script transport errors Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
//! API keys, stored only in the OS keyring (Windows Credential Manager,
|
||||
//! Linux Secret Service) under the service `eu.euvino.callrecorder`.
|
||||
//! Linux Secret Service) under the service `eu.euvino.callrecorder`: the
|
||||
//! DeepScript key the user enters and the euvino admin backend key the
|
||||
//! login creates.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Mutex;
|
||||
@@ -15,6 +17,7 @@ pub const KEYRING_SERVICE: &str = "eu.euvino.callrecorder";
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Service {
|
||||
DeepScript,
|
||||
Backend,
|
||||
}
|
||||
|
||||
impl Service {
|
||||
@@ -22,6 +25,7 @@ impl Service {
|
||||
pub fn user(self) -> &'static str {
|
||||
match self {
|
||||
Service::DeepScript => "deepscript",
|
||||
Service::Backend => "backend",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +121,7 @@ impl SecretStore for MemorySecrets {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
const SERVICES: &[Service] = &[Service::DeepScript];
|
||||
const SERVICES: &[Service] = &[Service::DeepScript, Service::Backend];
|
||||
|
||||
#[test]
|
||||
fn memory_secrets_roundtrip() {
|
||||
@@ -126,6 +130,7 @@ 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::Backend), None);
|
||||
|
||||
secrets.delete(Service::DeepScript).unwrap();
|
||||
assert_eq!(secrets.get(Service::DeepScript), None);
|
||||
|
||||
Reference in New Issue
Block a user