From 1809128b40a563d958ef0ce5ec923ed0bdbe3bf3 Mon Sep 17 00:00:00 2001 From: Vignesh Rao Date: Sun, 18 Aug 2024 20:48:14 -0500 Subject: [PATCH] Rename directory structure --- decryptor.py | 4 ++-- encryptor.py | 4 ++-- pyvault/__init__.py | 3 --- vaultapi/__init__.py | 3 +++ {pyvault => vaultapi}/auth.py | 2 +- {pyvault => vaultapi}/exceptions.py | 0 {pyvault => vaultapi}/main.py | 8 ++++---- {pyvault => vaultapi}/models.py | 0 {pyvault => vaultapi}/rate_limit.py | 2 +- {pyvault => vaultapi}/routers.py | 2 +- {pyvault => vaultapi}/squire.py | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 pyvault/__init__.py create mode 100644 vaultapi/__init__.py rename {pyvault => vaultapi}/auth.py (97%) rename {pyvault => vaultapi}/exceptions.py (100%) rename {pyvault => vaultapi}/main.py (92%) rename {pyvault => vaultapi}/models.py (100%) rename {pyvault => vaultapi}/rate_limit.py (98%) rename {pyvault => vaultapi}/routers.py (97%) rename {pyvault => vaultapi}/squire.py (97%) diff --git a/decryptor.py b/decryptor.py index 7c5d422..055436f 100644 --- a/decryptor.py +++ b/decryptor.py @@ -1,8 +1,8 @@ import requests from cryptography.fernet import Fernet -from pyvault.models import session -from pyvault.squire import load_env +from vaultapi.models import session +from vaultapi.squire import load_env env = load_env() session.fernet = Fernet(env.secret) diff --git a/encryptor.py b/encryptor.py index 61374ea..2417cee 100644 --- a/encryptor.py +++ b/encryptor.py @@ -1,4 +1,4 @@ -import pyvault +import vaultapi if __name__ == "__main__": - pyvault.start() + vaultapi.start() diff --git a/pyvault/__init__.py b/pyvault/__init__.py deleted file mode 100644 index f1265d2..0000000 --- a/pyvault/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -from pyvault.main import start # noqa: F401 - -version = "0.0.0" diff --git a/vaultapi/__init__.py b/vaultapi/__init__.py new file mode 100644 index 0000000..912f9f6 --- /dev/null +++ b/vaultapi/__init__.py @@ -0,0 +1,3 @@ +from vaultapi.main import start # noqa: F401 + +version = "0.0.0" diff --git a/pyvault/auth.py b/vaultapi/auth.py similarity index 97% rename from pyvault/auth.py rename to vaultapi/auth.py index 0f7c4f2..04400f8 100644 --- a/pyvault/auth.py +++ b/vaultapi/auth.py @@ -6,7 +6,7 @@ from fastapi import Request from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer -from pyvault import exceptions, models +from vaultapi import exceptions, models LOGGER = logging.getLogger("uvicorn.default") EPOCH = lambda: int(time.time()) # noqa: E731 diff --git a/pyvault/exceptions.py b/vaultapi/exceptions.py similarity index 100% rename from pyvault/exceptions.py rename to vaultapi/exceptions.py diff --git a/pyvault/main.py b/vaultapi/main.py similarity index 92% rename from pyvault/main.py rename to vaultapi/main.py index d5abf46..0202498 100644 --- a/pyvault/main.py +++ b/vaultapi/main.py @@ -4,8 +4,8 @@ from cryptography.fernet import Fernet from fastapi import FastAPI -import pyvault -from pyvault import models, routers, squire +import vaultapi +from vaultapi import models, routers, squire LOGGER = logging.getLogger("uvicorn.default") @@ -29,9 +29,9 @@ def start(**kwargs) -> None: models.session.fernet = Fernet(models.env.secret) app = FastAPI( routes=routers.get_all_routes(), - title="PyVault", + title="vaultapi", description="Lightweight service to serve secrets and environment variables", - version=pyvault.version, + version=vaultapi.version, ) kwargs = dict( host=models.env.host, diff --git a/pyvault/models.py b/vaultapi/models.py similarity index 100% rename from pyvault/models.py rename to vaultapi/models.py diff --git a/pyvault/rate_limit.py b/vaultapi/rate_limit.py similarity index 98% rename from pyvault/rate_limit.py rename to vaultapi/rate_limit.py index 6a49ebb..fa95c6a 100644 --- a/pyvault/rate_limit.py +++ b/vaultapi/rate_limit.py @@ -4,7 +4,7 @@ from fastapi import HTTPException, Request -from pyvault import models +from vaultapi import models class RateLimiter: diff --git a/pyvault/routers.py b/vaultapi/routers.py similarity index 97% rename from pyvault/routers.py rename to vaultapi/routers.py index 8477d72..b34e2dd 100644 --- a/pyvault/routers.py +++ b/vaultapi/routers.py @@ -9,7 +9,7 @@ from fastapi.routing import APIRoute from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer -from pyvault import auth, exceptions, models, rate_limit +from vaultapi import auth, exceptions, models, rate_limit LOGGER = logging.getLogger("uvicorn.default") security = HTTPBearer() diff --git a/pyvault/squire.py b/vaultapi/squire.py similarity index 97% rename from pyvault/squire.py rename to vaultapi/squire.py index d8ef82b..2292746 100644 --- a/pyvault/squire.py +++ b/vaultapi/squire.py @@ -4,7 +4,7 @@ import yaml -from pyvault.models import EnvConfig +from vaultapi.models import EnvConfig def envfile_loader(filename: str | os.PathLike) -> EnvConfig: