diff --git a/api/kiwi_vpn_api/easyrsa.py b/api/kiwi_vpn_api/easyrsa.py index e86e60e..bbdd86d 100644 --- a/api/kiwi_vpn_api/easyrsa.py +++ b/api/kiwi_vpn_api/easyrsa.py @@ -4,6 +4,7 @@ Python interface to EasyRSA CA. from __future__ import annotations +import functools import subprocess from enum import Enum, auto from pathlib import Path @@ -139,6 +140,20 @@ class EasyRSA: None: {}, } + @classmethod + @functools.lru_cache + def _load(cls) -> EasyRSA: + return cls() + + @classmethod + @property + def _(cls) -> EasyRSA: + """ + Get the singleton + """ + + return cls._load() + @property def output_directory(self) -> Path: """