Skip to content

parse_security

faststream.nats.security.parse_security #

parse_security(security)
Source code in faststream/nats/security.py
def parse_security(security: Optional[BaseSecurity]) -> "AnyDict":
    if security is None:
        return {}
    elif isinstance(security, SASLPlaintext):
        return _parse_sasl_plaintext(security)
    elif isinstance(security, BaseSecurity):
        return _parse_base_security(security)
    else:
        raise NotImplementedError(f"NatsBroker does not support {type(security)}")