Skip to content

DATA-1293 - Allowed id attribute in addition to client-uri attribute in MongoDbFactoryParser. #328

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

Closed
wants to merge 2 commits into from

Conversation

vkhoroshko
Copy link
Contributor

Additionally, the previous approach allowed any attribute to be set if write-concern attribute was set. Fixed that also.

…in MongoDbFactoryParser.

Additionally, the previous approach allowed any attribute to be set if write-concern attribute was set. Fixed that also.
@@ -73,7 +74,10 @@ protected AbstractBeanDefinition parseInternal(Element element, ParserContext pa
BeanDefinition mongoUri = getMongoUri(element);

if (mongoUri != null) {
if (element.getAttributes().getLength() >= 2 && !element.hasAttribute("write-concern")) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we rather white-list the allowed attributes?

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.

…of allowed attributes and compare it to total attributes count.
@christophstrobl
Copy link
Member

thanks @vkhoroshko!
Would you (if you haven't done so yet) please sign the Spring CLA form and add your CLA Number as a comment either here or to DATAMONGO-1293. I can then take it from here.

christophstrobl pushed a commit that referenced this pull request Oct 29, 2015
…bute in MongoDbFactoryParser.

We now allow write-concern and id to be configured along with the uri or client-uri attribute of <mongo:db-factory.

Original Pull Request: #328
CLA: 140120150929074128 (Viktor Khoroshko)
christophstrobl added a commit that referenced this pull request Oct 29, 2015
Move configuration parsing error into method actually responsible for reading uri/client-uri attributes.

Original Pull Request: #328
christophstrobl pushed a commit that referenced this pull request Oct 29, 2015
…bute in MongoDbFactoryParser.

We now allow write-concern and id to be configured along with the uri or client-uri attribute of <mongo:db-factory.

Original Pull Request: #328
CLA: 140120150929074128 (Viktor Khoroshko)
christophstrobl added a commit that referenced this pull request Oct 29, 2015
Move configuration parsing error into method actually responsible for reading uri/client-uri attributes.

Original Pull Request: #328
@christophstrobl
Copy link
Member

pushed to master and back ported to 1.8.x (gosling). thanks @vkhoroshko !

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