Security: Remove email from credential logs and add live smoke test
credentials/mod.rs: - Remove email from log messages (privacy/security best practice) - Logs still indicate success without exposing PII tests/qobuz_live_smoke.rs: - Add ignored live smoke test for Qobuz API - Requires explicit opt-in via QBZ_RUN_QOBUZ_LIVE_TESTS=1 - Uses local credentials from keyring (no hardcoded secrets) - Basic test: login + get_favorites endpoint - Safe for repository (no credentials exposed)
This commit is contained in:
1 parent
c1d32b4181
commit
b0d70b390a
2 files changed
+43
-3
No files matched your search
@@ -85,7 +85,7 @@ fn load_from_fallback() -> Result<Option<QobuzCredentials>, String> {
|
||||
let credentials: QobuzCredentials = serde_json::from_str(&json)
|
||||
.map_err(|e| format!("Failed to parse credentials: {}", e))?;
|
||||
|
||||
log::info!("Credentials loaded from fallback file for: {}", credentials.email);
|
||||
log::info!("Credentials loaded from fallback file");
|
||||
Ok(Some(credentials))
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ fn has_fallback_credentials() -> bool {
|
||||
|
||||
/// Save Qobuz credentials - saves to both file (primary) and keyring (secondary)
|
||||
pub fn save_qobuz_credentials(email: &str, password: &str) -> Result<(), String> {
|
||||
log::info!("Attempting to save credentials for: {}", email);
|
||||
log::info!("Attempting to save credentials");
|
||||
|
||||
let credentials = QobuzCredentials {
|
||||
email: email.to_string(),
|
||||
@@ -140,7 +140,7 @@ pub fn load_qobuz_credentials() -> Result<Option<QobuzCredentials>, String> {
|
||||
match entry.get_password() {
|
||||
Ok(json) => {
|
||||
if let Ok(credentials) = serde_json::from_str::<QobuzCredentials>(&json) {
|
||||
log::info!("Successfully loaded credentials from keyring for: {}", credentials.email);
|
||||
log::info!("Successfully loaded credentials from keyring");
|
||||
return Ok(Some(credentials));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user