@@ -671,6 +671,7 @@ def test_pickle_tzoffset(self):
671671 def test_remove_password_from_command_line (self ):
672672 username = "fakeuser"
673673 password = "fakepassword1234"
674+ authorization = "Bearer fake-token-1234"
674675 url_with_user_and_pass = "https://{}:{}@fakerepo.example.com/testrepo" .format (username , password )
675676 url_with_user = "https://{}@fakerepo.example.com/testrepo" .format (username )
676677 url_with_pass = "https://:{}@fakerepo.example.com/testrepo" .format (password )
@@ -681,6 +682,7 @@ def test_remove_password_from_command_line(self):
681682 cmd_3 = ["git" , "clone" , "-v" , url_with_pass ]
682683 cmd_4 = ["git" , "clone" , "-v" , url_without_user_or_pass ]
683684 cmd_5 = ["no" , "url" , "in" , "this" , "one" ]
685+ cmd_6 = ["git" , "-c" , "http.extraHeader=Authorization: %s" % authorization , "fetch" ]
684686
685687 redacted_cmd_1 = remove_password_if_present (cmd_1 )
686688 assert username not in " " .join (redacted_cmd_1 )
@@ -700,3 +702,7 @@ def test_remove_password_from_command_line(self):
700702
701703 assert cmd_4 == remove_password_if_present (cmd_4 )
702704 assert cmd_5 == remove_password_if_present (cmd_5 )
705+
706+ redacted_cmd_6 = remove_password_if_present (cmd_6 )
707+ assert authorization not in " " .join (redacted_cmd_6 )
708+ assert "http.extraHeader=Authorization: *****" in redacted_cmd_6
0 commit comments