From 20a69e22a2e3a8cf3a8993a72b857188966f1c85 Mon Sep 17 00:00:00 2001 From: Crizant Lai Date: Tue, 3 Nov 2026 17:34:48 +1000 Subject: [PATCH 1/2] feat(desktop): add dedicated authentication fields - Add Basic, Bearer, and API Key fields with password reveal and placement controls - Preserve imported settings and remove Inherit from new authentication choices --- CHANGELOG.md | 6 + crates/desktop/src/app/mod.rs | 8 +- .../render/request_editor/authentication.rs | 196 ++++++++---------- crates/desktop/src/app/tests/editor_state.rs | 101 +++++++++ .../desktop/src/components/controls/input.rs | 36 +++- crates/desktop/src/request_editor.rs | 62 ++++-- 6 files changed, 279 insertions(+), 130 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22e5bafe..07779973 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ Release dates use Australia/Brisbane time (UTC+10). ## [Unreleased] +### Changed + +- Use dedicated Basic, Bearer, and API Key authentication fields, with a password + reveal toggle and Header / Query Params placement selector. Preserve imported + authentication settings while removing unsupported Inherit from new choices. + ## [2.4.1] - 2026-11-03 ### Fixed diff --git a/crates/desktop/src/app/mod.rs b/crates/desktop/src/app/mod.rs index e6338a80..95b6417c 100644 --- a/crates/desktop/src/app/mod.rs +++ b/crates/desktop/src/app/mod.rs @@ -28,10 +28,10 @@ use gpui_kit::{ #[cfg(target_os = "macos")] use gpui_kit::{Menu, MenuItem, OsAction, SystemMenuType}; use probe_core::{ - AuthenticationKind, AuthenticationValue, Body, Environment, EnvironmentVariable, FileReference, - FormField, Header, ItemKind, MultipartPart, MultipartPartKind, MultipartValue, QueryParameter, - RawBodyKind, Request, RequestBody, RequestKey, SecretVariable, Variable, VariableValue, - VariableValueSet, WorkspaceItemRef, add_path_parameter, ensure_path_parameters_from_url, + AuthenticationKind, Body, Environment, EnvironmentVariable, FileReference, FormField, Header, + ItemKind, MultipartPart, MultipartPartKind, MultipartValue, QueryParameter, RawBodyKind, + Request, RequestBody, RequestKey, SecretVariable, Variable, VariableValue, VariableValueSet, + WorkspaceItemRef, add_path_parameter, ensure_path_parameters_from_url, remove_path_parameter_at, rename_path_parameter_at, resolve_environment, }; use probe_http::{ExecutionOptions, HttpError, HttpResponse}; diff --git a/crates/desktop/src/app/render/request_editor/authentication.rs b/crates/desktop/src/app/render/request_editor/authentication.rs index 3111da57..1aadfd63 100644 --- a/crates/desktop/src/app/render/request_editor/authentication.rs +++ b/crates/desktop/src/app/render/request_editor/authentication.rs @@ -15,7 +15,6 @@ impl ProbeApp { .map(|auth| auth_label(&auth.kind)); let choices = [ ("None", None), - ("Inherit", Some(AuthenticationKind::Inherit)), ("Basic", Some(AuthenticationKind::Basic)), ("Bearer", Some(AuthenticationKind::Bearer)), ("API Key", Some(AuthenticationKind::ApiKey)), @@ -46,130 +45,109 @@ impl ProbeApp { .gap(px(theme.metrics.spacing_2)) .child(kind_buttons); if let Some(authentication) = &request.authentication { - for (index, (property_name, value)) in authentication.properties.iter().enumerate() { - let old_name = property_name.clone(); - let name_view = cx.weak_entity(); - let value_name = property_name.clone(); + let fields: &[(&str, &str)] = match authentication.kind { + AuthenticationKind::Basic => &[("username", "Username"), ("password", "Password")], + AuthenticationKind::Bearer => &[("token", "Token")], + AuthenticationKind::ApiKey => &[("key", "Key"), ("value", "Value")], + _ => &[], + }; + for &(property, label) in fields { let value_view = cx.weak_entity(); - let remove_name = property_name.clone(); - let remove_view = cx.weak_entity(); + let value = authentication + .properties + .get(property) + .map(auth_value) + .unwrap_or_default(); editor = editor.child( - components::editor_key_value_row(theme) + div() + .id(property) + .debug_selector(move || format!("authentication-{property}")) + .flex() + .flex_col() + .gap(px(theme.metrics.spacing_1)) + .child(label) .child( - div().flex_1().min_w(px(0.0)).child( - components::variable_text_input( - theme, - ("authentication-property-name", index), - property_name.clone(), - "Property", - self.variable_context(cx), - move |value, _, input_cx| { - let old_name = old_name.clone(); - let _ = name_view.update(input_cx, |view, cx| { - view.edit_request( - key, - |request| { - let Some(authentication) = - request.authentication.as_mut() - else { - return; - }; - if let Some(old_value) = - authentication.properties.remove(&old_name) - { - authentication - .properties - .insert(value.to_string(), old_value); - } - }, - cx, - ); - }); - }, - ) - .list_scroll(list_scroll), - ), - ) + components::variable_text_input( + theme, + SharedString::from(format!("authentication-{key:?}-{property}")), + value, + label, + self.variable_context(cx), + move |value, _, input_cx| { + let _ = value_view.update(input_cx, |view, cx| { + view.edit_request( + key, + |request| { + set_auth_property( + request, + property.to_owned(), + value.to_string(), + ) + }, + cx, + ); + }); + }, + ) + .password(property == "password") + .list_scroll(list_scroll), + ), + ); + } + if authentication.kind == AuthenticationKind::ApiKey { + let placement = authentication.properties.get("placement").map(auth_value); + let mut options = vec![ + ("header".to_owned(), "Header".to_owned()), + ("query".to_owned(), "Query Params".to_owned()), + ]; + if let Some(value) = &placement + && !matches!(value.as_str(), "header" | "query") + { + options.push((value.clone(), value.clone())); + } + let placement_view = cx.weak_entity(); + editor = editor.child( + div() + .flex() + .flex_col() + .gap(px(theme.metrics.spacing_1)) + .child("Add to") .child( - div().flex_1().min_w(px(0.0)).child( - components::variable_text_input( - theme, - ("authentication-property-value", index), - auth_value(value), - "Value", - self.variable_context(cx), - move |value, _, input_cx| { - let value_name = value_name.clone(); - let _ = value_view.update(input_cx, |view, cx| { + components::dropdown( + theme, + "authentication-placement", + "Add to", + placement, + options, + 180.0, + move |placement, _, cx| { + if let Some(placement) = placement { + let _ = placement_view.update(cx, |view, cx| { view.edit_request( key, |request| { set_auth_property( request, - value_name, - value.to_string(), + "placement".to_owned(), + placement.clone(), ) }, cx, ); }); - }, - ) - .list_scroll(list_scroll), - ), - ) - .child(components::remove_row_button( - theme, - ("remove-authentication-property", index), - "Remove authentication property", - move |_, window, cx| { - let remove_name = remove_name.clone(); - let _ = remove_view.update(cx, |view, cx| { - view.edit_request( - key, - |request| { - if let Some(authentication) = - request.authentication.as_mut() - { - authentication.properties.remove(&remove_name); - } - }, - cx, - ); - view.focus_handle.focus(window, cx); - }); - }, - )), + } + }, + ) + .placeholder("Not set"), + ), ); } - let add_view = cx.weak_entity(); - editor = editor.child(components::editor_add_button( - theme, - "add-authentication-property", - "Add property", - move |_, _, cx| { - let _ = add_view.update(cx, |view, cx| { - view.edit_request( - key, - |request| { - let Some(authentication) = request.authentication.as_mut() else { - return; - }; - let mut index = authentication.properties.len() + 1; - let mut name = "property".to_owned(); - while authentication.properties.contains_key(&name) { - name = format!("property{index}"); - index += 1; - } - authentication - .properties - .insert(name, AuthenticationValue::String(String::new())); - }, - cx, - ); - }); - }, - )); + if fields.is_empty() { + editor = editor.child(div().text_color(theme.colors.text.muted).child(format!( + "{} authentication is not supported for execution. Imported configuration is preserved.", + auth_label(&authentication.kind), + ))); + } } else { editor = editor.child( div() diff --git a/crates/desktop/src/app/tests/editor_state.rs b/crates/desktop/src/app/tests/editor_state.rs index 8ca209eb..42c721d7 100644 --- a/crates/desktop/src/app/tests/editor_state.rs +++ b/crates/desktop/src/app/tests/editor_state.rs @@ -448,3 +448,104 @@ fn websocket_variant_reload_resets_message_undo_but_keeps_composer(cx: &mut Test }) .unwrap(); } + +#[gpui_kit::test] +fn authentication_fields_map_edits_and_preserve_imported_properties(cx: &mut TestAppContext) { + use crate::request_editor::set_authentication; + use probe_core::{AuthenticationKind, AuthenticationValue as Value}; + + let (window, [http, _, _]) = editor_workspace(cx); + window + .update(cx, |view, _, cx| { + view.select_request(http, cx); + view.request_editor + .set_section(http, EditorSection::Authentication); + cx.notify(); + }) + .unwrap(); + let imported = Value::Object(BTreeMap::from([( + "nested".to_owned(), + Value::Sequence(vec![Value::Boolean(true)]), + )])); + for (kind, fields) in [ + (AuthenticationKind::Basic, vec!["username", "password"]), + (AuthenticationKind::Bearer, vec!["token"]), + (AuthenticationKind::ApiKey, vec!["key", "value"]), + ] { + window + .update(cx, |view, _, cx| { + view.edit_request( + http, + |request| { + set_authentication(request, Some(kind.clone())); + request + .authentication + .as_mut() + .unwrap() + .properties + .insert("unsupported".to_owned(), imported.clone()); + }, + cx, + ); + }) + .unwrap(); + cx.run_until_parked(); + for field in &fields { + let mut visual = VisualTestContext::from_window(window.into(), cx); + let bounds = visual + .debug_bounds(match *field { + "username" => "authentication-username", + "password" => "authentication-password", + "token" => "authentication-token", + "key" => "authentication-key", + "value" => "authentication-value", + _ => unreachable!(), + }) + .unwrap(); + visual.simulate_click( + point(bounds.center().x, bounds.bottom() - px(12.0)), + Modifiers::default(), + ); + cx.simulate_input(window.into(), &format!("{{{{{field}}}}}")); + cx.run_until_parked(); + } + if kind == AuthenticationKind::ApiKey { + let mut visual = VisualTestContext::from_window(window.into(), cx); + let trigger = visual + .debug_bounds("authentication-placement-trigger") + .unwrap(); + visual.simulate_click(trigger.center(), Modifiers::default()); + cx.simulate_keystrokes(window.into(), "down enter"); + cx.run_until_parked(); + } + window + .update(cx, |view, _, cx| { + let auth = view + .active_request() + .unwrap() + .authentication + .as_ref() + .unwrap(); + for field in &fields { + assert_eq!( + auth.properties[*field], + Value::String(format!("{{{{{field}}}}}")) + ); + } + assert_eq!(auth.properties["unsupported"], imported); + if kind == AuthenticationKind::ApiKey { + assert_eq!( + auth.properties["placement"], + Value::String("query".to_owned()) + ); + } + let before = auth.clone(); + view.edit_request(http, |request| set_authentication(request, Some(kind)), cx); + assert_eq!( + view.active_request().unwrap().authentication.as_ref(), + Some(&before) + ); + }) + .unwrap(); + } +} diff --git a/crates/desktop/src/components/controls/input.rs b/crates/desktop/src/components/controls/input.rs index fa49001d..f8b65d81 100644 --- a/crates/desktop/src/components/controls/input.rs +++ b/crates/desktop/src/components/controls/input.rs @@ -182,6 +182,7 @@ pub(crate) struct ProbeTextInput { pub(in crate::components) autofocus: bool, pub(in crate::components) readonly: bool, disabled: bool, + password: bool, persistent_field: Option>, on_field_focus: Option, pub(in crate::components) shared_input: Option>, @@ -201,8 +202,6 @@ impl RenderOnce for ProbeTextInput { cx, |_, _| TextContextMenuState::default(), ); - let overlay_paints_text = self.variable_overlay - && !input_variable_ranges(&self.value, self.highlight_path_variables).is_empty(); let placeholder = self.placeholder.clone(); let on_change = self.on_change.clone(); let on_enter = self.on_enter.clone(); @@ -212,8 +211,9 @@ impl RenderOnce for ProbeTextInput { let field = self.persistent_field.clone().unwrap_or_else(|| { window.use_keyed_state(self.id.clone(), cx, |window, cx| { let state = cx.new(|cx| { - let mut state = - InputState::new(window, cx).placeholder(placeholder.clone()); + let mut state = InputState::new(window, cx) + .placeholder(placeholder.clone()) + .masked(self.password); state.set_editor_style(editor_paint_style(self.theme)); state }); @@ -270,6 +270,10 @@ impl RenderOnce for ProbeTextInput { ) }, ); + let masked = state.read(cx).presentation().is_masked(); + let variable_overlay = self.variable_overlay && !masked; + let overlay_paints_text = variable_overlay + && !input_variable_ranges(&self.value, self.highlight_path_variables).is_empty(); let placeholder_changed = applied_placeholder.update(cx, |applied, cx| { if applied.0 != state.entity_id() { *applied = ( @@ -381,7 +385,23 @@ impl RenderOnce for ProbeTextInput { }) .when_some(self.leading_icon, |input, icon| input.child(icon)) .child(Input::new(&state)); - let input = if self.variable_overlay { + let input = input.when(self.password, |input| { + let state = state.clone(); + input.child(super::super::icon_button( + theme, + text_context_menu_id(&component_id, "reveal-password"), + if masked { + "Show password" + } else { + "Hide password" + }, + super::super::eye_icon(theme, !masked), + move |_, window, cx| { + state.update(cx, |input, cx| input.toggle_masked(window, cx)); + }, + )) + }); + let input = if variable_overlay { variable_input_overlay( self.theme, state.clone(), @@ -437,6 +457,7 @@ pub(in crate::components) fn text_input_base( autofocus: false, readonly: false, disabled: false, + password: false, shared_input: None, persistent_field: None, on_field_focus: None, @@ -845,6 +866,11 @@ pub(crate) fn dialog_text_input( } impl ProbeTextInput { + pub(crate) fn password(mut self, password: bool) -> Self { + self.password = password; + self + } + pub(crate) fn muted(mut self, muted: bool) -> Self { if muted { self.theme.colors.text.primary = self.theme.colors.text.muted; diff --git a/crates/desktop/src/request_editor.rs b/crates/desktop/src/request_editor.rs index 4d089039..25a6903c 100644 --- a/crates/desktop/src/request_editor.rs +++ b/crates/desktop/src/request_editor.rs @@ -632,9 +632,23 @@ pub(crate) fn set_authentication(request: &mut Request, kind: Option &[("username", ""), ("password", "")], + AuthenticationKind::Bearer => &[("token", "")], + AuthenticationKind::ApiKey => &[("key", ""), ("value", ""), ("placement", "header")], + _ => &[], + }; + let properties = fields + .iter() + .map(|(name, value)| { + ( + (*name).to_owned(), + AuthenticationValue::String((*value).to_owned()), + ) + }) + .collect(); + Authentication { kind, properties } }); } @@ -778,18 +792,42 @@ mod tests { } #[test] - fn authentication_edits_update_the_request_immediately() { + fn authentication_defaults_apply_only_when_switching_types() { + use probe_core::AuthenticationValue::String as Text; + let mut request = Request::default(); - set_authentication(&mut request, Some(AuthenticationKind::Bearer)); - set_auth_property(&mut request, "token".to_owned(), "secret".to_owned()); - let authentication = request.authentication.unwrap(); - assert_eq!(authentication.kind, AuthenticationKind::Bearer); + set_authentication(&mut request, Some(AuthenticationKind::ApiKey)); assert_eq!( - authentication.properties.get("token"), - Some(&probe_core::AuthenticationValue::String( - "secret".to_owned() - )) + request.authentication.as_ref().unwrap().properties, + BTreeMap::from([ + ("key".to_owned(), Text(String::new())), + ("value".to_owned(), Text(String::new())), + ("placement".to_owned(), Text("header".to_owned())) + ]) ); + set_auth_property(&mut request, "placement".to_owned(), "query".to_owned()); + set_authentication(&mut request, Some(AuthenticationKind::ApiKey)); + assert_eq!( + request.authentication.as_ref().unwrap().properties["placement"], + Text("query".to_owned()) + ); + set_authentication(&mut request, Some(AuthenticationKind::Basic)); + assert_eq!( + request.authentication.as_ref().unwrap().properties, + BTreeMap::from([ + ("username".to_owned(), Text(String::new())), + ("password".to_owned(), Text(String::new())) + ]) + ); + set_authentication(&mut request, None); + assert!(request.authentication.is_none()); + // Existing configurations without placement must not acquire a default. + request.authentication = Some(probe_core::Authentication { + kind: AuthenticationKind::ApiKey, + properties: BTreeMap::new(), + }); + set_authentication(&mut request, Some(AuthenticationKind::ApiKey)); + assert!(request.authentication.unwrap().properties.is_empty()); } #[test] From 971eb726edc14ba5d4b5368eda116486966dda83 Mon Sep 17 00:00:00 2001 From: Crizant Lai Date: Tue, 3 Nov 2026 17:48:45 +1000 Subject: [PATCH 2/2] fix(desktop): keep unconfigured authentication credentials unset --- .../render/request_editor/authentication.rs | 19 +++-- .../desktop/src/components/controls/input.rs | 69 +++++++++++++++++++ crates/desktop/src/request_editor.rs | 46 +++++++++---- 3 files changed, 116 insertions(+), 18 deletions(-) diff --git a/crates/desktop/src/app/render/request_editor/authentication.rs b/crates/desktop/src/app/render/request_editor/authentication.rs index 1aadfd63..4456269c 100644 --- a/crates/desktop/src/app/render/request_editor/authentication.rs +++ b/crates/desktop/src/app/render/request_editor/authentication.rs @@ -39,11 +39,18 @@ impl ProbeApp { )); } - let mut editor = div() + let editor = div() .flex() .flex_col() .gap(px(theme.metrics.spacing_2)) .child(kind_buttons); + let mut form = div() + .flex() + .flex_col() + .w_full() + .max_w(px(560.0 + 2.0 * theme.metrics.spacing_2)) + .px(px(theme.metrics.spacing_2)) + .gap(px(theme.metrics.spacing_2)); if let Some(authentication) = &request.authentication { let fields: &[(&str, &str)] = match authentication.kind { AuthenticationKind::Basic => &[("username", "Username"), ("password", "Password")], @@ -58,7 +65,7 @@ impl ProbeApp { .get(property) .map(auth_value) .unwrap_or_default(); - editor = editor.child( + form = form.child( div() .id(property) .debug_selector(move || format!("authentication-{property}")) @@ -106,7 +113,7 @@ impl ProbeApp { options.push((value.clone(), value.clone())); } let placement_view = cx.weak_entity(); - editor = editor.child( + form = form.child( div() .flex() .flex_col() @@ -143,18 +150,18 @@ impl ProbeApp { ); } if fields.is_empty() { - editor = editor.child(div().text_color(theme.colors.text.muted).child(format!( + form = form.child(div().text_color(theme.colors.text.muted).child(format!( "{} authentication is not supported for execution. Imported configuration is preserved.", auth_label(&authentication.kind), ))); } } else { - editor = editor.child( + form = form.child( div() .text_color(theme.colors.text.muted) .child("This request does not use authentication."), ); } - editor.into_any_element() + editor.child(form).into_any_element() } } diff --git a/crates/desktop/src/components/controls/input.rs b/crates/desktop/src/components/controls/input.rs index f8b65d81..1dfd11fa 100644 --- a/crates/desktop/src/components/controls/input.rs +++ b/crates/desktop/src/components/controls/input.rs @@ -934,6 +934,75 @@ mod tests { use gpui_kit::{TouchPhase, px}; use std::time::{Duration, Instant}; + struct PasswordHarness { + request: usize, + scroll: super::ListScroll, + } + + impl gpui_kit::Render for PasswordHarness { + fn render( + &mut self, + _: &mut gpui_kit::Window, + cx: &mut gpui_kit::Context, + ) -> impl gpui_kit::IntoElement { + use gpui_kit::ParentElement as _; + self.scroll.update(cx, |scroll, _| scroll.fields.clear()); + gpui_kit::div().child( + super::variable_text_input( + crate::theme::Theme::light(), + ("password", self.request), + "{{password}}", + "Password", + Default::default(), + |_, _, _| {}, + ) + .password(true) + .list_scroll(Some(&self.scroll)), + ) + } + } + + #[gpui_kit::test] + fn password_reveal_preserves_value_and_remounts_masked(cx: &mut gpui_kit::TestAppContext) { + use crate::theme::Theme; + use gpui_kit::{AppContext as _, Modifiers, VisualTestContext, size}; + + cx.update(Theme::init); + let window = cx.open_window(size(px(400.0), px(180.0)), |_, cx| PasswordHarness { + request: 0, + scroll: cx.new(|_| super::ListScrollState::default()), + }); + cx.run_until_parked(); + let check = |cx: &mut gpui_kit::TestAppContext, masked| { + window + .read_with(cx, |view, cx| { + let scroll = view.scroll.read(cx); + let input = scroll.fields[0].read(cx); + assert_eq!(input.presentation().is_masked(), masked); + assert_eq!(input.value().as_ref(), "{{password}}"); + }) + .unwrap(); + }; + check(cx, true); + for masked in [false, true, false] { + let mut visual = VisualTestContext::from_window(window.into(), cx); + let toggle = visual.debug_bounds("password-0-reveal-password").unwrap(); + visual.simulate_click(toggle.center(), Modifiers::default()); + cx.run_until_parked(); + check(cx, masked); + } + for request in [1, 0] { + window + .update(cx, |view, _, cx| { + view.request = request; + cx.notify(); + }) + .unwrap(); + cx.run_until_parked(); + check(cx, true); + } + } + fn sample( at: Instant, phase: TouchPhase, diff --git a/crates/desktop/src/request_editor.rs b/crates/desktop/src/request_editor.rs index 25a6903c..bd532502 100644 --- a/crates/desktop/src/request_editor.rs +++ b/crates/desktop/src/request_editor.rs @@ -634,9 +634,8 @@ pub(crate) fn set_authentication(request: &mut Request, kind: Option &[("username", ""), ("password", "")], - AuthenticationKind::Bearer => &[("token", "")], - AuthenticationKind::ApiKey => &[("key", ""), ("value", ""), ("placement", "header")], + AuthenticationKind::Basic => &[("password", "")], + AuthenticationKind::ApiKey => &[("placement", "header")], _ => &[], }; let properties = fields @@ -799,11 +798,7 @@ mod tests { set_authentication(&mut request, Some(AuthenticationKind::ApiKey)); assert_eq!( request.authentication.as_ref().unwrap().properties, - BTreeMap::from([ - ("key".to_owned(), Text(String::new())), - ("value".to_owned(), Text(String::new())), - ("placement".to_owned(), Text("header".to_owned())) - ]) + BTreeMap::from([("placement".to_owned(), Text("header".to_owned()))]) ); set_auth_property(&mut request, "placement".to_owned(), "query".to_owned()); set_authentication(&mut request, Some(AuthenticationKind::ApiKey)); @@ -814,10 +809,7 @@ mod tests { set_authentication(&mut request, Some(AuthenticationKind::Basic)); assert_eq!( request.authentication.as_ref().unwrap().properties, - BTreeMap::from([ - ("username".to_owned(), Text(String::new())), - ("password".to_owned(), Text(String::new())) - ]) + BTreeMap::from([("password".to_owned(), Text(String::new()))]) ); set_authentication(&mut request, None); assert!(request.authentication.is_none()); @@ -830,6 +822,36 @@ mod tests { assert!(request.authentication.unwrap().properties.is_empty()); } + #[test] + fn untouched_authentication_is_rejected_but_basic_allows_an_empty_password() { + use probe_http::{ExecutionOptions, HttpEngine, HttpError}; + + let engine = HttpEngine::new().unwrap(); + let options = ExecutionOptions::default(); + let mut request = Request { + method: Some("GET".to_owned()), + url: Some("https://example.com".to_owned()), + ..Request::default() + }; + for (kind, scheme, property) in [ + (AuthenticationKind::Basic, "basic", "username"), + (AuthenticationKind::Bearer, "bearer", "token"), + ] { + set_authentication(&mut request, Some(kind)); + assert!(matches!( + engine.curl_command(&request.clone().into_http().unwrap(), &options), + Err(HttpError::MissingAuthenticationProperty { scheme: actual_scheme, property: actual_property }) + if actual_scheme == scheme && actual_property == property + )); + } + set_authentication(&mut request, Some(AuthenticationKind::Basic)); + set_auth_property(&mut request, "username".to_owned(), "alice".to_owned()); + let command = engine + .curl_command(&request.into_http().unwrap(), &options) + .unwrap(); + assert!(command.contains("--user 'alice:'")); + } + #[test] fn structured_body_modes_are_created_without_replacing_the_active_mode() { let mut request = Request::default();