Skip to content

Commit

Permalink
After review
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkrzem committed Nov 6, 2024
1 parent 6785c83 commit 944fe07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def query_remove(
def server() -> ServerSchema:
return ServerSchema(
version=mquery_version(),
auth_enabled=db.config.auth_enabled,
auth_enabled=str(db.config.auth_enabled).lower(),
openid_url=db.config.openid_url,
openid_client_id=db.config.openid_client_id,
about=app_config.mquery.about,
Expand Down
9 changes: 3 additions & 6 deletions src/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def auth_default_roles(self) -> List[UserRole]:
]

@property
def openid_client_id(self) -> str:
def openid_client_id(self) -> str | None:
return self.db.get_mquery_config_key("openid_client_id")

@property
Expand All @@ -87,13 +87,10 @@ def query_allow_slow(self) -> bool:

@property
def auth_enabled(self) -> bool:
auth_enabled = self.db.get_mquery_config_key("auth_enabled")
if not auth_enabled or auth_enabled == "false":
return False
return True
return self.db.get_mquery_config_key("auth_enabled") == "true"

@property
def openid_url(self) -> str:
def openid_url(self) -> str | None:
return self.db.get_mquery_config_key("openid_url")

@property
Expand Down
2 changes: 1 addition & 1 deletion src/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class BackendStatusDatasetsSchema(BaseModel):

class ServerSchema(BaseModel):
version: str
auth_enabled: Optional[bool]
auth_enabled: Optional[str]
openid_url: Optional[str]
openid_client_id: Optional[str]
about: str

0 comments on commit 944fe07

Please sign in to comment.