Re: [JGIT RFC PATCH] Add a stdio prompt for SSH connection information.
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Jun 22, 2008, 23:13 UTC
- Message-ID
- <20080622231355.GH11793@spearce.org>
- In-Reply-To
- <200806222306.25434.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 7 quoted lines
> Starting a command line utility like jgit and getting a graphical prompt is almost > an insult. The problem here is that Java 5, which we support, does not have a > portable way of disabling echoing of characters. Java 6 (and anythung newr) > does. There are several solutions involving non-portable tricks. Should we > support an insecure practice of echoing passwords, or as I do here, only support > it if one is using Java 6. A downside of supporting it at all is that one needs a > JavaSE 6 compiler to build the thing.
We really shouldn't support insecure entry of the password. But I'm also not ready to give up on Java 5 support either. I wonder if we shouldn't hide the console reading/writing into a class in our util package and use reflection to access it, like we do for the executable flag of java.io.File.
> btw, does anyone know if console() yields null when runnings as a Windows > service? I tentatively assume that it does without explicily setting the headless > property.
I think that services on Windows have no console, and also can't talk to the desktop UI, so its both headless and without a console.
> I'm also a little unsure about how to invoke the promptKeyboardInteractive method.
I think you implemented this method correctly. Its a confusing API, but it does seem to make sense.
-- Shawn.