OptimalBits / node_acl

Access control lists for node applications
2.62k stars 369 forks source link

Reworking "Bugfix/mongodb unsupported char" (pull request #113) #228

Closed leodutra closed 7 years ago

leodutra commented 7 years ago

Removes unsupported chars from collection names. Introduces a flag (useRawColletionNames) for easy fallback, since it is a breaking change.

Enhances Massot's sanitization by replacing slashes and spaces by underlines, easing reading. Merges the old pull request code with the latest changes from the master branch of this repository, without conflicts.

Please, review.

manast commented 7 years ago

Thanks for the patch. I will review it as soon as I can.

manast commented 7 years ago

I am wondering, is not that when using invalid collection characters, mongodb will complain? if so, in which case would you like to use raw collection names?

leodutra commented 7 years ago

The problem is with mongodump, a common tool the majority of us use. It cannot create dumps with slashes cause of file system restrictions. Is not a bug, but a really bad practice to allow anything.

Please, refer to pull request https://github.com/OptimalBits/node_acl/pull/113 and issue https://github.com/OptimalBits/node_acl/issues/53 for more information.

Raw flag is intended for easy migration and turning feature off if really required.

leodutra commented 7 years ago

Reminding.

If this becomes old, conflicts can happen with newer code changes and it will have to be reworked.

leodutra commented 7 years ago

Review changes done. Test needed. I don't have a test environment on my current machine. Please, test before pulling or wait for my test.

rxjs-space commented 7 years ago

@manast , Hi, the npm package is not updated to include this pr. Still having trouble as #53.