BaseSecurity
faststream.security.BaseSecurity #
Base class for defining security configurations.
This class provides a base for defining security configurations for communication with a broker. It allows setting SSL encryption and provides methods to retrieve security requirements and schemas.
PARAMETER | DESCRIPTION |
---|---|
ssl_context | An SSLContext object for SSL encryption. If None, SSL encryption is disabled. TYPE: |
use_ssl | A boolean indicating whether to use SSL encryption. Defaults to True. |
METHOD | DESCRIPTION |
---|---|
get_requirement | Get the security requirements in the form of a list of dictionaries. |
get_schema | Get the security schema as a dictionary. |
Source code in faststream/security.py
get_requirement #
Get the security requirements.
RETURNS | DESCRIPTION |
---|---|
List[AnyDict] | List[AnyDict]: A list of dictionaries representing security requirements. |
Last update: 2023-11-13