From bd592bd7ac5f4cdbfa85196d80ff2f7fcaec9080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 8 Jan 2024 12:38:53 +0100 Subject: [PATCH] Fix simplelogin auth (#486) ## Type of change ``` - [x] Bug fix - [ ] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ``` ## Objective Simplelogin was using the bearer Authorization header while it was supposed to use non-standard Authentication --- .../src/tool/generators/username_forwarders/simplelogin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bitwarden/src/tool/generators/username_forwarders/simplelogin.rs b/crates/bitwarden/src/tool/generators/username_forwarders/simplelogin.rs index 3c09fc691..6c4f9dab4 100644 --- a/crates/bitwarden/src/tool/generators/username_forwarders/simplelogin.rs +++ b/crates/bitwarden/src/tool/generators/username_forwarders/simplelogin.rs @@ -31,7 +31,7 @@ async fn generate_with_api_url( let response = http .post(format!("{api_url}/api/alias/random/new{query}")) .header(CONTENT_TYPE, "application/json") - .bearer_auth(api_key) + .header("Authentication", api_key) .json(&Request { note }) .send() .await?; @@ -65,7 +65,7 @@ mod tests { .and(matchers::method("POST")) .and(matchers::query_param("hostname", "example.com")) .and(matchers::header("Content-Type", "application/json")) - .and(matchers::header("Authorization", "Bearer MY_TOKEN")) + .and(matchers::header("Authentication", "MY_TOKEN")) .and(matchers::body_json(json!({ "note": "Website: example.com. Generated by Bitwarden." }))) @@ -78,7 +78,7 @@ mod tests { .and(matchers::method("POST")) .and(matchers::query_param("hostname", "example.com")) .and(matchers::header("Content-Type", "application/json")) - .and(matchers::header("Authorization", "Bearer MY_FAKE_TOKEN")) + .and(matchers::header("Authentication", "MY_FAKE_TOKEN")) .and(matchers::body_json(json!({ "note": "Website: example.com. Generated by Bitwarden." })))