File size: 422 Bytes
fa6e2ea
 
 
29cdc9d
fa6e2ea
 
 
 
 
29cdc9d
fa6e2ea
29cdc9d
1
2
3
4
5
6
7
8
9
10
11
12
13
import os

class SecurityMiddleware:
    def __init__(self):
        # Load from environment — never hardcode
        token = os.environ.get("VITALIS_SUPERUSER_TOKEN")
        self.authorized_tokens = [token] if token else []
        if not token:
            print("[SECURITY] WARNING: VITALIS_SUPERUSER_TOKEN not set in environment")

    def is_authorized(self, token):
        return token in self.authorized_tokens