Re: [Http-webtest-general] auth problem
Brought to you by:
m_ilya,
richardanderson
From: Ilya M. <il...@ip...> - 2003-03-18 18:25:34
|
>>>>> "W" == wsheldah <wsh...@le...> writes: W> Hi, I recently upgraded HTTP::WebTest, and immediately ran into a problem W> with how the auth parameter is handled. I've been specifying my tests with W> a .wt script file, and until now have been able to specify only the W> username in the file, like so: W> auth = ( myname ) W> When I ran the test, it would prompt me to enter my password, to enter it W> again for confirmation, and then run the tests as that user and password. W> The latest version of HTTP::WebTest fails, apparently insisting that I W> store my network password in plaintext in the test file. W> Since this is unacceptable from a security standpoint, it looks like I'm W> forced to switch to putting all the tests into the perl script itself. That W> way I can still prompt for the password and pass the username and password W> as part of the parameters. While I'm glad this option is available, it W> would be nice to have the old behaviour back. Even better would be to W> specify auth = () (or whatever is most intuitive) and have it prompt for W> both username and password. This feature was lost in 1.xx -> 2.xx rewrite by accident. Guess it was not that widely used as it is first bug report about it :) Simpliest workaround is using a new HTTP::WebTest feature which allows evaluation of Perl expressions in wtscript files. You can write for example: test_name = Auth auth = ( "$ENV{USERNAME}" "$ENV{PASSWORD}" ) } url = ..... end_test in this case you'll have to pass username/password as environment variables. Or something like test_name = Auth auth = { print STDOUT "Username: "; my $username = <STDIN>; print STDOUT "Password: "; my $password = <STDIN>; chomp($username, $password); return [ ($username, $password) ]; } url = ..... end_test This will emulate old behavior - i.e. ask for username and password interactively. -- Ilya Martynov, il...@ip... CTO IPonWEB (UK) Ltd Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net Personal website - http://martynov.org |