feat: add infrastructure audit and diagnostic helper scripts
This commit is contained in:
21
scripts/test_authentik_flow_api.py
Normal file
21
scripts/test_authentik_flow_api.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import urllib.request
|
||||
import ssl
|
||||
import json
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
url = "https://authentik.snarfnet.net/api/v3/flows/executor/default-authentication-flow/?client_id=H5MRodgRNAMuKv2fXsj3roxfO1f9ImOSRAN2Pi47&redirect_uri=https%3A%2F%2Fpihole1.snarfnet.net%2Foutpost.goauthentik.io%2Fcallback%3FX-authentik-auth-callback%3Dtrue&response_type=code&scope=ak_proxy+openid+entitlements+profile+email"
|
||||
|
||||
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'})
|
||||
try:
|
||||
with urllib.request.urlopen(req, context=ctx, timeout=8) as resp:
|
||||
print("Status code:", resp.status)
|
||||
data = resp.read().decode('utf-8')
|
||||
print("API Response:", data[:500])
|
||||
except urllib.error.HTTPError as e:
|
||||
print(f"HTTP Error {e.code}: {e.read().decode('utf-8')[:500]}")
|
||||
except Exception as e:
|
||||
print("Exception:", e)
|
||||
|
||||
Reference in New Issue
Block a user