<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:56 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>[CSHARP-469] Server cannot connect with password carrying &apos;@&apos; character.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-469</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If the password carries &apos;@&apos; character in the connection string, the connection doesn&apos;t happen and throws error.&lt;/p&gt;

&lt;p&gt;E.g if the password is &apos;somepassword1@&apos; in a connection string, it returns only &apos;somepassword1&apos;. So, this password fails to connect to the database.&lt;/p&gt;


&lt;p&gt;FileName : MongoUrlBuilder.cs &lt;br/&gt;
Git Path: &lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/blob/master/Driver/Core/MongoUrlBuilder.cs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/blob/master/Driver/Core/MongoUrlBuilder.cs&lt;/a&gt;&lt;br/&gt;
Line 438-441 &lt;br/&gt;
           const string pattern =&lt;br/&gt;
                @&quot;^mongodb://&quot; +&lt;br/&gt;
                @&quot;((?&amp;lt;username&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^:&amp;#93;&lt;/span&gt;&lt;ins&gt;)&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;?&amp;lt;password&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^@&amp;#93;&lt;/span&gt;&lt;/ins&gt;)@)?&quot; +&lt;br/&gt;
                @&quot;(?&amp;lt;servers&amp;gt;&quot; + serverPattern + &quot;(,&quot; + serverPattern + &quot;)*)&quot; +&lt;br/&gt;
                @&quot;(/(?&amp;lt;database&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^?&amp;#93;&lt;/span&gt;+)?(&amp;#63;(?&amp;lt;query&amp;gt;.*))?)?$&quot;;&lt;br/&gt;
            Match match = Regex.Match(url, pattern);&lt;/p&gt;


&lt;p&gt;Thanks,&lt;br/&gt;
Prithiraj&lt;/p&gt;</description>
                <environment></environment>
        <key id="38339">CSHARP-469</key>
            <summary>Server cannot connect with password carrying &apos;@&apos; character.</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="prithiraj">Prithiraj Sengupta</reporter>
                        <labels>
                            <label>driver</label>
                            <label>question</label>
                    </labels>
                <created>Thu, 10 May 2012 10:59:06 +0000</created>
                <updated>Fri, 5 Apr 2019 13:58:29 +0000</updated>
                            <resolved>Thu, 10 May 2012 16:51:45 +0000</resolved>
                                    <version>1.4.2</version>
                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="119081" author="craiggwilson" created="Mon, 14 May 2012 13:47:16 +0000"  >&lt;p&gt;Are you still requesting that we change the regular expression?  It was built to parse a valid Uri.  Having 2 &apos;@&apos; characters is not a valid Uri.  There is a simple workaround suggested by Robert above.  Is there some reason you cannot use percent encoding that you haven&apos;t told us?&lt;/p&gt;</comment>
                            <comment id="118877" author="prithiraj" created="Sun, 13 May 2012 07:59:29 +0000"  >&lt;p&gt;Yes, I agree with you. This C# driver is very much advanced, and much thanks to the engineers. It is even much stronger in comparison to the other drivers from documentation and API perspective. One thing I thought to ask, can we use &lt;span class=&quot;error&quot;&gt;&amp;#91;^\n&amp;#93;&lt;/span&gt; instead using &lt;span class=&quot;error&quot;&gt;&amp;#91;^@&amp;#93;&lt;/span&gt;? Will this create any crisis?&lt;/p&gt;</comment>
                            <comment id="118798" author="craiggwilson" created="Sat, 12 May 2012 13:21:15 +0000"  >&lt;p&gt;We can&apos;t stop allowing &quot;all&quot; special characters, as some are important to the parsing of the uri.  The &quot;:&quot; for instance that designates a port can&apos;t be escaped, otherwise the port won&apos;t get picked up.  Uris are extremely simple and the chances that you actually need to escape anything is relatively low.  It would be a shame for us to go and make it difficult.&lt;/p&gt;

&lt;p&gt;Regarding your other question, as it is unrelated to this jira, please use another forum for asking this question.  Jira&apos;s are for bug reports or feature requests.  You can ask your question either at stackoverflow.com or at our google groups(&lt;a href=&quot;https://groups.google.com/forum/?fromgroups#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://groups.google.com/forum/?fromgroups#!forum/mongodb-user&lt;/a&gt;).&lt;/p&gt;</comment>
                            <comment id="118778" author="prithiraj" created="Sat, 12 May 2012 06:21:56 +0000"  >&lt;p&gt;Hello Craig&lt;/p&gt;

&lt;p&gt;Ok, I see. Should we stop allowing all the special characters in direct character format? And only allow those corresponding percent-encoded values.&lt;/p&gt;

&lt;p&gt;And one more thing, I would like to know from the driver developers, how to save Files(mainly images) having size range between few KBs to max 5MB in mondoDB without using GridFS for the storage. Does C# driver provides any special way to save these files- Like automatic assignments of fields which defines files properties -e.g File size, File Type, Extension, File Name, Source File Path, Target File Path, File As Binary? If it does, how its done? E.g Does BSON in mondoDB takes files as Byte[](Byte Arrays) or do we need to encode these further into Base64? I would like to know the best practice which will save the memory, the transaction and the processing time.&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Prithiraj&lt;/p&gt;</comment>
                            <comment id="118567" author="craiggwilson" created="Fri, 11 May 2012 13:28:31 +0000"  >&lt;p&gt;We are using a standard uri format.  Even .NET&apos;s builtin Uri class doesn&apos;t handle @ signs in the password.  &lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;new Uri(&quot;http://blah:p@ssword@localhost:3243/mongodb&quot;);&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Furthermore, it isn&apos;t just @ characters.  Rather, it is any character that would mess with the parsing.  This includes : and /.&lt;/p&gt;</comment>
                            <comment id="118503" author="prithiraj" created="Fri, 11 May 2012 07:04:38 +0000"  >&lt;p&gt;Okay, so this is exception only to &apos;@&apos;. &lt;/p&gt;

&lt;p&gt;It means, this works for all the special characters without percent-encoding except &apos;@&apos; character. So, there is a feeling of abnormality.&lt;/p&gt;

&lt;p&gt;My suggestion would be to either allow all special character without percent-encoding or don&apos;t allow any special characters unless percent-encoded.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Prithiraj&lt;/p&gt;</comment>
                            <comment id="118206" author="rstam" created="Thu, 10 May 2012 16:50:02 +0000"  >&lt;p&gt;A MongoDB connection string is a URI, and you can escape special characters using standard URI escape mechanisms. So if your password is &quot;p@ssword&quot; you would encode &quot;@&quot; as &quot;%40&quot;, like this:&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;var connectionString = &quot;mongodb://username:p%40ssword@localhost/?safe=true&quot;;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;You can find a full explanation of percent encoding for URIs here:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Percent-encoding&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://en.wikipedia.org/wiki/Percent-encoding&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="118149" author="prithiraj" created="Thu, 10 May 2012 14:59:49 +0000"  >&lt;p&gt;I guess replacing with (?&amp;lt;password&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^\n&amp;#93;&lt;/span&gt;+) can be the solution, as no passwords can be created with a newline(\n) as character.&lt;/p&gt;

&lt;p&gt;(?&amp;lt;password&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^\n&amp;#93;&lt;/span&gt;+)&lt;/p&gt;

&lt;p&gt;const string pattern =&lt;br/&gt;
@&quot;^mongodb://&quot; +&lt;br/&gt;
@&quot;((?&amp;lt;username&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^:&amp;#93;&lt;/span&gt;&lt;ins&gt;)&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;?&amp;lt;password&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^\n&amp;#93;&lt;/span&gt;&lt;/ins&gt;)@)?&quot; +&lt;br/&gt;
@&quot;(?&amp;lt;servers&amp;gt;&quot; + serverPattern + &quot;(,&quot; + serverPattern + &quot;)*)&quot; +&lt;br/&gt;
@&quot;(/(?&amp;lt;database&amp;gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;^?&amp;#93;&lt;/span&gt;+)?(?(?&amp;lt;query&amp;gt;.*))?)?$&quot;;&lt;br/&gt;
Match match = Regex.Match(url, pattern);&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Prithiraj&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <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|hrh7jz:</customfieldvalue>

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