INNER CODE UNIT · Python

_load_activation

bunkeriot/BunkerM · backend/app/agent-api/main.py:99

def _load_activation(instance_id: str) -> dict | None:
    """Load and verify stored activation. Returns payload or None."""
    try:
        if ACTIVATION_FILE.exists():
            data = json.loads(ACTIVATION_FILE.read_text())
            return _verify_key(data.get("key", ""), instance_id)
    except Exception:
        pass
    return None


def _store_activation(key: str):
    DATA_DIR.mkdir(parents=True, exist_ok=True)
    ACTIVATION_FILE.write_text(json.dumps({"key": key}))


async def _try_auto_activate(instance_id: str) -> bool:
    """Call BunkerAI Cloud to get a license key. Returns True on success."""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…