CMS 3D CMS Logo

List of all members | Public Member Functions
authentication.X509CertAuth Class Reference
Inheritance diagram for authentication.X509CertAuth:

Public Member Functions

def __init__ (self, host, *args, **kwargs)
 

Detailed Description

Class to authenticate via Grid Certificate

Definition at line 26 of file authentication.py.

Constructor & Destructor Documentation

◆ __init__()

def authentication.X509CertAuth.__init__ (   self,
  host,
args,
**  kwargs 
)

Definition at line 28 of file authentication.py.

28  def __init__(self, host, *args, **kwargs):
29  key_file = None
30  cert_file = None
31 
32  x509_path = getenv("X509_USER_PROXY", None)
33  if x509_path and exists(x509_path):
34  key_file = cert_file = x509_path
35 
36  if not key_file:
37  x509_path = getenv("X509_USER_KEY", None)
38  if x509_path and exists(x509_path):
39  key_file = x509_path
40 
41  if not cert_file:
42  x509_path = getenv("X509_USER_CERT", None)
43  if x509_path and exists(x509_path):
44  cert_file = x509_path
45 
46  if not key_file:
47  x509_path = getenv("HOME") + "/.globus/userkey.pem"
48  if exists(x509_path):
49  key_file = x509_path
50 
51  if not cert_file:
52  x509_path = getenv("HOME") + "/.globus/usercert.pem"
53  if exists(x509_path):
54  cert_file = x509_path
55 
56  if not key_file or not exists(key_file):
57  print("No certificate private key file found", file=stderr)
58  exit(1)
59 
60  if not cert_file or not exists(cert_file):
61  print("No certificate public key file found", file=stderr)
62  exit(1)
63 
64  #print "Using SSL private key", key_file
65  #print "Using SSL public key", cert_file
66 
67  HTTPSConnection.__init__(self,
68  host,
69  key_file = key_file,
70  cert_file = cert_file,
71  **kwargs)
72 
73 #-----------------------------------------------------------------------------
74 

References beamvalidation.exit(), and edm.print().

edm::print
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53