Create codex/auth.py
Browse files- codex/auth.py +8 -0
codex/auth.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
AUTHORIZED_USERS = set(os.environ.get("AUTHORIZED_USERS", "").split(","))
|
| 4 |
+
|
| 5 |
+
def verify_user(username):
|
| 6 |
+
if username not in AUTHORIZED_USERS:
|
| 7 |
+
raise PermissionError("Unauthorized user")
|
| 8 |
+
return True
|