ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 46781] New: <input><handler type="secure"/></handler> with impl defined by embedder
Date Fri, 27 Feb 2009 21:58:26 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=46781

           Summary: <input><handler type="secure"/></handler> with impl
                    defined by embedder
           Product: Ant
           Version: 1.7.1
          Platform: All
               URL: http://www.netbeans.org/nonav/issues/show_bug.cgi?id=1
                    55056
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: jglick@netbeans.org


When Ant is run embedded, the container can set a default input handler - there
is a method on Project for this. But it is pretty common for a script to
request SecureInputHandler to read a password. If it does this, the container
no longer has any way to substitute a preferred handler, so java.io.Console is
used whether this makes sense or not.

In the case of the NetBeans IDE (see URL), it would like to pop up a dialog
with a JPasswordField, and you can imagine other GUI embedders (or even CI
servers) wanting to provide their own impls.

Would like to introduce Project.setSecureInputHandler(InputHandler). Since
<input classname="..."> always loads exactly that, should introduce "secure" as
a value for HandlerType. Scripts using this mode would get the handler defined
by the project, SecureInputHandler if not set otherwise.

Old scripts using classname="...SecureInputHandler" would be unaffected; would
be nice to provide the new behavior for these automatically, but that would
mean you could not explicitly request SIH and nothing else. Possible trick:
introduce

public class ConsoleSecureInputHandler extends SecureInputHandler {}

(a no-op override), and treat <handler classname="...SecureInputHandler"/> like
<handler type="secure"/>, with <handler
classname="...ConsoleSecureInputHandler"/> available for scripts which really
do not want this to be overridden by a container.

Should probably have CLI

  -secureinputhandler <class>  the class which will handle secure input
requests

as well, useful for containers which fork Ant rather than embedding in-VM.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message