> On Mar 17, 2015, at 11:51 PM, Adi Roiban <[email protected]> wrote:
> 
> On 18 March 2015 at 05:30, Glyph <[email protected] 
> <mailto:[email protected]>> wrote:
>> 
>> On Mar 17, 2015, at 6:44 AM, Adi Roiban <[email protected]> wrote:
>> 
>> Hi,
>> 
>> While trying to fix https://twistedmatrix.com/trac/ticket/5999 I found
>> out about the SSHTransportAddress introduced in 12.1.
>> 
>> SSHTransportAddress is just an IAddress wrapping in a non-tranparent
>> way another IAddress.
>> 
>> It was introduces in #2997 which was accepted without any reason why
>> we need SSHTransportAddress and why SSHTransportAddress is better than
>> an IAddress.
>> I could not find any documentation describing why we need this new class.
>> 
>> 
>> The reason that we need this new type of address is to ensure that any code
>> inspecting this address and attempting to construct a similar connection
>> based upon it is not mislead into creating a transport which is not similar
>> to the one it is indicating.
>> 
>> Arguably, SSHTransportAddress is missing lots of important information: is
>> the address indicative of a client, or a server?  If a client, what hostname
>> was specified?  If a server, what user is connected?  Two SSH connections to
>> the same IP address / port number are not necessarily equivalent, but the
>> current implementation of SSHTransportAddress would compare that way, which
>> is unfortunate.
> 
> [snip]
> 
>> SSHTransportAddress is useful, but its only utility is in explicitly
>> breaking use-cases that in fact should not work, so it's a bit user-hostile,
>> so I can see why you'd feel it is useless.  If it were retrofitted to keep
>> enough information to be useful in its own right, then that would be a lot
>> better.
> 
> Thanks!

No problem, always happy to explain :).

> Are these design notes for SSHTransportAddress documented somewhere?

Doubtful.  They seem like an obvious consequence of how the various pieces fit 
together, for me; I feel like every IAddress implementer would have to contain 
a similar comment, if it were documented anywhere.  However, this really should 
be written somewhere that people, especially twisted maintainers, will see it.  
Any suggestions?

> I will update my changes to start making use of SSHTransportAddress.

Great.

> I have created a ticket to add client/server information into the
> SSHTransportAddress. I am using this as a pretext to try to improve
> the documentation for SSHTransportAddress.
> https://twistedmatrix.com/trac/ticket/7825#ticket 
> <https://twistedmatrix.com/trac/ticket/7825#ticket>

Thanks!

-g
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to