Compare commits

..

No commits in common. "master" and "fix/boto3-checksum-validation" have entirely different histories.

2 changed files with 11 additions and 20 deletions

View File

@ -24,7 +24,7 @@ class RedisCache:
or file_path.endswith("Packages.gz") or file_path.endswith("Packages.gz")
or file_path.endswith("repomd.xml") or file_path.endswith("repomd.xml")
or "repodata/" in file_path or "repodata/" in file_path
and file_path.endswith((".xml", ".xml.gz", ".xml.bz2", ".xml.xz", ".xml.zck", ".xml.zst")) and file_path.endswith((".xml", ".xml.gz", ".xml.bz2", ".xml.xz"))
) )
def get_index_cache_key(self, remote_name: str, path: str) -> str: def get_index_cache_key(self, remote_name: str, path: str) -> str:

View File

@ -22,25 +22,16 @@ class S3Storage:
self.bucket = bucket self.bucket = bucket
self.secure = secure self.secure = secure
ca_bundle = os.environ.get('REQUESTS_CA_BUNDLE') or os.environ.get('SSL_CERT_FILE') self.client = boto3.client(
config_kwargs = { "s3",
"request_checksum_calculation": "when_required", endpoint_url=f"http{'s' if self.secure else ''}://{self.endpoint}",
"response_checksum_validation": "when_required" aws_access_key_id=self.access_key,
} aws_secret_access_key=self.secret_key,
client_kwargs = { config=Config(
"endpoint_url": f"http{'s' if self.secure else ''}://{self.endpoint}", request_checksum_calculation="when_required",
"aws_access_key_id": self.access_key, response_checksum_validation="when_required"
"aws_secret_access_key": self.secret_key, )
"config": Config(**config_kwargs) )
}
if ca_bundle and os.path.exists(ca_bundle):
client_kwargs["verify"] = ca_bundle
print(f"Debug: Using CA bundle: {ca_bundle}")
else:
print(f"Debug: No CA bundle found. REQUESTS_CA_BUNDLE={os.environ.get('REQUESTS_CA_BUNDLE')}, SSL_CERT_FILE={os.environ.get('SSL_CERT_FILE')}")
self.client = boto3.client("s3", **client_kwargs)
# Try to ensure bucket exists, but don't fail if MinIO isn't ready yet # Try to ensure bucket exists, but don't fail if MinIO isn't ready yet
try: try: