Much more work
This commit is contained in:
parent
f1d9aaf340
commit
990dbc2405
|
@ -265,3 +265,4 @@ tags
|
||||||
|
|
||||||
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
|
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
|
||||||
main.py
|
main.py
|
||||||
|
hsman/.flaskenv
|
||||||
|
|
|
@ -2,3 +2,4 @@ from .apikeys import APIKey
|
||||||
from .nodes import Node
|
from .nodes import Node
|
||||||
from .users import User
|
from .users import User
|
||||||
from .routes import Route
|
from .routes import Route
|
||||||
|
from .preauthkeys import PreAuthKey, v1ListPreAuthKeyRequest
|
||||||
|
|
|
@ -5,14 +5,14 @@ from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
|
|
||||||
|
|
||||||
class APISettings(BaseSettings):
|
class APISettings(BaseSettings):
|
||||||
model_config = SettingsConfigDict(env_prefix='HS_')
|
model_config = SettingsConfigDict(env_prefix='HSAPI_')
|
||||||
server: str = "http://localhost:8080"
|
server: str = "http://localhost:8080"
|
||||||
api_path: str = "/api/v1"
|
api_path: str = "/api/v1"
|
||||||
api_token: Union[str, None] = None
|
api_token: Union[str, None] = None
|
||||||
ssl_verify: Union[bool, str] = True
|
ssl_verify: Union[bool, str] = True
|
||||||
|
|
||||||
def refresh_api_token(self):
|
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):
|
class HTTPException(Exception):
|
||||||
|
|
Loading…
Reference in New Issue