Re: Password management



Arved Sandstrom wrote:
On Sat, 17 Jan 2009 21:52:58 -0500, Arne Vajhøj wrote:

Arved Sandstrom wrote:
On Sat, 17 Jan 2009 11:53:33 -0800, Patricia Shanahan wrote:
Arne Vajhøj wrote:
Patricia Shanahan wrote:
I want to be able to do some database administration from an
application. The application will contain checks to prevent
dangerous actions. The required password is one I never write down
or store in plain text anywhere.

I've considered using a JDialog to enter it, but the application
does not make any other use of Swing.
If it is not a GUI app and you are on Java 1.6, then
Console.readPassword seems obvious.
Looks like it ought to do the job, so I wrote a test. When I run it
under Eclipse, System.console() returns null :-(
Maybe I'm missing something, but why not JPasswordField?
It would have been better than JDialog.

But it would still be Swing in a non Swing app.

Arne

Yes, I noticed that about 10 seconds after my reply winged its way into the global information maze...

I don't know what interface the application has - Patricia hasn't said, I don't think, other than it doesn't use Swing - so it's difficult to come up with other ideas.

Here's some clarification on that. Primarily, the application reads from
standard input an XML file containing a bunch of parameters, and writes
to standard output an XML file containing a copy of the parameters and a
set of results. In this form, it runs as a batch program in a cygwin
xterm window under control of make.

I do some reading and grepping on the output file, but also have other
programs that do things like taking output files from a series of runs
and writing a .csv summary that I can read into Excel to generate pretty
charts.

I am in the process of adding an option to write very detailed results
into a relational database, using PostgreSQL. This will allow more
analysis, as well as use of the results in a master's degree research
project my adviser wants to start.

The password issue arises when unit testing the database output. As
it is, I have to create the test database using a very privileged
account. I would like to be able to create and destroy test databases
automatically, rather than doing so manually. I do my development and
unit testing in Eclipse.

The program is part of my research project, so I am both the entire
development team and the only user.

Patricia
.



Relevant Pages