CMS 3D CMS Logo

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__ (self, key=None, cert=None, capath=None, level=0)
 
def get_connection (self, host, timeout=300)
 
def https_open (self, req)
 

Public Attributes

 capath
 
 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

◆ __init__()

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

Definition at line 57 of file das_client.py.

57  def __init__(self, key=None, cert=None, capath=None, level=0):
58  if level > 1:
59  urllib2.HTTPSHandler.__init__(self, debuglevel=1)
60  else:
61  urllib2.HTTPSHandler.__init__(self)
62  self.key = key
63  self.cert = cert
64  self.capath = capath
65 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ get_connection()

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.capath, das_client.HTTPSClientAuthHandler.cert, AllInOneConfig::Options.key, 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, cond::AuthorizationData.key, and SiPixelFEDChannelContainerMapSimple< myType >::compareKeys.key.

Referenced by das_client.HTTPSClientAuthHandler.https_open().

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

◆ https_open()

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

Member Data Documentation

◆ capath

das_client.HTTPSClientAuthHandler.capath

Definition at line 64 of file das_client.py.

Referenced by das_client.HTTPSClientAuthHandler.get_connection().

◆ cert

das_client.HTTPSClientAuthHandler.cert

◆ key

das_client.HTTPSClientAuthHandler.key