This commit is contained in:
Getlles
2026-11-09 23:42:13 +03:00
parent 9a09b38387
commit e1d42e069f
16 changed files with 467 additions and 13 deletions
+11
View File
@@ -0,0 +1,11 @@
import os, sys, urllib.request, urllib.error
BUCKET = os.getenv("S3_BUCKET", "messenger-attachments")
KEY = os.getenv("S3_KEY")
URL = f"http://s3:8333/{BUCKET}/{KEY}"
try:
urllib.request.urlopen(URL)
print("FAIL: object accessible without auth"); sys.exit(1)
except urllib.error.HTTPError as e:
if e.code in (401, 403):
print(f"PASS: anonymous GET -> {e.code}"); sys.exit(0)
print(f"FAIL: unexpected {e.code}"); sys.exit(1)