Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Public Attributes
arcom.security.AuthRequest Class Reference

List of all members.

Public Member Functions

def __init__
def get_request
def get_identity
def get_identity_and_ca
def __str__

Public Attributes

 identity
 ca
 subject

Detailed Description

Definition at line 13 of file security.py.


Constructor & Destructor Documentation

def arcom.security.AuthRequest.__init__ (   self,
  message 
)

Definition at line 15 of file security.py.

00015 
00016     def __init__(self, message):
00017         auth = message.Auth()
00018         import arc
00019         xml = auth.Export(arc.SecAttr.ARCAuth)
00020         subject = xml.Get('RequestItem').Get('Subject')
00021         try:
00022             self.identity = str(subject.XPathLookup('//ra:SubjectAttribute[@AttributeId="%s"]' % identity_type, arc.NS({'ra':request_ns}))[0])
00023         except:
00024             # if there is no identity in the auth object (e.g. if not using TLS)
00025             self.identity = anonymous_user
00026             identity_node = subject.NewChild('ra:SubjectAttribute',arc.NS({'ra':request_ns}))
00027             identity_node.Set(self.identity)
00028             identity_node.NewAttribute('AttributeId').Set(identity_type)
00029             identity_node.NewAttribute('Type').Set('string')
00030         try:
00031             self.ca = str(subject.XPathLookup('//ra:SubjectAttribute[@AttributeId="%s"]' % ca_type, arc.NS({'ra':request_ns}))[0])
00032         except:
00033             self.ca = ''
00034         self.subject = subject.GetXML()
    

Member Function Documentation

Definition at line 48 of file security.py.

00048 
00049     def __str__(self): 
00050         return self.subject
00051     
00052 
            

Definition at line 42 of file security.py.

00042 
00043     def get_identity(self):
00044         return self.identity

Definition at line 45 of file security.py.

00045 
00046     def get_identity_and_ca(self):
00047         return self.identity, self.ca
            
def arcom.security.AuthRequest.get_request (   self,
  action,
  format = 'ARCAuth' 
)

Definition at line 35 of file security.py.

00035 
00036     def get_request(self, action, format = 'ARCAuth'):
00037         if format not in ['ARCAuth']:
00038             raise Exception, 'Unsupported format %s' % format
00039         if format == 'ARCAuth':
00040             return '<Request xmlns="%s">\n  <RequestItem>\n%s\n%s  </RequestItem>\n</Request>' % \
00041                 (request_ns, self.subject, '    <Action AttributeId="%s" Type="string">%s</Action>\n' % (storage_action_type, action))
            

Member Data Documentation

Definition at line 30 of file security.py.

Definition at line 21 of file security.py.

Definition at line 33 of file security.py.


The documentation for this class was generated from the following file: