<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:51:50 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-247] authenticate method declares throw MongoException but doesn&apos;t actually throw it</title>
                <link>https://jira.mongodb.org/browse/JAVA-247</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;The current signature in DB is like&lt;br/&gt;
public boolean authenticate(String username, char[] passwd )  throws MongoException&lt;/p&gt;

&lt;p&gt;however the only things thrown by the method are NPE &amp;amp; IllegalStateException. It is confusing to suppose the failure to authenticate could throw an exception while in fact it only returns a boolean&lt;/p&gt;</description>
                <environment></environment>
        <key id="14141">JAVA-247</key>
            <summary>authenticate method declares throw MongoException but doesn&apos;t actually throw it</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="antoine">Antoine Girbal</assignee>
                                    <reporter username="koen_serry">Koen Serry</reporter>
                        <labels>
                    </labels>
                <created>Mon, 3 Jan 2011 20:08:41 +0000</created>
                <updated>Thu, 17 Mar 2011 19:13:54 +0000</updated>
                            <resolved>Tue, 15 Feb 2011 01:41:42 +0000</resolved>
                                    <version>2.4</version>
                                    <fixVersion>2.5</fixVersion>
                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="23922" author="auto" created="Tue, 15 Feb 2011 01:50:06 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;agirbal&apos;, u&apos;name&apos;: u&apos;agirbal&apos;, u&apos;email&apos;: u&apos;antoine@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-247&quot; title=&quot;authenticate method declares throw MongoException but doesn&amp;#39;t actually throw it&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-247&quot;&gt;&lt;del&gt;JAVA-247&lt;/del&gt;&lt;/a&gt;: additional authenticate method&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/56e7a91ea90f6f0a45f1995b98906df10a089c80&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/56e7a91ea90f6f0a45f1995b98906df10a089c80&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="23921" author="antoine" created="Tue, 15 Feb 2011 01:41:42 +0000"  >&lt;p&gt;agreed with reporter that the existing authenticate() behavior is not consistent with rest of driver.&lt;br/&gt;
In case the authentication returns an error from server, this method just returns false which means caller cannot know the error code and message.&lt;br/&gt;
Added a new method below that will throw a MongoException in case the authentication fails.&lt;/p&gt;

&lt;p&gt;    /**&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Authenticates to db with the given name and password&lt;br/&gt;
     *&lt;/li&gt;
	&lt;li&gt;@param username name of user for this database&lt;/li&gt;
	&lt;li&gt;@param passwd password of user for this database&lt;/li&gt;
	&lt;li&gt;@return the CommandResult from authenticate command&lt;/li&gt;
	&lt;li&gt;@throws MongoException if authentication failed due to invalid user/pass, or other exceptions like I/O&lt;/li&gt;
	&lt;li&gt;@dochub authenticate&lt;br/&gt;
     */&lt;br/&gt;
    public CommandResult authenticateCommand(String username, char[] passwd )&lt;/li&gt;
&lt;/ul&gt;
</comment>
                            <comment id="23130" author="antoine" created="Fri, 4 Feb 2011 20:14:53 +0000"  >&lt;p&gt;it is actually possible that MongoException is thrown in the _doauth() call.&lt;br/&gt;
this happens if it cannot get the auth message from server.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrgiun:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9997</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>