Skip to content

Commit 3cb9de2

Browse files
committed
Updated documentation for v0.5.0 release
1 parent 42042ae commit 3cb9de2

File tree

4 files changed

+146
-83
lines changed

4 files changed

+146
-83
lines changed

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
# built documents.
4949
#
5050
# The short X.Y version.
51-
version = 'v0.4.1'
51+
version = 'v0.5.0'
5252
# The full version, including alpha/beta/rc tags.
53-
release = 'v0.4.1'
53+
release = 'v0.5.0'
5454

5555
# The language for content autogenerated by Sphinx. Refer to documentation
5656
# for a list of supported languages.

doc/functions.rst

Lines changed: 111 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -29,63 +29,16 @@ as its methods and attributes.
2929

3030
The :class:`Context` class has the following public read/write attributes:
3131

32-
.. py:attribute:: resolution_type
33-
34-
Specifies whether DNS queries are performed with
35-
nonrecursive lookups or as a stub resolver. The value is
36-
either ``getdns.RESOLUTION_RECURSING`` or
37-
``getdns.RESOLUTION_STUB``.
38-
39-
If an implementation of this API is only able to act as a
40-
recursive resolver, setting `resolution_type`
41-
to ``getdns.RESOLUTION_STUB`` will throw an exception.
42-
43-
.. py:attribute:: namespaces
44-
45-
The `namespaces` attribute takes an ordered list of
46-
namespaces that will be queried. (*Important: this context
47-
setting is ignored for the getdns.general() function;
48-
it is used for the other
49-
functions.*) The allowed values are
50-
``getdns.NAMESPACE_DNS``, ``getdns.NAMESPACE_LOCALNAMES``,
51-
``getdns.NAMESPACE_NETBIOS``,
52-
``getdns.NAMESPACE_MDNS``, and ``getdns.NAMESPACE_NIS``. When a
53-
normal lookup is done, the API does the lookups in the
54-
order given and stops when it gets the first result; a
55-
different method with the same result would be to run the
56-
queries in parallel and return when it gets the first
57-
result. Because lookups might be done over different
58-
mechanisms because of the different namespaces, there can
59-
be information leakage that is similar to that seen with
60-
POSIX *getaddrinfo()*. The default is determined by the OS.
61-
62-
.. py:attribute:: dns_transport_list
63-
64-
An ordered list of transport options to be used for DNS
65-
lookups, ordered by preference (first choice as list
66-
element 0, second as list element 1, and so on). The
67-
possible values are ``getdns.TRANSPORT_UDP``,
68-
``getdns.TRANSPORT_TCP``, ``getdns.TRANSPORT_TLS``,
69-
and ``getdns.TRANSPORT_STARTTLS``. [n.b.: *the
70-
``dns_transport`` attribute is still supported but will
71-
be deprecated in a future release*]
72-
73-
.. py:attribute:: limit_outstanding_queries
74-
75-
Specifies `limit` (an integer value) on the number of outstanding DNS
76-
queries. The API will block itself from sending more
77-
queries if it is about to exceed this value, and instead
78-
keep those queries in an internal queue. The a value of 0
79-
indicates that the number of outstanding DNS queries is unlimited.
80-
81-
.. py:attribute:: follow_redirects
32+
.. py:attribute:: append_name
8233
83-
Specifies whether or not DNS queries follow
84-
redirects. The value must be one of ``getdns.REDIRECTS_FOLLOW`` for
85-
normal following of redirects though CNAME and DNAME; or
86-
``getdns.REDIRECTS_DO_NOT_FOLLOW`` to cause any lookups that
87-
would have gone through CNAME and DNAME to return the
88-
CNAME or DNAME, not the eventual target.
34+
Specifies whether to append a suffix to the query string
35+
before the API starts resolving a name. Its value must be
36+
one of
37+
``getdns.APPEND_NAME_ALWAYS``,
38+
``getdns.APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE``,
39+
``getdns.APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE``,
40+
or ``getdns.APPEND_NAME_NEVER``. This controls whether or not
41+
to append the suffix given by :attr:`suffix`.
8942

9043
.. py:attribute:: dns_root_servers
9144
@@ -104,58 +57,130 @@ as its methods and attributes.
10457
... { 'address_data': '65.22.9.1', 'address_type': 'IPv4' } ]
10558
>>> mycontext.dns_root_servers = addrs
10659

107-
.. py:attribute:: append_name
60+
.. py:attribute:: dns_transport_list
10861
109-
Specifies whether to append a suffix to the query string
110-
before the API starts resolving a name. Its value must be
111-
one of
112-
``getdns.APPEND_NAME_ALWAYS``,
113-
``getdns.APPEND_NAME_ONLY_TO_SINGLE_LABEL_AFTER_FAILURE``,
114-
``getdns.APPEND_NAME_ONLY_TO_MULTIPLE_LABEL_NAME_AFTER_FAILURE``,
115-
or ``getdns.APPEND_NAME_NEVER``. This controls whether or not
116-
to append the suffix given by :attr:`suffix`.
62+
An ordered list of transport options to be used for DNS
63+
lookups, ordered by preference (first choice as list
64+
element 0, second as list element 1, and so on). The
65+
possible values are ``getdns.TRANSPORT_UDP``,
66+
``getdns.TRANSPORT_TCP``, ``getdns.TRANSPORT_TLS``,
67+
and ``getdns.TRANSPORT_STARTTLS``.
11768

118-
.. py:attribute:: suffix
69+
.. py:attribute:: dnssec_allowed_skew
11970
120-
Its value is a list of strings to be appended based on
121-
:attr:`append_name`. The list elements must
122-
follow the rules in :rfc:`4343#section-2.1`
71+
Its value is the number of seconds of skew that is
72+
allowed in either direction when checking an RRSIG's
73+
Expiration and Inception fields. The default is 0.
12374

12475
.. py:attribute:: dnssec_trust_anchors
12576
12677
Its value is a list of DNSSEC trust anchors, expressed as
12778
RDATAs from DNSKEY resource records.
12879

129-
.. py:attribute:: dnssec_allowed_skew
80+
.. py:attribute:: edns_client_subnet_private
13081
131-
Its value is the number of seconds of skew that is
132-
allowed in either direction when checking an RRSIG's
133-
Expiration and Inception fields. The default is 0.
82+
May be set to 0 or 1. When 1, requests upstreams not to
83+
reveal query's originating network.
13484

135-
.. py:attribute:: edns_maximum_udp_payload_size
85+
.. py:attribute:: edns_do_bit
13686
137-
Its value must be an integer between 512 and 65535,
138-
inclusive. The default is 512.
87+
Its value must be an integer valued either 0 or 1. The default is 0.
13988

14089
.. py:attribute:: edns_extended_rcode
14190
14291
Its value must be an integer between 0 and 255, inclusive.
14392
The default is 0.
14493

94+
.. py:attribute:: edns_maximum_udp_payload_size
95+
96+
Its value must be an integer between 512 and 65535,
97+
inclusive. The default is 512.
98+
14599
.. py:attribute:: edns_version
146100
147101
Its value must be an integer between 0 and 255, inclusive.
148102
The default is 0.
149103

150-
.. py:attribute:: edns_do_bit
104+
.. py:attribute:: follow_redirects
151105
152-
Its value must be an integer valued either 0 or 1. The default is 0.
106+
Specifies whether or not DNS queries follow
107+
redirects. The value must be one of ``getdns.REDIRECTS_FOLLOW`` for
108+
normal following of redirects though CNAME and DNAME; or
109+
``getdns.REDIRECTS_DO_NOT_FOLLOW`` to cause any lookups that
110+
would have gone through CNAME and DNAME to return the
111+
CNAME or DNAME, not the eventual target.
112+
113+
.. py:attribute:: idle_timeout
114+
115+
The idle timeout for TCP connections.
116+
117+
.. py:attribute:: implementation_string
118+
119+
A string describing the implementation of the underlying
120+
getdns library, retrieved from
121+
libgetdns. Currently "https://getdnsapi.net"
122+
123+
.. py:attribute:: limit_outstanding_queries
124+
125+
Specifies `limit` (an integer value) on the number of outstanding DNS
126+
queries. The API will block itself from sending more
127+
queries if it is about to exceed this value, and instead
128+
keep those queries in an internal queue. The a value of 0
129+
indicates that the number of outstanding DNS queries is unlimited.
130+
131+
.. py:attribute:: namespaces
132+
133+
The `namespaces` attribute takes an ordered list of
134+
namespaces that will be queried. (*Important: this context
135+
setting is ignored for the getdns.general() function;
136+
it is used for the other
137+
functions.*) The allowed values are
138+
``getdns.NAMESPACE_DNS``, ``getdns.NAMESPACE_LOCALNAMES``,
139+
``getdns.NAMESPACE_NETBIOS``,
140+
``getdns.NAMESPACE_MDNS``, and ``getdns.NAMESPACE_NIS``. When a
141+
normal lookup is done, the API does the lookups in the
142+
order given and stops when it gets the first result; a
143+
different method with the same result would be to run the
144+
queries in parallel and return when it gets the first
145+
result. Because lookups might be done over different
146+
mechanisms because of the different namespaces, there can
147+
be information leakage that is similar to that seen with
148+
POSIX *getaddrinfo()*. The default is determined by the OS.
149+
150+
.. py:attribute:: resolution_type
151+
152+
Specifies whether DNS queries are performed with
153+
nonrecursive lookups or as a stub resolver. The value is
154+
either ``getdns.RESOLUTION_RECURSING`` or
155+
``getdns.RESOLUTION_STUB``.
156+
157+
If an implementation of this API is only able to act as a
158+
recursive resolver, setting `resolution_type`
159+
to ``getdns.RESOLUTION_STUB`` will throw an exception.
160+
161+
.. py:attribute:: suffix
162+
163+
Its value is a list of strings to be appended based on
164+
:attr:`append_name`. The list elements must
165+
follow the rules in :rfc:`4343#section-2.1`
153166

154167
.. py:attribute:: timeout
155168
156169
Its value must be an integer specifying a timeout for a query, expressed
157170
in milliseconds.
158171

172+
.. py:attribute:: tls_authentication
173+
174+
The mechanism to be used for authenticating the TLS
175+
server when using a TLS transport. May be ``getdns.AUTHENTICATION_HOSTNAME`` or
176+
``getdns.AUTHENTICATION_NONE``.
177+
178+
.. py:attribute:: tls_query_padding_blocksize
179+
180+
Optional padding blocksize for queries when using TLS. Used to
181+
increase the difficulty for observers to guess traffic
182+
content.
183+
159184
.. py:attribute:: upstream_recursive_servers
160185
161186
A list of dicts defining where a stub resolver will send queries.
@@ -168,6 +193,10 @@ as its methods and attributes.
168193
tsig_algorithm (a bindata) that is the name of the TSIG hash
169194
algorithm, and tsig_secret (a bindata) that is the TSIG key.
170195

196+
.. py:attribute:: version_string
197+
198+
The libgetdns version, retrieved from the underlying
199+
getdns library.
171200

172201
The :class:`Context` class includes public methods to execute a DNS query, as well as a
173202
method to return the entire set of context attributes as a Python dictionary. :class:`Context`
@@ -243,6 +272,10 @@ as its methods and attributes.
243272
* ``timeout``
244273
* ``upstream_recursive_servers``
245274

275+
.. py:method:: get_supported_attributes()
276+
277+
Returns a list of the attributes supported by this
278+
Context object.
246279

247280
The ``getdns`` module has the following read-only attribute:
248281

doc/index.rst

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ This version of getdns has been built and tested against Python
2929
2.7. We also expect these other prerequisites to be
3030
installed:
3131

32-
* `libgetdns <http://getdnsapi.net/>`_, version 0.1.7 or later
32+
* `libgetdns <http://getdnsapi.net/>`_, version 0.5.0 or later
3333
* `libldns <https://www.nlnetlabs.nl/projects/ldns/>`_,
3434
version 1.6.11 or later
3535
* `libunbound
3636
<http://www.nlnetlabs.nl/projects/unbound/>`_, version
3737
1.4.16 or later
38-
* `libexpat <http://expat.sourceforge.net/>`_ (needed for unbound)
3938
* `libidn <http://www.gnu.org/software/libidn/>`_ version 1
4039
* `libevent <http://libevent.org/>`_ version 2.0.21 stable
4140

@@ -50,7 +49,7 @@ you must compile support for them into libgetdns, by
5049
including the --enable-draft-edns-cookies argument to
5150
configure.
5251

53-
This release has been tested against libgetdns 0.3.1.
52+
This release has been tested against libgetdns 0.5.0.
5453

5554
Building
5655
========
@@ -199,6 +198,32 @@ In this example, we do a DNSSEC query and check the response:
199198
main()
200199
201200
201+
Module-level attributes and methods
202+
===================================
203+
204+
.. py:attribute:: __version__
205+
206+
The ``getdns.__version__`` attribute contains the version
207+
string for the Python getdns module. Please note that
208+
this is independent of the version of the underlying
209+
getdns library, which may be retrieved through attributes
210+
associated with a Context.
211+
212+
.. py:method:: get_errorstr_by_id()
213+
214+
Returns a human-friendly string representation of an
215+
error ID.
216+
217+
.. py:method:: ulabel_to_alabel()
218+
219+
Converts a ulabel to an alabel. Takes one argument (the ulabel)
220+
221+
.. py:method:: alabel_to_ulabel()
222+
223+
Converts an alabel to a ulabel. Takes one argument (the
224+
alabel)
225+
226+
202227
Known issues
203228
============
204229

doc/response.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ Response data from queries
154154
RRSIGs) that are needed to perform the validation from
155155
the root up.
156156

157+
.. py:attribute:: call_debugging
158+
159+
A list of dictionaries containing call_debugging
160+
information, if requested in the query.
161+
157162
.. py:attribute:: replies_tree
158163
159164
The names in each entry in the the ``replies_tree`` list for DNS

0 commit comments

Comments
 (0)