From: Adam Dullage Date: Wed, 12 Oct 2022 12:17:07 +0000 (+0100) Subject: Move AuthType X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=bc9620d6209d6b68a23e8121e5e694098c80f778;p=flatnotes.git Move AuthType --- diff --git a/flatnotes/auth.py b/flatnotes/auth.py index cfb052b..ff426fc 100644 --- a/flatnotes/auth.py +++ b/flatnotes/auth.py @@ -3,9 +3,8 @@ from datetime import datetime, timedelta from fastapi import Depends, HTTPException from fastapi.security import OAuth2PasswordBearer from jose import JWTError, jwt -from auth_type import AuthType -from config import config +from config import AuthType, config JWT_ALGORITHM = "HS256" diff --git a/flatnotes/auth_type.py b/flatnotes/auth_type.py deleted file mode 100644 index 5644d89..0000000 --- a/flatnotes/auth_type.py +++ /dev/null @@ -1,7 +0,0 @@ -from enum import Enum - - -class AuthType(str, Enum): - NONE = "none" - PASSWORD = "password" - # TOTP = "totp" # Not yet implemented diff --git a/flatnotes/config.py b/flatnotes/config.py index 8e9afd9..9535954 100644 --- a/flatnotes/config.py +++ b/flatnotes/config.py @@ -1,10 +1,16 @@ import os import sys +from enum import Enum -from auth_type import AuthType from logger import logger +class AuthType(str, Enum): + NONE = "none" + PASSWORD = "password" + # TOTP = "totp" # Not yet implemented + + class Config: def __init__(self) -> None: self.data_path = self.get_data_path() diff --git a/flatnotes/models.py b/flatnotes/models.py index fac3752..265c9b5 100644 --- a/flatnotes/models.py +++ b/flatnotes/models.py @@ -1,9 +1,8 @@ from typing import Dict, List, Optional -from config import Config +from config import AuthType, Config from flatnotes import Note, SearchResult from helpers import CamelCaseBaseModel -from auth_type import AuthType class LoginModel(CamelCaseBaseModel):