Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion minio/credentials/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import ipaddress
import json
import os
import re
import socket
import sys
import time
Expand Down Expand Up @@ -80,7 +81,12 @@ def _urlopen(
"""Wrapper of urlopen() handles HTTP status code."""
res = http_client.urlopen(method, url, body=body, headers=headers)
if res.status not in [200, 204, 206]:
raise ValueError(f"{url} failed with HTTP status code {res.status}")
safe_url = re.sub(
r"LDAPPassword=([^&]+)", "LDAPPassword=*REDACTED*", url,
)
raise ValueError(
f"{safe_url} failed with HTTP status code {res.status}",
)
return res


Expand Down
Loading