feat: add helper scripts for infrastructure management and troubleshooting
This commit is contained in:
20
scripts/check_authentik_users.py
Normal file
20
scripts/check_authentik_users.py
Normal file
@@ -0,0 +1,20 @@
|
||||
import urllib.request
|
||||
import ssl
|
||||
import json
|
||||
|
||||
ctx = ssl.create_default_context()
|
||||
ctx.check_hostname = False
|
||||
ctx.verify_mode = ssl.CERT_NONE
|
||||
|
||||
token = "SnarfNetPermanentAutomationToken2026"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
|
||||
req = urllib.request.Request("https://authentik.snarfnet.net/api/v3/core/users/?page_size=20", headers=headers)
|
||||
with urllib.request.urlopen(req, context=ctx) as resp:
|
||||
data = json.loads(resp.read().decode())
|
||||
for u in data['results']:
|
||||
print(f"User: {u['username']}, Email: {u.get('email')}, Name: {u.get('name')}")
|
||||
|
||||
Reference in New Issue
Block a user