[Security-sig] Unified TLS API for Python

Cory Benfield cory at lukasa.co.uk
Fri Jan 13 08:56:04 EST 2017


> On 13 Jan 2017, at 13:09, Nathaniel Smith <njs at pobox.com> wrote:
> 
> I guess another possible point in the design space would be to split the difference: instead of an abstract context class or a dict, define a concrete context class that acts as a simple transparent container for these settings, effectively layering the type safety etc over its __dict__.

I think I’d want to do it this way if we were going to do it all: I’m extremely reluctant to use dicts and strings for this if we can possibly avoid it. In fact, you’ll note that the API goes to substantial lengths to avoid passing strings around in almost all cases, except where such a use is required essentially by convention (e.g. paths).

While we’re here, I should point out that this does not replace the abstract contexts entirely, because we still need the wrap_* methods. These would now just be fed a Configuration object (I’m more comfortable with the name Configuration than Policy for this usage) in their constructor, and then could use the wrap_* methods as needed.

How does that idea sound to the rest of the list?

Cory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/security-sig/attachments/20170113/de988e2b/attachment.html>


More information about the Security-SIG mailing list