Files
natiris/admin/auth.py
Arch Agent eb6dcac545 Sync: Autonomy-System, Natural Language Engine, WebUI + .gitignore
- NatirisMaster.py aktualisiert
- NaturalLanguageEngine optimiert
- PsychologyEngine & Arousal-Engine
- WebUI (FastAPI) mit Chat-API
- Bridges: ComfyUI, Ollama, Vision
- Admin-Auth System
- .gitignore hinzugefügt (checkpoints, logs, generated)
2026-03-10 16:04:26 +01:00

32 lines
789 B
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""
Admin Auth Helper verify admin access
Usage: python3 auth.py <passphrase> or NATIRIS_ADMIN_PASS=xxx python3 ...
"""
import json
import os
import sys
PATHS = {
"config": os.path.expanduser("~/natiris/config/admin_config.json"),
}
def check_passphrase(passphrase):
admin_config = {}
try:
with open(PATHS["config"]) as f:
admin_config = json.load(f)
except Exception:
pass
return passphrase == admin_config.get("admin_passphrase", "")
if __name__ == "__main__":
passphrase = sys.argv[1] if len(sys.argv) > 1 else os.environ.get("NATIRIS_ADMIN_PASS", "")
if check_passphrase(passphrase):
print("ADMIN_AUTH:OK")
sys.exit(0)
else:
print("ADMIN_AUTH:FAIL")
sys.exit(1)