[ 
https://issues.apache.org/jira/browse/FTPSERVER-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633456#action_12633456
 ] 

Andrea Francia commented on FTPSERVER-181:
------------------------------------------

@David
Thanks for the hints about searching in the source code. I done so but I'm not 
still sure about when it should return null.
I can provide a patch with my understanding of the method but I'm not sure that 
my idea is the same that the orginal designer had. 
Maybe there some instruction how to create and submit patches.

In general I think that the documentation of the interfaces (and the interfaces 
API designing) are really a important issues. 
A library become useful when its API is usable. I don't know if this apply to 
yours project.

I'll subscribe the mailling list anyway.

Please put my name (Andrea Francia) but not my email address somewhere in the 
credits if you want to use my contribution.

    /**
     * Authenticate user (or not).
     * This method shall:<ul>
     * <li>return a not null [EMAIL PROTECTED] User} object reference if the
     *     authentication succeeds</li>
     * <li>throws a [EMAIL PROTECTED] AuthenticationFailedException} if the 
authentication
     *     fails</li>
     * </ul>
     *
     * @param authentication could be:<ul>
     * <li>[EMAIL PROTECTED] 
org.apache.ftpserver.usermanager.AnonymousAuthentication}:
     * in the case of anonymous authentication</li>
     * <li>[EMAIL PROTECTED] 
org.apache.ftpserver.usermanager.UsernamePasswordAuthentication}:
     * in the case of a normal authentication</li>
     * </ul>
     *
     * @throws AuthenticationFailedException if the authentications fails (e.g.
     *         wrong password, unexistent username, anonymous authentication
     *         not accepted).
     * @return the authenticated user (must be not null)
     */
    User authenticate(Authentication authentication)
            throws AuthenticationFailedException;


> The UserManager#authenticate() method lacks of documentation
> ------------------------------------------------------------
>
>                 Key: FTPSERVER-181
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-181
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>    Affects Versions: 1.0-M3
>            Reporter: Andrea Francia
>             Fix For: 1.0-M4
>
>
> The UserManager interface documentation should be a form of contract between 
> the implementor and the user of the interface.
> After reading the documentation the implementor still has these question:
>  - when I should throw a AuthenticationFailedException?
>  - when I should return a null as a result?
>  - if the object receive two subsequent calls withe the same arguments the 
> objects returned should be the same (same reference), only equals, or they 
> can be different?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to