Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset username and password options when null #249

Conversation

cordoval
Copy link
Contributor

fixing #243

sent using Gush

unset($v['password']);

return $v;
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it must be a separate ->validate() block, otherwise you will replace the previous conditions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done @stof

@@ -233,6 +233,13 @@ private function addConnectionsSection(ArrayNodeDefinition $rootNode)

return $v;
})
->ifTrue(function($v) { return null === $v['username'] || null === $v['password']; })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was wrong with adding ->ifNull()->thenUnset() to the username and password scalar node definitions? If the user actually provides a username and leaves password null, I think we should send that directly to the driver rather than strip both values.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adapting to it

@cordoval
Copy link
Contributor Author

guys @stof @jmikola travis is giving me the right to pass 👶 may i?

@jmikola jmikola changed the title fix #243 plug validation extra for username and password when nulls Unset username and password options when null May 19, 2014
jmikola added a commit that referenced this pull request May 19, 2014
@jmikola
Copy link
Member

jmikola commented May 19, 2014

Rebased this PR into 6a285e6 and added a unit test in 6d4ea34. Merged both commits in fe55618.

Thanks 👍

@jmikola jmikola closed this May 19, 2014
@jmikola jmikola added this to the 3.0.0 milestone May 19, 2014
@cordoval cordoval deleted the 243-passing-null-values-as-username-password-option-causes-authentication-to-occur-and-fail branch May 19, 2014 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants