[ 
https://issues.apache.org/jira/browse/HIVE-13589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15484590#comment-15484590
 ] 

Vihang Karajgaonkar commented on HIVE-13589:
--------------------------------------------

I think taking care of options at multiple places in Beeline (using CommandLine 
and BeelineOpts) should be changed in the future because it causes confusion 
and more likely to introduce bugs. I guess we should just have one way to 
handle the options in the future.

For this change, though I think you don't need to add the beeline options in 
Options in Beeline.java. All you need is to track whether -p is given or not. 
This can be done easily in the processOption method of the BeeLineParser. That 
way you don't need to add multiple Options in BeeLine.java. This approach is 
also less prone to errors since with your approach every time there is a new 
beelineOpts added, developer will have to add it in Options too which is not 
used in the end.

So my suggestion would be to make password an optional argument option using 
setOptionalArg method in Option class. And then track a boolean in the 
processOption method to see if -p was found in the arguments or not. Now with 
both these flags you have all the information you need to make password 
optional without adding all the other BeelineOpts in the Options (Beeline)

> beeline - support prompt for password with '-u' option
> ------------------------------------------------------
>
>                 Key: HIVE-13589
>                 URL: https://issues.apache.org/jira/browse/HIVE-13589
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>            Reporter: Thejas M Nair
>            Assignee: Ke Jia
>             Fix For: 2.2.0
>
>         Attachments: HIVE-13589.1.patch, HIVE-13589.2.patch, 
> HIVE-13589.3.patch, HIVE-13589.4.patch, HIVE-13589.5.patch, 
> HIVE-13589.6.patch, HIVE-13589.7.patch
>
>
> Specifying connection string using commandline options in beeline is 
> convenient, as it gets saved in shell command history, and it is easy to 
> retrieve it from there.
> However, specifying the password in command prompt is not secure as it gets 
> displayed on screen and saved in the history.
> It should be possible to specify '-p' without an argument to make beeline 
> prompt for password.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to