chapps.sqla_adapter module
Policy Configuration Adapters based on SQLAlchemy
Policy-configuration source data adapters.
These adapter classes have been adjusted from their original form to use SQLAlchemy.
- class chapps.sqla_adapter.SQLAPolicyConfigAdapter[source]
Bases:
object
Base class for policy config access using SQLAlchemy
- __init__(*, cfg=None, db_host=None, db_port=None, db_name=None, db_user=None, db_pass=None, autocommit=True)[source]
- Parameters
db_host (str) – the hostname or IP address of the database server
db_port (int) – the port number of the database server
db_name (str) – the name of the database
db_user (str) – the username for login
db_pass (str) – the password for the user
autocommit (bool) – defaults to True
cfg (Optional[chapps.config.CHAPPSConfig]) –
- class chapps.sqla_adapter.SQLAQuotaAdapter[source]
Bases:
chapps.sqla_adapter.SQLAPolicyConfigAdapter
An adapter for obtaining quota policy data from MariaDB using SQLAlchemy
- class chapps.sqla_adapter.SQLASenderDomainAuthAdapter[source]
Bases:
chapps.sqla_adapter.SQLAPolicyConfigAdapter
An adapter to obtain sender domain authorization data from MariaDB
- class chapps.sqla_adapter.SQLAInboundFlagsAdapter[source]
Bases:
chapps.sqla_adapter.SQLAPolicyConfigAdapter
- do_greylisting_on(domain)[source]
Returns true if the domain enforces greylisting, otherwise False
- Parameters
domain (
str
) – full domain part- Raises
NoSuchDomainException – if the domain doesn’t exist
- check_spf_on(domain)[source]
Returns true if the domain enforces SPF policies, else False
- Parameters
domain (
str
) – full domain part- Raises
NoSuchDomainException – if the domain doesn’t exist