Move AuthType
authorAdam Dullage <redacted>
Wed, 12 Oct 2022 12:17:07 +0000 (13:17 +0100)
committerAdam Dullage <redacted>
Wed, 12 Oct 2022 12:17:07 +0000 (13:17 +0100)
flatnotes/auth.py
flatnotes/auth_type.py [deleted file]
flatnotes/config.py
flatnotes/models.py

index cfb052bb841e1b3d5bfb2a8aee6ca83006376f6a..ff426fc3b948aa3da516f59c619e608152ebeb88 100644 (file)
@@ -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 (file)
index 5644d89..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-from enum import Enum
-
-
-class AuthType(str, Enum):
-    NONE = "none"
-    PASSWORD = "password"
-    # TOTP = "totp"  # Not yet implemented
index 8e9afd99dad0c49f9e3432d05086fbadcbbb146b..95359543bc8290344b4bc5c09299942e6f55e48c 100644 (file)
@@ -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()
index fac37526398387ad825993177b46037a285ef9d5..265c9b504fbda83e2d06b7c0c1da0012f5a5ba83 100644 (file)
@@ -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):
git clone https://git.99rst.org/PROJECT