mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-22 16:37:33 +00:00

MongoDB connector: Issue: [MongoDB documentation](https://www.mongodb.com/docs/manual/reference/connection-string/) states that characters `$ : / ? # [ ] @` must be percent encoded. URI with password containing such special character will not be redacted. Fix: This fix removes usage of `unquote_plus` on password which allows detected password to match with one inside URI and successfully replace it. Git connector: Added very basic unit tests for repository filtering methods. Their impact is rather minimal but showcases current limitation in `is_file_type_supported` method.
17 lines
539 B
Python
17 lines
539 B
Python
from unstructured.ingest.cli.common import options_redactions
|
|
|
|
|
|
def test_options_redactions():
|
|
given_options = {
|
|
"uri": "mongodb+srv://myDatabaseUser:D1fficultP%40ssw0rd@mongodb0.example.com/"
|
|
"?authSource=admin&replicaSet=myRepl"
|
|
}
|
|
|
|
when_options = options_redactions(options=given_options)
|
|
|
|
assert given_options["uri"] != when_options["uri"]
|
|
assert (
|
|
when_options["uri"] == "mongodb+srv://myDatabaseUser:***REDACTED***@mongodb0.example.com/"
|
|
"?authSource=admin&replicaSet=myRepl"
|
|
)
|