Package ndg :: Package saml :: Package test :: Module test_saml :: Class SAMLUtil
[hide private]

Class SAMLUtil

source code


SAML utility class based on ANL examples for Earth System Grid: http://www.ci.uchicago.edu/wiki/bin/view/ESGProject/ESGSAMLAttributes#ESG_Attribute_Service

Instance Methods [hide private]
 
__init__(self)
Set-up ESG core attributes, Group/Role and miscellaneous attributes lists
source code
 
addAttribute(self, name, value)
Add a generic attribute
source code
ndg.security.common.saml.Assertion
buildAssertion(self)
Create a SAML Assertion containing ESG core attributes: First Name, Last Name, e-mail Address; ESG Group/Role type attributes and generic attributes
source code
 
buildAttributeQuery(self, issuer, subjectNameID)
Make a SAML Attribute Query
source code
 
createAttributes(self)
Create SAML Attributes for use in an Assertion or AttributeQuery
source code
 
buildAuthzDecisionQuery(self, issuer='/O=NDG/OU=BADC/CN=attributeauthority.badc.rl.ac.uk', issuerFormat='urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName', subjectNameID='https://openid.localhost/philip.kershaw', subjectNameIdFormat='urn:esg:openid', resource='http://LOCALHOST:80/My Secured URI', actions=(('GET', 'urn:oasis:names:tc:SAML:1.0:action:ghpp')))
Convenience utility to make an Authorisation decision query
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  NAMEID_FORMAT = 'urn:esg:openid'
  NAMEID_VALUE = 'https://openid.localhost/philip.kershaw'
  ISSUER_DN = '/O=NDG/OU=BADC/CN=attributeauthority.badc.rl.ac.uk'
  UNCORRECTED_RESOURCE_URI = 'http://LOCALHOST:80/My Secured URI'
  RESOURCE_URI = 'http://localhost/My%20Secured%20URI'
  XSSTRING_NS = 'http://www.w3.org/2001/XMLSchema#string'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Set-up ESG core attributes, Group/Role and miscellaneous attributes lists

Overrides: object.__init__

addAttribute(self, name, value)

source code 

Add a generic attribute

Parameters:
  • name (basestring) - attribute name
  • value (basestring) - attribute value

buildAssertion(self)

source code 

Create a SAML Assertion containing ESG core attributes: First Name, Last Name, e-mail Address; ESG Group/Role type attributes and generic attributes

Returns: ndg.security.common.saml.Assertion
new SAML Assertion object

buildAttributeQuery(self, issuer, subjectNameID)

source code 

Make a SAML Attribute Query

Parameters:
  • issuer (basestring) - attribute issuer name
  • subjectNameID (basestring) - identity to query attributes for