feat: add cluster management and audit utility scripts
This commit is contained in:
22
scripts/test_authentik_api.py
Normal file
22
scripts/test_authentik_api.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import urllib.request
|
||||
import ssl
|
||||
import json
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
req = urllib.request.Request(
|
||||
"https://authentik.snarfnet.net/api/v3/core/applications/",
|
||||
headers={"Authorization": "Bearer SnarfNetPermanentAutomationToken2026"}
|
||||
)
|
||||
|
||||
try:
|
||||
with urllib.request.urlopen(req, context=ctx, timeout=5) as resp:
|
||||
data = json.loads(resp.read().decode('utf-8'))
|
||||
print("Authentik API status:", resp.status)
|
||||
print("Total applications:", data.get('pagination', {}).get('count'))
|
||||
for app in data.get('results', [])[:5]:
|
||||
print(f" App: {app.get('name')} ({app.get('slug')})")
|
||||
except Exception as e:
|
||||
print("API Error:", e)
|
||||
Reference in New Issue
Block a user