Changeset 6906
- Timestamp:
- 28/05/10 14:58:47 (11 years ago)
- Location:
- TI12-security/trunk/ndg_saml/ndg/saml
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/ndg_saml/ndg/saml/common/xml.py
r6901 r6906 396 396 def _setPrefix(self, value): 397 397 """Set prefix 398 @param : prefix398 @param value: prefix 399 399 @type: string 400 400 @raise TypeError: invalid input value type -
TI12-security/trunk/ndg_saml/ndg/saml/saml2/core.py
r6902 r6906 993 993 @type TYPE_NAME: ndg.saml.common.xml.QName 994 994 995 @ivar __baseID: 996 @type __baseID: 997 @ivar __nameID: 998 @type __nameID: 999 @ivar __encryptedID: 1000 @type __encryptedID: 1001 @ivar __subjectConfirmations: 1002 @type __subjectConfirmations: 995 @ivar __baseID: base identifier 996 @type __baseID: basestring 997 @ivar __nameID: name identifier 998 @type __nameID: basestring 999 @ivar __encryptedID: encrypted identifier 1000 @type __encryptedID: any - not implemented for type checking 1001 @ivar __subjectConfirmations: list of subject confirmations 1002 @type __subjectConfirmations: list 1003 1003 ''' 1004 1004 … … 1027 1027 1028 1028 def __init__(self, **kw): 1029 ''' 1030 @param **kw: keywords for initialisation of parent class attributes 1031 @type **kw: dict 1032 ''' 1029 1033 super(Subject, self).__init__(**kw) 1030 1034 … … 1059 1063 1060 1064 def _getBaseID(self): 1065 """Get base identifier 1066 @return: base identifier 1067 @rtype: basestring 1068 """ 1061 1069 return self.__baseID 1062 1070 1063 1071 def _setBaseID(self, value): 1072 """Set base identifier 1073 @param: base identifier 1074 @type: basestring 1075 @raise TypeError: invalid input value type 1076 """ 1064 1077 if not isinstance(value, basestring): 1065 1078 raise TypeError("Expecting %r type for \"baseID\" got %r" % … … 1072 1085 1073 1086 def _getNameID(self): 1087 """Get name identifier 1088 @return: name identifier 1089 @rtype: basestring 1090 """ 1074 1091 return self.__nameID 1075 1092 1076 1093 def _setNameID(self, value): 1094 """Set name identifier 1095 @param: name identifier 1096 @type: basestring 1097 @raise TypeError: invalid input value type 1098 """ 1077 1099 if not isinstance(value, NameID): 1078 1100 raise TypeError("Expecting %r type for \"nameID\" got %r" % … … 1085 1107 1086 1108 def _getEncryptedID(self): 1109 """Get encrypted identifier 1110 @return: encrypted identifier 1111 @rtype: basestring 1112 """ 1087 1113 return self.__encryptedID 1088 1114 1089 1115 def _setEncryptedID(self, value): 1116 """Set encrypted identifier 1117 1118 @param: encrypted identifier 1119 @type: any type 1120 @raise TypeError: invalid input value type 1121 """ 1090 1122 self.__encryptedID = value 1091 1123 … … 1095 1127 1096 1128 def _getSubjectConfirmations(self): 1129 """Get list of subject confirmations 1130 @return: list of subject confirmations 1131 @rtype: list 1132 """ 1097 1133 return self.__subjectConfirmations 1098 1134 … … 1101 1137 1102 1138 def getOrderedChildren(self): 1139 """Get list containing base, name and encrypted IDs and the subject 1140 confirmations 1141 1142 @return: list of all child attributes 1143 @rtype: list 1144 """ 1103 1145 children = [] 1104 1146 … … 1118 1160 1119 1161 class AbstractNameIDType(SAMLObject): 1120 '''Abstract implementation of NameIDType''' 1162 '''Abstract implementation of NameIDType 1163 1164 @cvar SP_NAME_QUALIFIER_ATTRIB_NAME: SPNameQualifier attribute name. 1165 @type SP_NAME_QUALIFIER_ATTRIB_NAME: string 1166 @cvar FORMAT_ATTRIB_NAME: Format attribute name. 1167 @type FORMAT_ATTRIB_NAME: string 1168 @cvar SPPROVIDED_ID_ATTRIB_NAME: SPProviderID attribute name. 1169 @type SPPROVIDED_ID_ATTRIB_NAME: string 1170 @cvar UNSPECIFIED: URI for unspecified name format. 1171 @type UNSPECIFIED: string 1172 @cvar EMAIL: URI for email name format. 1173 @type EMAIL: string 1174 @cvar X509_SUBJECT: URI for X509 subject name format. 1175 @type X509_SUBJECT: string 1176 @cvar WIN_DOMAIN_QUALIFIED: URI for windows domain qualified name name 1177 format. 1178 @type WIN_DOMAIN_QUALIFIED: string 1179 @cvar KERBEROS: URI for kerberos name format. 1180 @type KERBEROS: string 1181 @cvar ENTITY: URI for SAML entity name format. 1182 @type ENTITY: string 1183 @cvar PERSISTENT: URI for persistent name format. 1184 @type PERSISTENT: string 1185 @cvar TRANSIENT: URI for transient name format. 1186 @type TRANSIENT: string 1187 @cvar ENCRYPTED: Special URI used by NameIDPolicy to indicate a NameID 1188 should be encrypted 1189 @type ENCRYPTED: string 1190 1191 @ivar __name: Name of the Name ID. 1192 @type __name: string 1193 @ivar __nameQualifier: Name Qualifier of the Name ID. 1194 @type __nameQualifier: string 1195 @ivar __spNameQualifier: SP Name Qualifier of the Name ID. 1196 @type __spNameQualifier: string 1197 @ivar __format: Format of the Name ID. 1198 @type __format: string 1199 @ivar __spProvidedID: SP ProvidedID of the NameID. 1200 @type __spProvidedID: string 1201 ''' 1121 1202 1122 1203 # SPNameQualifier attribute name. … … 1167 1248 1168 1249 def __init__(self, **kw): 1169 '''@param namespaceURI: the namespace the element is in 1170 @param elementLocalName: the local name of the XML element this Object 1171 represents 1172 @param namespacePrefix: the prefix for the given namespace 1250 ''' 1251 @param **kw: keywords to set attributes of parent class 1252 @type **kw: dict 1173 1253 ''' 1174 1254 super(AbstractNameIDType, self).__init__(**kw) … … 1210 1290 1211 1291 def _getValue(self): 1292 """Get name value 1293 @return: name value 1294 @rtype: string 1295 """ 1212 1296 return self.__value 1213 1297 1214 1298 def _setValue(self, value): 1299 """Set name value 1300 @param: name value 1301 @type: string 1302 @raise TypeError: invalid input value type 1303 """ 1215 1304 if not isinstance(value, basestring): 1216 1305 raise TypeError("\"value\" must be a basestring derived type, " … … 1222 1311 1223 1312 def _getNameQualifier(self): 1313 """Get name qualifier 1314 @return: name qualifier 1315 @rtype: string 1316 """ 1224 1317 return self.__nameQualifier 1225 1318 1226 1319 def _setNameQualifier(self, value): 1320 """Set name qualifier 1321 @param: name qualifier 1322 @type: string 1323 """ 1227 1324 self.__nameQualifier = value 1228 1325 … … 1232 1329 1233 1330 def _getSPNameQualifier(self): 1331 """Get SP name qualifier 1332 @return: SP name qualifier 1333 @rtype: string 1334 """ 1234 1335 return self.__spNameQualifier 1235 1336 1236 1337 def _setSPNameQualifier(self, value): 1338 """Set SP name qualifier 1339 @param: SP name qualifier 1340 @type: string 1341 """ 1237 1342 self.__spNameQualifier = value 1238 1343 … … 1242 1347 1243 1348 def _getFormat(self): 1349 """Get name format 1350 @return: name format 1351 @rtype: string 1352 """ 1244 1353 return self.__format 1245 1354 1246 1355 def _setFormat(self, format): 1356 """Set name format 1357 @param: name format 1358 @type: string 1359 @raise TypeError: invalid input value type 1360 """ 1247 1361 if not isinstance(format, basestring): 1248 1362 raise TypeError("\"format\" must be a basestring derived type, " … … 1254 1368 1255 1369 def _getSPProvidedID(self): 1370 """Get SP provided identifier 1371 @return: SP provided identifier 1372 @rtype: string 1373 """ 1256 1374 return self.__spProvidedID 1257 1375 1258 1376 def _setSPProvidedID(self, value): 1377 """Set SP provided identifier 1378 @param: SP provided identifier 1379 @type: string 1380 """ 1259 1381 self.__spProvidedID = value 1260 1382 … … 1263 1385 1264 1386 def getOrderedChildren(self): 1387 """Get attributes as a list - not currently implemented 1388 @return: list of object attribute values 1389 @rtype: tuple 1390 @raise NotImplementedError: not implemented in this version 1391 """ 1265 1392 raise NotImplementedError() 1266 1393 1267 1394 1268 1395 class Issuer(AbstractNameIDType): 1269 """SAML 2.0 Core Issuer type""" 1396 """SAML 2.0 Core Issuer type 1397 1398 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 1399 @type DEFAULT_ELEMENT_LOCAL_NAME: string 1400 @cvar DEFAULT_ELEMENT_NAME: Default element name. 1401 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 1402 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 1403 @type TYPE_LOCAL_NAME: string 1404 @cvar TYPE_NAME: Qualified Name of the XSI type. 1405 @type TYPE_NAME: ndg.saml.common.xml.QName 1406 """ 1270 1407 1271 1408 # Element local name. … … 1289 1426 1290 1427 class NameID(AbstractNameIDType): 1291 '''SAML 2.0 Core NameID''' 1428 '''SAML 2.0 Core NameID 1429 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 1430 @type DEFAULT_ELEMENT_LOCAL_NAME: string 1431 @cvar DEFAULT_ELEMENT_NAME: Default element name. 1432 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 1433 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 1434 @type TYPE_LOCAL_NAME: string 1435 @cvar TYPE_NAME: Qualified Name of the XSI type. 1436 @type TYPE_NAME: ndg.saml.common.xml.QName 1437 ''' 1438 1292 1439 # Element local name. 1293 1440 DEFAULT_ELEMENT_LOCAL_NAME = "NameID" … … 1310 1457 1311 1458 class Conditions(SAMLObject): 1312 '''SAML 2.0 Core Conditions.''' 1459 '''SAML 2.0 Core Conditions. 1460 1461 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 1462 @type DEFAULT_ELEMENT_LOCAL_NAME: string 1463 @cvar DEFAULT_ELEMENT_NAME: Default element name. 1464 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 1465 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 1466 @type TYPE_LOCAL_NAME: string 1467 @cvar TYPE_NAME: Qualified Name of the XSI type. 1468 @type TYPE_NAME: ndg.saml.common.xml.QName 1469 @cvar NOT_BEFORE_ATTRIB_NAME: NotBefore attribute name. 1470 @type NOT_BEFORE_ATTRIB_NAME: string 1471 @cvar NOT_ON_OR_AFTER_ATTRIB_NAME: NotOnOrAfter attribute name. 1472 @type NOT_ON_OR_AFTER_ATTRIB_NAME: string 1473 1474 @ivar self.__conditions: A list of Conditions. 1475 @type self.__conditions: list 1476 @ivar self.__notBefore: Not Before condition 1477 @type self.__notBefore: NoneType / datetime.datetime 1478 @ivar self.__notOnOrAfter: Not On Or After conditions. 1479 @type self.__notOnOrAfter: NoneType / datetime.datetime 1480 ''' 1313 1481 1314 1482 # Element local name. … … 1343 1511 super(Conditions, self).__init__(**kw) 1344 1512 1345 # A Condition.1513 # A list of Conditions 1346 1514 self.__conditions = [] 1347 1515 1348 # Not Before conditions.1516 # Not Before time condition 1349 1517 self.__notBefore = None 1350 1518 1351 # Not On Or After conditions.1519 # Not On Or After time conditions 1352 1520 self.__notOnOrAfter = None 1353 1521 … … 1358 1526 @rtype: dict 1359 1527 ''' 1360 1361 1528 _dict = super(Conditions, self).__getstate__() 1362 1529 for attrName in Conditions.__slots__: … … 1373 1540 '''Get the date/time before which the assertion is invalid. 1374 1541 1375 @return: the date/time before which the assertion is invalid''' 1542 @return: the date/time before which the assertion is invalid 1543 @rtype: NoneType / datetime.datetime 1544 ''' 1376 1545 return self.__notBefore 1377 1546 … … 1380 1549 1381 1550 @param value: the date/time before which the assertion is invalid 1551 @type: datetime.datetime 1382 1552 ''' 1383 1553 if not isinstance(value, datetime): … … 1390 1560 1391 1561 @return: the date/time on, or after, which the assertion is invalid' 1562 @rtype: NoneType / datetime.datetime 1392 1563 ''' 1393 1564 return self.__notOnOrAfter … … 1398 1569 @param value: the date/time on, or after, which the assertion 1399 1570 is invalid 1571 @type: datetime.datetime 1400 1572 ''' 1401 1573 if not isinstance(value, datetime): … … 1415 1587 1416 1588 @return: all the conditions on the assertion 1589 @rtype: list 1417 1590 ''' 1418 1591 return self.__conditions 1419 1592 1420 1593 def _getAudienceRestrictions(self): 1421 '''Get sthe audience restriction conditions for the assertion.1594 '''Get the audience restriction conditions for the assertion. 1422 1595 1423 1596 @return: the audience restriction conditions for the assertion 1597 @rtype: list 1598 @raise NotImplementedError: not currently implemented 1424 1599 ''' 1425 1600 raise NotImplementedError() 1426 1601 1427 1602 def _getOneTimeUse(self): 1428 '''Get s the OneTimeUse condition for the assertion.1603 '''Get the OneTimeUse condition for the assertion 1429 1604 1430 1605 @return: the OneTimeUse condition for the assertion 1606 @rtype: ? 1607 @raise NotImplementedError: not currently implemented 1431 1608 ''' 1432 1609 raise NotImplementedError() 1433 1610 1434 1611 def _getProxyRestriction(self): 1435 '''Get s the ProxyRestriction condition for the assertion.1612 '''Get the ProxyRestriction condition for the assertion 1436 1613 1437 1614 @return: the ProxyRestriction condition for the assertion 1615 @rtype: ? 1616 @raise NotImplementedError: not currently implemented 1438 1617 ''' 1439 1618 raise NotImplementedError() … … 1441 1620 1442 1621 class Advice(SAMLObject): 1443 '''SAML 2.0 Core Advice. 1622 '''SAML 2.0 Core Advice. Only the skeleton of this class is implemented 1623 1624 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 1625 @type DEFAULT_ELEMENT_LOCAL_NAME: string 1626 @cvar DEFAULT_ELEMENT_NAME: Default element name. 1627 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 1628 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 1629 @type TYPE_LOCAL_NAME: string 1444 1630 ''' 1445 1631 … … 1467 1653 1468 1654 @return: the list of all child elements attached to this advice 1655 @rtype: list 1656 @raise NotImplementedError: not currently implemented 1469 1657 ''' 1470 1658 raise NotImplementedError() … … 1474 1662 1475 1663 @return: the list of AssertionID references used as advice 1664 @rtype: list 1665 @raise NotImplementedError: not currently implemented 1476 1666 ''' 1477 1667 raise NotImplementedError() … … 1481 1671 1482 1672 @return: the list of AssertionURI references used as advice 1673 @rtype: list 1674 @raise NotImplementedError: not currently implemented 1483 1675 ''' 1484 1676 raise NotImplementedError() … … 1488 1680 1489 1681 @return: the list of Assertions used as advice 1682 @rtype: list 1683 @raise NotImplementedError: not currently implemented 1490 1684 ''' 1491 1685 raise NotImplementedError() … … 1495 1689 1496 1690 @return: the list of EncryptedAssertions used as advice 1691 @rtype: list 1692 @raise NotImplementedError: not currently implemented 1497 1693 ''' 1498 1694 raise NotImplementedError() … … 1501 1697 class Assertion(SAMLObject): 1502 1698 """SAML 2.0 Attribute Assertion for use with NERC DataGrid 1503 """ 1699 1700 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 1701 @type DEFAULT_ELEMENT_LOCAL_NAME: string 1702 @cvar DEFAULT_ELEMENT_NAME: Default element name. 1703 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 1704 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 1705 @type TYPE_LOCAL_NAME: string 1706 @cvar TYPE_NAME: QName of the XSI type. 1707 @type TYPE_NAME: ndg.saml.common.xml.QName 1708 @cvar VERSION_ATTRIB_NAME: Version attribute name. 1709 @type VERSION_ATTRIB_NAME: string 1710 @cvar ISSUE_INSTANT_ATTRIB_NAME: IssueInstant attribute name. 1711 @type ISSUE_INSTANT_ATTRIB_NAME: string 1712 @cvar ID_ATTRIB_NAME: ID attribute name. 1713 @type ID_ATTRIB_NAME: string 1714 1715 @ivar __version: SAML version used 1716 @type __version: ndg.saml.common.SAMLVersion 1717 @ivar __issueInstant: issue instant for assertion 1718 @type __issueInstant: datetime.datetime 1719 @ivar __id: assertion identifier 1720 @type __id: string 1721 @ivar __issuer: issuer of this assertion 1722 @type __issuer: ndg.saml.saml2.core.Issuer 1723 @ivar __subject: subject of this assertion 1724 @type __subject: ndg.saml.saml2.core.Subject 1725 @ivar __conditions: conditions for this assertion 1726 @type __conditions: ndg.saml.saml2.core.Conditions 1727 @ivar __advice: advice statement 1728 @type __advice: string 1729 @ivar __statements: asserted statements 1730 @type __statements: ndg.saml.utils.TypedList 1731 @ivar __authnStatements: asserted authentication statements 1732 @type __authnStatements: list 1733 @ivar __authzDecisionStatements: asserted authorization decision statements 1734 @type __authzDecisionStatements: ndg.saml.utils.TypedList 1735 @ivar __attributeStatements: asserted attribute statements 1736 @type __attributeStatements: ndg.saml.utils.TypedList 1737 """ 1738 1504 1739 # Element local name. 1505 1740 DEFAULT_ELEMENT_LOCAL_NAME = "Assertion" … … 1554 1789 self.__statements = TypedList(Statement) 1555 1790 1556 # TODO: Implement AuthnStatement and AuthzDecisionStatement classes1791 # TODO: Implement AuthnStatement class 1557 1792 self.__authnStatements = [] 1558 1793 self.__authzDecisionStatements = TypedList(AuthzDecisionStatement) … … 1565 1800 @rtype: dict 1566 1801 ''' 1567 1568 1802 _dict = super(Assertion, self).__getstate__() 1569 1803 for attrName in Assertion.__slots__: … … 1578 1812 1579 1813 def _get_version(self): 1580 '''@return: the SAML Version of this assertion. 1814 ''' 1815 @return: the SAML Version of this assertion 1816 @rtype: ndg.saml.common.SAMLVersion/NoneType 1581 1817 ''' 1582 1818 return self.__version 1583 1819 1584 1820 def _set_version(self, version): 1585 '''@param version: the SAML Version of this assertion 1821 ''' 1822 @param version: the SAML Version of this assertion 1823 @type version: ndg.saml.common.SAMLVersion 1824 @raise TypeError: incorrect type for input value 1586 1825 ''' 1587 1826 if not isinstance(version, SAMLVersion): … … 1598 1837 '''Gets the issue instance of this assertion. 1599 1838 1600 @return: the issue instance of this assertion''' 1839 @return: the issue instance of this assertion 1840 @rtype: datetime.datetime/NoneType 1841 ''' 1601 1842 return self.__issueInstant 1602 1843 … … 1605 1846 1606 1847 @param issueInstant: the issue instance of this assertion 1848 @type issueInstant: datetime.datetime/NoneType 1849 @raise TypeError: incorrect type for input value 1607 1850 ''' 1608 1851 if not isinstance(issueInstant, datetime): … … 1617 1860 1618 1861 def _get_id(self): 1619 ''' Sets the ID of this assertion.1862 '''Get the ID of this assertion 1620 1863 1621 1864 @return: the ID of this assertion 1865 @rtype: basestring/NoneType 1622 1866 ''' 1623 1867 return self.__id 1624 1868 1625 1869 def _set_id(self, _id): 1626 '''Set s the ID of this assertion.1870 '''Set the ID of this assertion 1627 1871 1628 1872 @param _id: the ID of this assertion 1873 @type _id: basestring 1874 @raise TypeError: incorrect type for input value 1629 1875 ''' 1630 1876 if not isinstance(_id, basestring): … … 1636 1882 1637 1883 def _set_issuer(self, issuer): 1638 """Set issuer""" 1884 """Set issuer 1885 @param issuer: issuer of the assertion 1886 @type issuer: ndg.saml.saml2.core.Issuer 1887 @raise TypeError: incorrect type for input value 1888 """ 1639 1889 if not isinstance(issuer, Issuer): 1640 1890 raise TypeError("issuer must be %r, got %r" % (Issuer, … … 1643 1893 1644 1894 def _get_issuer(self): 1645 """Get the issuer name """ 1895 """Get the issuer name 1896 @return: issuer name 1897 @rtype: ndg.saml.saml2.core.Issuer 1898 """ 1646 1899 return self.__issuer 1647 1900 … … 1651 1904 1652 1905 def _set_subject(self, subject): 1653 """Set subject string.""" 1906 """Set subject string 1907 @param subject: subject of this assertion 1908 @type subject: ndg.saml.saml2.core.Subject 1909 @raise TypeError: incorrect type for input value""" 1654 1910 if not isinstance(subject, Subject): 1655 1911 raise TypeError("subject must be %r, got %r" % (Subject, … … 1659 1915 1660 1916 def _get_subject(self): 1661 """Get subject string.""" 1917 """Get subject string 1918 1919 @return: subject of this assertion 1920 @rtype subject: ndg.saml.saml2.core.Subject 1921 """ 1662 1922 return self.__subject 1663 1923 … … 1667 1927 1668 1928 def _get_conditions(self): 1669 """Get conditions string.""" 1929 """Get conditions 1930 @return: conditions for this assertion 1931 @rtype: ndg.saml.saml2.core.Conditions 1932 """ 1670 1933 return self.__conditions 1671 1934 1672 1935 def _set_conditions(self, value): 1673 """Get conditions string.""" 1936 """Set conditions 1937 @param value: conditions for this assertion 1938 @type value: ndg.saml.saml2.core.Conditions 1939 @raise TypeError: incorrect type for input value""" 1674 1940 if not isinstance(value, Conditions): 1675 1941 raise TypeError("Conditions must be %r, got %r" % (Conditions, … … 1683 1949 1684 1950 def _set_advice(self, advice): 1685 """Set advice string.""" 1951 """Set advice string 1952 1953 @param advice: advice for this assertion 1954 @type advice: basestring 1955 @raise TypeError: incorrect type for input value""" 1686 1956 if not isinstance(advice, basestring): 1687 1957 raise TypeError("advice must be a string") … … 1690 1960 1691 1961 def _get_advice(self): 1692 """Get advice string.""" 1962 """Get advice string 1963 1964 @return: advice for this assertion 1965 @rtype: basestring 1966 """ 1693 1967 return self.__advice 1694 1968 … … 1699 1973 @property 1700 1974 def statements(self): 1701 """Attribute Assertion statements""" 1975 """Assertion statements 1976 1977 @return: list of assertion statements 1978 @rtype: ndg.saml.utils.TypedList 1979 """ 1702 1980 return self.__statements 1703 1981 1704 1982 @property 1705 1983 def authnStatements(self): 1706 """Attribute Assertion authentication""" 1984 """Attribute Assertion authentication 1985 1986 @return: list of assertion statements 1987 @rtype: ndg.saml.utils.TypedList 1988 """ 1707 1989 return self.__authnStatements 1708 1990 1709 1991 @property 1710 1992 def authzDecisionStatements(self): 1711 """Attribute Assertion authorisation decision statements""" 1993 """Attribute Assertion authorisation decision statements 1994 1995 @return: list of assertion statements 1996 @rtype: ndg.saml.utils.TypedList 1997 """ 1712 1998 return self.__authzDecisionStatements 1713 1999 1714 2000 @property 1715 2001 def attributeStatements(self): 1716 """Attribute Assertion attribute statements""" 2002 """Attribute Assertion attribute statements 2003 2004 @return: list of assertion statements 2005 @rtype: ndg.saml.utils.TypedList 2006 """ 1717 2007 return self.__attributeStatements 1718 2008 1719 2009 1720 2010 class AttributeValue(SAMLObject): 1721 """Base class for Attribute Value type""" 2011 """Base class for Attribute Value type 2012 2013 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element name, no namespace 2014 @type DEFAULT_ELEMENT_LOCAL_NAME: string 2015 @cvar DEFAULT_ELEMENT_NAME: Default element name 2016 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 2017 """ 1722 2018 1723 2019 # Element name, no namespace … … 1732 2028 1733 2029 class XSStringAttributeValue(AttributeValue): 1734 """XML XS:String Attribute Value type""" 2030 """XML XS:String Attribute Value type 2031 2032 @cvar TYPE_LOCAL_NAME: Local name of the XSI type 2033 @type TYPE_LOCAL_NAME: string 2034 @cvar TYPE_NAME: QName of the XSI type 2035 @type TYPE_NAME: ndg.saml.common.xml.QName 2036 2037 @ivar __value: value of this attribute 2038 @type __value: basestring 2039 """ 1735 2040 1736 2041 # Local name of the XSI type … … 1747 2052 1748 2053 def __init__(self, **kw): 2054 """ 2055 @param **kw: keywords for setting attributes of parent class 2056 @type **kw: dict 2057 """ 1749 2058 super(XSStringAttributeValue, self).__init__(**kw) 1750 2059 self.__value = None … … 1756 2065 @rtype: dict 1757 2066 ''' 1758 1759 2067 _dict = super(XSStringAttributeValue, self).__getstate__() 1760 2068 for attrName in XSStringAttributeValue.__slots__: … … 1769 2077 1770 2078 def _getValue(self): 2079 """Set value of XS string 2080 @return: value of string to assign 2081 @rtype: string 2082 """ 1771 2083 return self.__value 1772 2084 1773 2085 def _setValue(self, value): 2086 """Set value of XS string 2087 @param: value 2088 @type: string 2089 @raise TypeError: invalid input value type 2090 """ 1774 2091 if not isinstance(value, basestring): 1775 2092 raise TypeError("Input must be a basestring derived type, got %r" % … … 1782 2099 1783 2100 class StatusDetail(SAMLObject): 1784 '''Implementation of SAML 2.0 StatusDetail''' 2101 '''Implementation of SAML 2.0 StatusDetail 2102 2103 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Local Name of StatusDetail. 2104 @type DEFAULT_ELEMENT_LOCAL_NAME: string 2105 @cvar DEFAULT_ELEMENT_NAME: Default element name. 2106 @type DEFAULT_ELEMENT_NAME: string 2107 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 2108 @type TYPE_LOCAL_NAME: string 2109 @cvar TYPE_NAME: QName of the XSI type. 2110 @type TYPE_NAME: string 2111 2112 @ivar __unknownChildren: unknown child elements 2113 @type __unknownChildren: ndg.saml.common.SAMLObject 2114 2115 ''' 1785 2116 1786 2117 # Local Name of StatusDetail. … … 1803 2134 1804 2135 def __init__(self, **kw): 2136 """ 2137 @param **kw: keywords for setting attributes of parent class 2138 @type **kw: dict 2139 """ 1805 2140 super(StatusDetail, self).__init__(**kw) 1806 2141 … … 1826 2161 return _dict 1827 2162 1828 def getUnknownXMLTypes(self, qname=None): 2163 def getUnknownXMLTypes(self, qname=None): 2164 """Retrieve unknown child attributes 2165 2166 This is untested 2167 @param qname: qualified name for matching types to be retrieved 2168 @type qname: ndg.saml.common.xml.QName 2169 @raise TypeError: incorrect type for qname keyword 2170 """ 1829 2171 if qname is not None: 1830 2172 if not isinstance(qname, QName):
Note: See TracChangeset
for help on using the changeset viewer.