git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] t0302: check helper can handle empty credentials

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 30, 2017, 17:20 UTC
Message-ID
<e055913ec27fc3feb3f017747560f454f6817a0b.1509383993.git.johannes.schindelin@gmx.de>
In-Reply-To
<cover.1509383993.git.johannes.schindelin@gmx.de>
From: =?UTF-8?q?Jakub=20Bere=C5=BCa=C5=84ski?= <kuba@berezanscy.pl>

Make sure the helper does not crash when blank username and password is provided. If the helper can save such credentials, it should be able to read them back.

Signed-off-by: Jakub Bereżański <kuba@berezanscy.pl>
---
 t/lib-credential.sh | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff --git a/t/lib-credential.sh b/t/lib-credential.sh
index d8e41f7ddd1..937b831ea67 100755
--- a/t/lib-credential.sh
+++ b/t/lib-credential.sh
@@ -44,6 +44,7 @@ helper_test_clean() {
 	reject $1 https example.com user2
 	reject $1 http path.tld user
 	reject $1 https timeout.tld user
+	reject $1 https sso.tld
 }
 
 reject() {
@@ -250,6 +251,24 @@ helper_test() {
 		password=pass2
 		EOF
 	'
+
+	test_expect_success "helper ($HELPER) can store empty username" '
+		check approve $HELPER <<-\EOF &&
+		protocol=https
+		host=sso.tld
+		username=
+		password=
+		EOF
+		check fill $HELPER <<-\EOF
+		protocol=https
+		host=sso.tld
+		--
+		protocol=https
+		host=sso.tld
+		username=
+		password=
+		EOF
+	'
 }
 
 helper_test_timeout() {
-- 
2.15.0.windows.1
Previous: Johannes SchindelinNext: Jeff King
Message 2 of 5 in “wincred: learn to handle "empty credentials"”
  1. 0/2 wincred: learn to handle "empty credentials"Johannes Schindelin, Oct 30, 2017
  2. 1/2 t0302: check helper can handle empty credentialsJohannes Schindelin, Oct 30, 2017
  3. Jeff KingOct 30, 2017
  4. Johannes SchindelinOct 31, 2017
  5. 2/2 wincred: handle empty username/password correctlyJohannes Schindelin, Oct 30, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.