Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for entering hidden passwords on the command line #29

Open
GoogleCodeExporter opened this issue Apr 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Hi.

Thank you for NConsoler 2.0.

I am using Windows 7 Ultimate x64 SP1.

I'd like to request the ability to specify a required parameter to the target 
function that should be entered on the command line so that the input is hidden.

This is specifically and especially useful when entering in a password on the 
command line.

For example,
[Action]
public static void DoWork(
[Required(Description="username")]
string username,
[Required(Description="password", Secret=true, Prompt="Enter password", 
Masked=false)]
string password)
{
  //implementation
}

And then on the console, the prompt for the password would appear as follows, 
where the entered password is not displayed:

>CommandLine.exe rami
Enter password:


Notice that an additional feature (but lower priority IMHO) would be to 
actually mask the input.  I explicitly set this to false because I don't want 
others to know how many characters my password is, for example.  I'm not 
exactly sure if it would be useful for other things though.  Maybe the Prompt 
attribute parameter could be optional, so that it will display "Enter password" 
if the Description parameter is specified as "password" for example.  But it is 
there to support entering in multiple passwords on the command line for example.

If users want to actually specify the password in an unattended scenario, I 
would also imagine the ability to pass the password to the command line 
application.  In my experience, I've been able to pipe a password to a command 
line application before, but haven't tried piping multiple parameters for 
example.  In this case, it may be best to support hidden inputs by explicitly 
using the OptionalAttribute with an optional "Required=true" attribute 
parameter for example, instead of the RequiredAttribute, or support both 
scenarios, but that may be a little too complex, and so may be left for a 
future version.

Thank you very much.

Original issue reported on code.google.com by [email protected] on 10 Jul 2012 at 1:15

@GoogleCodeExporter
Copy link
Author

Or maybe a new attribute should be implemented such as a HiddenInputAttribute.

Original comment by [email protected] on 10 Jul 2012 at 1:25

@GoogleCodeExporter
Copy link
Author

I would specify Password as an optional parameter and in case if password == 
null ask for secret thing manually. But we will consider including it into the 
project

Original comment by [email protected] on 10 Jul 2012 at 8:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant