CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
das_client.HTTPSClientAuthHandler Class Reference
Inheritance diagram for das_client.HTTPSClientAuthHandler:

Public Member Functions

def __init__
 
def get_connection
 
def https_open
 

Public Attributes

 cert
 
 key
 

Detailed Description

Simple HTTPS client authentication class based on provided
key/ca information

Definition at line 52 of file das_client.py.

Constructor & Destructor Documentation

def das_client.HTTPSClientAuthHandler.__init__ (   self,
  key = None,
  cert = None,
  capath = None,
  level = 0 
)

Definition at line 57 of file das_client.py.

57 
58  def __init__(self, key=None, cert=None, capath=None, level=0):
59  if level > 1:
60  urllib2.HTTPSHandler.__init__(self, debuglevel=1)
61  else:
62  urllib2.HTTPSHandler.__init__(self)
63  self.key = key
self.cert = cert

Member Function Documentation

def das_client.HTTPSClientAuthHandler.get_connection (   self,
  host,
  timeout = 300 
)
Connection method

Definition at line 73 of file das_client.py.

References das_client.HTTPSClientAuthHandler.cert, condex::ConfI.key, condex::ConfF.key, edm::helpers::KeyVal< K, V >.key, edm::helpers::Key< K >.key, edm::MapOfVectors< K, T >::Iter.key, das_client.HTTPSClientAuthHandler.key, SiPixelFEDChannelContainerMap< myType >::compareKeys.key, and cond::AuthorizationData.key.

Referenced by das_client.HTTPSClientAuthHandler.https_open().

73 
74  def get_connection(self, host, timeout=300):
75  """Connection method"""
76  if self.key and self.cert and not self.capath:
77  return httplib.HTTPSConnection(host, key_file=self.key,
78  cert_file=self.cert)
79  elif self.cert and self.capath:
80  context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
81  context.load_verify_locations(capath=self.capath)
82  context.load_cert_chain(self.cert)
83  return httplib.HTTPSConnection(host, context=context)
84  return httplib.HTTPSConnection(host)
def das_client.HTTPSClientAuthHandler.https_open (   self,
  req 
)
Open request method

Definition at line 66 of file das_client.py.

References das_client.HTTPSClientAuthHandler.get_connection().

66 
67  def https_open(self, req):
68  """Open request method"""
69  #Rather than pass in a reference to a connection class, we pass in
70  # a reference to a function which, for all intents and purposes,
71  # will behave as a constructor
72  return self.do_open(self.get_connection, req)

Member Data Documentation

das_client.HTTPSClientAuthHandler.cert

Definition at line 63 of file das_client.py.

Referenced by das_client.HTTPSClientAuthHandler.get_connection(), and ws_sso_content_reader.HTTPSClientAuthHandler.getConnection().

das_client.HTTPSClientAuthHandler.key

Definition at line 62 of file das_client.py.

Referenced by das_client.HTTPSClientAuthHandler.get_connection(), and ws_sso_content_reader.HTTPSClientAuthHandler.getConnection().