Skip to content

Commit

Permalink
Fix regression against older servers (#868)
Browse files Browse the repository at this point in the history
* Fix regression against older servers

* Update CHANGELOG
  • Loading branch information
danielballan authored Jan 28, 2025
1 parent 9dc91de commit f96b7bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Write the date in place of the "Unreleased" in the case a new version is release
classmethods for instantiation from files and registered Tiled nodes, respectively.
- Refactor CSVAdapter to allow pd.read_csv kwargs
- Removed `tiled.adapters.zarr.read_zarr` utility function.
- Server declares authentication provider modes are `external` or `internal`. The
latter was renamed from `password`. Client accepts either `internal` or `password`
for backward-compatibility with older servers.

### Added

Expand Down
9 changes: 8 additions & 1 deletion tiled/schemas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Any, Dict, List, Literal, Optional

from pydantic import BaseModel
from pydantic import BaseModel, field_validator


class AboutAuthenticationProvider(BaseModel):
Expand All @@ -9,6 +9,13 @@ class AboutAuthenticationProvider(BaseModel):
links: Dict[str, str]
confirmation_message: Optional[str] = None

@field_validator("mode", mode="before")
@classmethod
def accept_mode_password_as_backcompat_alias_for_internal(cls, value: Any) -> Any:
if isinstance(value, str) and value == "password":
value = "internal"
return value


class AboutAuthenticationLinks(BaseModel):
whoami: str
Expand Down

0 comments on commit f96b7bd

Please sign in to comment.