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

Re: [PATCHv3 5/5] git-send-email: use git credential to obtain password

From
Jeff King <peff@peff.net>
Date
Feb 11, 2013, 17:01 UTC
Message-ID
<20130211170134.GE16402@sigill.intra.peff.net>
In-Reply-To
<fd7997960cad569d57f5330f2416f702db414169.1360599712.git.mina86@mina86.com>
On Mon, Feb 11, 2013 at 05:23:39PM +0100, Michal Nazarewicz wrote:
Show 14 quoted lines
> +	# TODO: Authentication may fail not because credentials were
> +	# invalid but due to other reasons, in which we should not
> +	# reject credentials.
> +	$auth = Git::credential({
> +		'protocol' => 'smtp',
> +		'host' => join(':', $smtp_server, $smtp_server_port),
> +		'username' => $smtp_authuser,
> +		# if there's no password, "git credential fill" will
> +		# give us one, otherwise it'll just pass this one.
> +		'password' => $smtp_authpass
> +	}, sub {
> +		my $cred = shift;
> +		return !!$smtp->auth($cred->{'username'}, $cred->{'password'});
> +	});
What do we want to do about this TODO?

I am happy to put it off until it becomes a problem, but I wonder if the Git::credential() interface is sufficient to express what we would want. It only allows two return values: true for approve, false for reject. But we would want a tri-state: approve, reject, indeterminate.

Reading the Net::SMTP code, it doesn't look like the information is even available to us (it really just passes out success or failure), so I don't think we can even make it work now. But it may be better to prepare the public Git::credential interface for it now, so we do not have to deal with breaking compatibility later.

-Peff
Previous: Michal NazarewiczNext: Michal Nazarewicz
Message 10 of 16 in “[PATCHv3 0/5] Add git-credential support to git-send-email”
  1. Michal NazarewiczFeb 11, 2013
  2. 1/5 Git.pm: allow command_close_bidi_pipe to be called as methodMichal Nazarewicz, Feb 11, 2013
  3. 2/5 Git.pm: fix example in command_close_bidi_pipe documentationMichal Nazarewicz, Feb 11, 2013
  4. 3/5 Git.pm: allow pipes to be closed prior to calling command_close_bidi_pipeMichal Nazarewicz, Feb 11, 2013
  5. 4/5 Git.pm: add interface for git credential commandMichal Nazarewicz, Feb 11, 2013
  6. Jeff KingFeb 11, 2013
  7. Michal NazarewiczFeb 11, 2013
  8. Jeff KingFeb 11, 2013
  9. 5/5 git-send-email: use git credential to obtain passwordMichal Nazarewicz, Feb 11, 2013
  10. Jeff KingFeb 11, 2013
  11. Michal NazarewiczFeb 11, 2013
  12. Jeff KingFeb 11, 2013
  13. Jeff KingFeb 11, 2013
  14. Michal NazarewiczFeb 11, 2013
  15. Jeff KingFeb 11, 2013
  16. Michal NazarewiczFeb 11, 2013

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.