Skip to content

Commit

Permalink
Fix determining of auth fetch provider in __init__
Browse files Browse the repository at this point in the history
  • Loading branch information
thcrt committed Dec 9, 2024
1 parent dd9da89 commit 12d9fe1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/blobdash/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import flask as f
from click import secho
from pydantic import ValidationError
from pydantic import ValidationError, BaseModel


from .settings import Settings
Expand All @@ -21,7 +21,7 @@ def create_app():
secho(e)
raise SystemExit(1)

match settings.auth.fetch.provider:
match settings.auth.provider:
case "authentik":
auth_provider = AuthentikAuthProvider(
settings.auth.fetch.host, settings.auth.fetch.token
Expand Down
5 changes: 5 additions & 0 deletions src/blobdash/settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Tuple, Type, Optional, Literal
from abc import ABCMeta

from pydantic import BaseModel
from pydantic_extra_types import color
Expand All @@ -25,6 +26,10 @@ class AuthSettings(BaseModel):
default_user: Optional[str] = None
fetch: Optional[AuthentikSettings] = None

@property
def provider(self):
return self.fetch.provider if self.fetch is not None else None


class DashdotSettings(BaseModel):
enabled: bool = True
Expand Down

0 comments on commit 12d9fe1

Please sign in to comment.