📦 chore(factory.py): add AuthManagerFactory class to handle creation of AuthManager service
🐛 fix(service.py): add type hints and import for SettingsManager in AuthManager class
This commit is contained in:
parent
5d9e631ddf
commit
031ab7e4b7
2 changed files with 17 additions and 1 deletions
|
|
@ -0,0 +1,12 @@
|
|||
from langflow.services.factory import ServiceFactory
|
||||
from langflow.services.auth.service import AuthManager
|
||||
|
||||
|
||||
class AuthManagerFactory(ServiceFactory):
|
||||
name = "auth_manager"
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(AuthManager)
|
||||
|
||||
def create(self, settings_manager):
|
||||
return AuthManager(settings_manager)
|
||||
|
|
@ -1,10 +1,14 @@
|
|||
from langflow.services.base import Service
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from langflow.services.settings.manager import SettingsManager
|
||||
|
||||
|
||||
class AuthManager(Service):
|
||||
name = "auth_manager"
|
||||
|
||||
def __init__(self, settings_manager):
|
||||
def __init__(self, settings_manager: "SettingsManager"):
|
||||
self.settings_manager = settings_manager
|
||||
|
||||
# We need to define a function that can be passed to the Depends() function.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue