Skip to content

warn_deprecated_security_args

faststream.nats.security.warn_deprecated_security_args #

warn_deprecated_security_args(*arguments: str) -> None
Source code in faststream/nats/security.py
21
22
23
24
25
26
27
28
29
30
31
32
def warn_deprecated_security_args(*arguments: str) -> None:
    names = ", ".join(f"`{name}`" for name in arguments)
    replacements = ", ".join(
        dict.fromkeys(_LEGACY_SECURITY_TARGETS[name] for name in arguments)
    )
    warnings.warn(
        f"The NATS security arguments {names} are deprecated and will be removed "
        "in 1.0.0. Use `security=` with "
        f"{replacements} instead.",
        DeprecationWarning,
        stacklevel=3,
    )