From: Aleš Date: Fri, 4 Feb 2022 12:47:41 +0000 (+0100) Subject: datamodel: docstrings annotatinons (stub-zone, forward-zone, rpz, cache) X-Git-Tag: v6.0.0a1~44^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5548a4e089674849a193f67ce5527366c73c4db;p=thirdparty%2Fknot-resolver.git datamodel: docstrings annotatinons (stub-zone, forward-zone, rpz, cache) - related to #706 --- diff --git a/manager/knot_resolver_manager/datamodel/cache_schema.py b/manager/knot_resolver_manager/datamodel/cache_schema.py index 61efa39d5..493464807 100644 --- a/manager/knot_resolver_manager/datamodel/cache_schema.py +++ b/manager/knot_resolver_manager/datamodel/cache_schema.py @@ -10,7 +10,7 @@ class PrefillSchema(SchemaNode): --- origin: Origin for the imported data. Cache prefilling is only supported for the root zone ('.'). - url: URL of the zone file to be imported. + url: URL of the zone data to be imported. refresh_interval: Time interval between consecutive refreshes of the imported zone data. ca_file: Path to the file containing a CA certificate bundle that is used to authenticate the HTTPS connection. """ @@ -30,10 +30,10 @@ class CacheSchema(SchemaNode): DNS resolver cache configuration. --- - storage: DNS resolver cache storage. + storage: Cache storage of the DNS resolver. size_max: Maximum size of the cache. - ttl_min: Minimum time-to-live for cache entries. - ttl_max: Maximum time-to-live for cache entries. + ttl_min: Minimum time-to-live for the cache entries. + ttl_max: Maximum time-to-live for the cache entries. ns_timeout: Time interval for which a nameserver address will be ignored after determining that it does not return (useful) answers. prefill: Prefill the cache periodically by importing zone data obtained over HTTP. """ diff --git a/manager/knot_resolver_manager/datamodel/forward_zone.py b/manager/knot_resolver_manager/datamodel/forward_zone.py index 323bb69ec..defb13daa 100644 --- a/manager/knot_resolver_manager/datamodel/forward_zone.py +++ b/manager/knot_resolver_manager/datamodel/forward_zone.py @@ -5,6 +5,16 @@ from knot_resolver_manager.utils import SchemaNode class ForwardServerSchema(SchemaNode): + """ + Configuration of Forward server. + + --- + address: IP address of Forward server. + pin_sha256: Hash of accepted CA certificate. + hostname: Hostname of the Forward server. + ca_file: Path to CA certificate file. + """ + address: IPAddressOptionalPort pin_sha256: Optional[Union[str, List[str]]] = None hostname: Optional[DomainName] = None @@ -12,6 +22,16 @@ class ForwardServerSchema(SchemaNode): class ForwardZoneSchema(SchemaNode): + """ + Configuration of Forward Zone. + + --- + tls: Enable/disable TLS for Forward servers. + servers: IP address of Forward server. + views: Use this Forward Zone only for clients defined by views. + options: Configuration flags for Forward Zone. + """ + tls: bool = False servers: Union[List[IPAddressOptionalPort], List[ForwardServerSchema]] views: Optional[List[str]] = None diff --git a/manager/knot_resolver_manager/datamodel/rpz_schema.py b/manager/knot_resolver_manager/datamodel/rpz_schema.py index 5d3d12451..4a951c6f3 100644 --- a/manager/knot_resolver_manager/datamodel/rpz_schema.py +++ b/manager/knot_resolver_manager/datamodel/rpz_schema.py @@ -5,6 +5,18 @@ from knot_resolver_manager.utils import SchemaNode class RPZSchema(SchemaNode): + """ + Configuration or Response Policy Zone (RPZ). + + --- + action: RPZ rule action, typically 'deny'. + file: Path to the RPZ zone file. + watch: Reload the file when it changes. + views: Use RPZ rule only for clients defined by views. + options: Configuration flags for RPZ rule. + message: Deny message for 'deny' action. + """ + action: PolicyActionEnum file: CheckedPath watch: bool = True diff --git a/manager/knot_resolver_manager/datamodel/stub_zone_schema.py b/manager/knot_resolver_manager/datamodel/stub_zone_schema.py index 4dfc5fd09..21ce20532 100644 --- a/manager/knot_resolver_manager/datamodel/stub_zone_schema.py +++ b/manager/knot_resolver_manager/datamodel/stub_zone_schema.py @@ -5,10 +5,26 @@ from knot_resolver_manager.utils import SchemaNode class StubServerSchema(SchemaNode): + """ + Configuration of Stub server. + + --- + address: IP address of Stub server. + """ + address: IPAddressOptionalPort class StubZoneSchema(SchemaNode): + """ + Configuration of Stub Zone. + + --- + servers: IP address of Stub server. + views: Use this Stub Zone only for clients defined by views. + options: Configuration flags for Stub Zone. + """ + servers: Union[List[IPAddressOptionalPort], List[StubServerSchema]] views: Optional[List[str]] = None options: Optional[List[PolicyFlagEnum]] = None