forked from Unstructured-IO/unstructured
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug CORE-4225: mongodb url bug (Unstructured-IO#2662)
The mongodb redact method was created because we wanted part of the url to be exposed to the user during logging. Thus it did not use the dataclass `enhanced_field(sensitive=True)` solution. This changes it to use our standard redacted solution. This also minimizes the amount of work to be done in platform.
- Loading branch information
1 parent
00a49ea
commit bd26697
Showing
7 changed files
with
15 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.13.0-dev12" # pragma: no cover | ||
__version__ = "0.13.0-dev13" # pragma: no cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
import logging | ||
|
||
from unstructured.ingest.logger import ingest_log_streaming_init, logger | ||
|
||
|
||
def options_redactions(options: dict) -> dict: | ||
# handle any logic needed to redact not already caught by the logging filter | ||
options = options.copy() | ||
if "uri" in options and options["uri"].startswith("mongodb"): | ||
from unstructured.ingest.connector.mongodb import redact | ||
|
||
options["uri"] = redact(options["uri"]) | ||
return options | ||
from unstructured.ingest.logger import ingest_log_streaming_init | ||
|
||
|
||
def log_options(options: dict, verbose=False): | ||
ingest_log_streaming_init(logging.DEBUG if verbose else logging.INFO) | ||
logger.debug(f"options: {options_redactions(options)}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters