[tor-commits] [stem/master] Include hidden service descriptors in our API docs

atagar at torproject.org atagar at torproject.org
Sun Mar 1 05:16:35 UTC 2015


commit 44f3e5fe4d8586da2dd2cf0a662d4ab801676d6e
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Feb 28 21:10:35 2015 -0800

    Include hidden service descriptors in our API docs
    
    Adding our new hidden service desriptors to the generated API docs, in addition
    to a changelog entry and few other improvements.
---
 docs/api.rst                                 |    1 +
 docs/change_log.rst                          |    1 +
 docs/contents.rst                            |    1 +
 stem/descriptor/hidden_service_descriptor.py |   15 +++++-----
 stem/util/connection.py                      |   38 ++++++++++++++------------
 5 files changed, 30 insertions(+), 26 deletions(-)

diff --git a/docs/api.rst b/docs/api.rst
index 4f1a01c..85cfdcb 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -34,6 +34,7 @@ remotely like Tor does.
  * `stem.descriptor.microdescriptor <api/descriptor/microdescriptor.html>`_ - Minimalistic counterpart for server descriptors.
  * `stem.descriptor.networkstatus <api/descriptor/networkstatus.html>`_ - Network status documents which make up the Tor consensus.
  * `stem.descriptor.router_status_entry <api/descriptor/router_status_entry.html>`_ - Relay entries within a network status document.
+ * `stem.descriptor.hidden_service_descriptor <api/descriptor/hidden_service_descriptor.html>`_ - Descriptors generated for hidden services.
  * `stem.descriptor.tordnsel <api/descriptor/tordnsel.html>`_ - `TorDNSEL <https://www.torproject.org/projects/tordnsel.html.en>`_ exit lists.
 
 * `stem.descriptor.reader <api/descriptor/reader.html>`_ - Reads and parses descriptor files from disk.
diff --git a/docs/change_log.rst b/docs/change_log.rst
index 7143655..a922894 100644
--- a/docs/change_log.rst
+++ b/docs/change_log.rst
@@ -58,6 +58,7 @@ conversion (:trac:`14075`).
  * **Descriptors**
 
   * Lazy-loading descriptors, improving performance by 25-70% depending on what type it is (:trac:`14011`)
+  * Added `support for hidden service descriptors <api/descriptor/hidden_service_descriptor.html>`_ (:trac:`15004`)
   * The :class:`~stem.descriptor.networkstatus.DirectoryAuthority` 'fingerprint' attribute was actually its 'v3ident'
   * Updating Faravahar's address (:trac:`14487`)
 
diff --git a/docs/contents.rst b/docs/contents.rst
index db703a2..a402dd6 100644
--- a/docs/contents.rst
+++ b/docs/contents.rst
@@ -42,6 +42,7 @@ Contents
    api/descriptor/microdescriptor
    api/descriptor/networkstatus
    api/descriptor/router_status_entry
+   api/descriptor/hidden_service_descriptor
    api/descriptor/tordnsel
 
    api/descriptor/export
diff --git a/stem/descriptor/hidden_service_descriptor.py b/stem/descriptor/hidden_service_descriptor.py
index 075c2c2..73f5edf 100644
--- a/stem/descriptor/hidden_service_descriptor.py
+++ b/stem/descriptor/hidden_service_descriptor.py
@@ -241,12 +241,12 @@ class HiddenServiceDescriptor(Descriptor):
     Provided this service's introduction points. This provides a list of
     IntroductionPoint instances, which have the following attributes...
 
-      * identifier (str): hash of this introduction point's identity key
-      * address (str): address of this introduction point
-      * port (int): port where this introduction point is listening
-      * onion_key (str): public key for communicating with this introduction point
-      * service_key (str): public key for communicating with this hidden service
-      * intro_authentication (list): tuples of the form (auth_type, auth_data)
+      * **identifier** (str): hash of this introduction point's identity key
+      * **address** (str): address of this introduction point
+      * **port** (int): port where this introduction point is listening
+      * **onion_key** (str): public key for communicating with this introduction point
+      * **service_key** (str): public key for communicating with this hidden service
+      * **intro_authentication** (list): tuples of the form (auth_type, auth_data)
         for establishing a connection
 
     :returns: **list** of IntroductionPoints instances
@@ -256,8 +256,7 @@ class HiddenServiceDescriptor(Descriptor):
       * **DecryptionFailure** if unable to decrypt this field
     """
 
-    # TODO: Support fields encrypted with a desriptor-cookie. Need sample data
-    # to implement this.
+    # TODO: Support fields encrypted with a desriptor-cookie. (#15004)
 
     if not self.introduction_points_content:
       return []
diff --git a/stem/util/connection.py b/stem/util/connection.py
index 402a45a..475c7f5 100644
--- a/stem/util/connection.py
+++ b/stem/util/connection.py
@@ -26,19 +26,21 @@ Connection and networking based utility functions.
   Method for resolving a process' connections.
 
   .. versionadded:: 1.1.0
-
-  =================   ===========
-  Resolver            Description
-  =================   ===========
-  **PROC**            /proc contents
-  **NETSTAT**         netstat
-  **NETSTAT_WINDOWS** netstat command under Windows
-  **SS**              ss command
-  **LSOF**            lsof command
-  **SOCKSTAT**        sockstat command under *nix
-  **BSD_SOCKSTAT**    sockstat command under FreeBSD
-  **BSD_PROCSTAT**    procstat command under FreeBSD
-  =================   ===========
+  .. versionchanged:: 1.4.0
+     Added **NETSTAT_WINDOWS**.
+
+  ====================  ===========
+  Resolver              Description
+  ====================  ===========
+  **PROC**              /proc contents
+  **NETSTAT**           netstat
+  **NETSTAT_WINDOWS**   netstat command under Windows
+  **SS**                ss command
+  **LSOF**              lsof command
+  **SOCKSTAT**          sockstat command under *nix
+  **BSD_SOCKSTAT**      sockstat command under FreeBSD
+  **BSD_PROCSTAT**      procstat command under FreeBSD
+  ====================  ===========
 """
 
 import collections
@@ -143,11 +145,11 @@ def get_connections(resolver, process_pid = None, process_name = None):
   Retrieves a list of the current connections for a given process. This
   provides a list of Connection instances, which have five attributes...
 
-    * local_address (str)
-    * local_port (int)
-    * remote_address (str)
-    * remote_port (int)
-    * protocol (str, generally either 'tcp' or 'udp')
+    * **local_address** (str)
+    * **local_port** (int)
+    * **remote_address** (str)
+    * **remote_port** (int)
+    * **protocol** (str, generally either 'tcp' or 'udp')
 
   .. versionadded:: 1.1.0
 





More information about the tor-commits mailing list