[docs]classBasicAuthSettings(Configurable):type:Literal["basic"]=Field(None,description="Authentication type. Only «basic» is supported for now.",)algorithm:Annotated[TAlgorithm,BeforeValidator(_replace_plain_algorithm_for_bc),Field("pbkdf2_sha256",description="Hashing algorithm used for passwords.",),]users:Annotated[dict[str,User],BeforeValidator(_load),Field(default_factory=dict,description="Users list.",),]@cached_propertydefalgorithm_impl(self):impl=__import__("passlib.hash",fromlist=[self.algorithm])returngetattr(impl,self.algorithm).verify
[docs]@model_validator(mode="before")@classmethoddefmodel_always_shown_defaults(cls,data):"""This validator overcomes the behaviour of model_dump(exclude_defaults=True, exclude_unset=True) and forces some defaults to be dumped everytime."""data.setdefault("type","basic")returndata