[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [bridgedb/master] Add `client` attribute and `getHashringPlacement()` to IRequestBridges.
commit ef1e219f715e09d525561b0a90cfbf00df45d9f5
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date: Fri Dec 5 23:56:11 2014 +0000
Add `client` attribute and `getHashringPlacement()` to IRequestBridges.
* ADD interface definitions for IRequestBridges.client and
IRequestBridges.getHashringPlacement().
---
lib/bridgedb/bridgerequest.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/lib/bridgedb/bridgerequest.py b/lib/bridgedb/bridgerequest.py
index 3ef0dc7..840b2fc 100644
--- a/lib/bridgedb/bridgerequest.py
+++ b/lib/bridgedb/bridgerequest.py
@@ -36,6 +36,12 @@ class IRequestBridges(Interface):
"not be blocked in these countries.")
valid = Attribute(
"A boolean. Should be ``True`` if the client's request was valid.")
+ client = Attribute(
+ "This should be some information unique to the client making the "
+ "request for bridges, such that we are able to HMAC this unique "
+ "data, via getHashringPlacement(), in order to place the client "
+ "into a hashring (determining which bridge addresses they get in "
+ "the request response).")
def addFilter():
"""Add a filter to the list of ``filters``."""
@@ -49,6 +55,13 @@ class IRequestBridges(Interface):
``addressClass``.
"""
+ def getHashringPlacement():
+ """Use some unique parameters of the client making this request to
+ obtain a value which we can use to place them into one of the hashrings
+ with :class:`~bridgedb.bridges.Bridge`s in it, in order to give that
+ client different bridges than other clients.
+ """
+
def isValid():
"""Determine if the request is ``valid`` according to some parameters."""
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits