Much more work

This commit is contained in:
2024-07-03 16:38:29 +02:00
parent c94f31d5ee
commit 44625ca5f0
17 changed files with 706 additions and 281 deletions

View File

@ -2,3 +2,4 @@ from .apikeys import APIKey
from .nodes import Node
from .users import User
from .routes import Route
from .preauthkeys import PreAuthKey, v1ListPreAuthKeyRequest

View File

@ -5,14 +5,14 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
class APISettings(BaseSettings):
model_config = SettingsConfigDict(env_prefix='HS_')
model_config = SettingsConfigDict(env_prefix='HSAPI_')
server: str = "http://localhost:8080"
api_path: str = "/api/v1"
api_token: Union[str, None] = None
ssl_verify: Union[bool, str] = True
def refresh_api_token(self):
self.api_token = os.environ.get('HS_API_TOKEN', 'default')
self.api_token = os.environ.get('HSAPI_API_TOKEN', 'default')
class HTTPException(Exception):