Changeset 6902
- Timestamp:
- 28/05/10 13:04:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/ndg_saml/ndg/saml/saml2/core.py
r6901 r6902 685 685 class AuthzDecisionStatement(Statement): 686 686 '''SAML 2.0 Core AuthzDecisionStatement. Currently implemented in abstract 687 form only''' 687 form only 688 689 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name 690 @type DEFAULT_ELEMENT_LOCAL_NAME: string 691 @cvar DEFAULT_ELEMENT_NAME: Default element name 692 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 693 @cvar TYPE_LOCAL_NAME: Local name of the XSI type 694 @type TYPE_LOCAL_NAME: string 695 @cvar TYPE_NAME: QName of the XSI type 696 @type TYPE_NAME: ndg.saml.common.xml.QName 697 @cvar RESOURCE_ATTRIB_NAME: Resource attribute name 698 @type RESOURCE_ATTRIB_NAME: string 699 @cvar DECISION_ATTRIB_NAME: Decision attribute name 700 @type DECISION_ATTRIB_NAME: string 701 702 @ivar __resource: identifier for the resource which is the subject of the 703 authorisation statement 704 @type __resource: basestring 705 @ivar __decision: decision type for this authorisation statement 706 @type __decision: ndg.saml.saml2.core.DecisionType 707 @ivar __actions: list of ndg.saml.saml2.core.Action elements 708 @type __actions: ndg.saml.utils.TypedList 709 @ivar __evidence: evidence (not currently implemented) 710 @type __evidence: None 711 @ivar __normalizeResource: set to True to normalize the URI object attribute 712 in the set property method (functionality likely to be deprecated) 713 @type __normalizeResource: bool 714 @ivar __safeNormalizationChars: acceptable characters for normalizing URIs 715 (functionality likely to be deprecated) 716 @type __safeNormalizationChars: string 717 ''' 688 718 689 719 # Element local name … … 715 745 '__evidence', 716 746 '__normalizeResource', 717 '__safeNormalizationChars') 747 '__safeNormalizationChars' 748 ) 718 749 719 750 def __init__(self, … … 722 753 **kw): 723 754 '''Create new authorisation decision statement 755 @param normalizeResource: set to True to normalize the URI object 756 attribute in the set property method (functionality likely to be 757 deprecated) 758 @type normalizeResource: bool 759 @param safeNormalizationChars: acceptable characters for normalizing 760 URIs (functionality likely to be deprecated) 761 @type safeNormalizationChars: string 762 @param **kw: keywords for the initialisation of the parent classes' 763 attributes 764 @type **kw: dict 724 765 ''' 725 766 super(AuthzDecisionStatement, self).__init__(**kw) … … 755 796 756 797 def _getNormalizeResource(self): 798 '''Get normalise resource flag 799 @return: flag value 800 @rtype: bool 801 ''' 757 802 return self.__normalizeResource 758 803 759 804 def _setNormalizeResource(self, value): 805 '''Set normalise resource flag 806 @param value: flag value 807 @type value: bool 808 @raise TypeError: input value is incorrect type 809 ''' 760 810 if not isinstance(value, bool): 761 811 raise TypeError('Expecting bool type for "normalizeResource" ' … … 772 822 773 823 def _getSafeNormalizationChars(self): 824 '''Get normalisation safe chars 825 @return: normalisation safe chars 826 @rtype value: basetring 827 ''' 774 828 return self.__safeNormalizationChars 775 829 776 830 def _setSafeNormalizationChars(self, value): 831 '''Set normalisation safe chars 832 @param value: normalisation safe chars 833 @type value: basetring 834 @raise TypeError: input value is incorrect type 835 ''' 777 836 if not isinstance(value, basestring): 778 837 raise TypeError('Expecting string type for "normalizeResource" ' … … 792 851 793 852 def _getResource(self): 794 '''Gets the Resource attrib value of this query. 795 796 @return: the Resource attrib value of this query''' 853 '''Gets the Resource attrib value of this statement. 854 855 @return: the Resource attrib value of this statement 856 @rtype: basestring 857 ''' 797 858 return self.__resource 798 859 799 860 def _setResource(self, value): 800 '''Sets the Resource attrib value of this querynormalizing the path861 '''Sets the Resource attrib value of this statement normalizing the path 801 862 component, removing spurious port numbers (80 for HTTP and 443 for 802 863 HTTPS) and converting the host component to lower case. 803 864 804 @param value: the new Resource attrib value of this query''' 865 @param value: the new Resource attrib value of this statement 866 @type: basestring 867 @raise TypeError: input value is incorrect type 868 ''' 805 869 if not isinstance(value, basestring): 806 870 raise TypeError('Expecting string type for "resource" attribute; ' … … 850 914 851 915 @param value: the decision of the authorization request 916 @raise TypeError: input value is incorrect type 852 917 ''' 853 918 if not isinstance(value, DecisionType): … … 863 928 '''The actions for which authorisation is requested 864 929 865 @return: the Actions of this statement''' 930 @return: the Actions of this statement 931 @rtype: TypedList 932 ''' 866 933 return self.__actions 867 934 868 935 def _getEvidence(self): 869 '''Gets the Evidence of this statement. 870 871 @return: the Evidence of this statement''' 936 '''Gets the Evidence of this statement. Evidence attribute 937 functionality is not currently implemented in this class 938 939 @return: the Evidence of this statement 940 @rtype: None''' 872 941 return self.__evidence 873 942 874 943 def _setEvidence(self, value): 875 '''Sets the Evidence of this query. 876 @param newEvidence: the new Evidence of this statement''' 944 '''Sets the Evidence of this statement. Evidence attribute 945 functionality is not currently implemented in this class 946 947 @param value: the new Evidence of this statement 948 @type value: None 949 @raise TypeError: input value is incorrect type 950 ''' 877 951 if not isinstance(value, Evidence): 878 952 raise TypeError('Expecting Evidence type for "evidence" ' … … 886 960 887 961 def getOrderedChildren(self): 962 """Get ordered children 963 @return: list actions and evidence for this statement 964 @rtype: tuple 965 """ 888 966 children = [] 889 967 … … 904 982 905 983 class Subject(SAMLObject): 906 '''Concrete implementation of @link org.opensaml.saml2.core.Subject.''' 984 '''Implementation of SAML 2.0 Subject 985 986 @cvar DEFAULT_ELEMENT_LOCAL_NAME: Element local name. 987 @type DEFAULT_ELEMENT_LOCAL_NAME: string 988 @cvar DEFAULT_ELEMENT_NAME: Default element name. 989 @type DEFAULT_ELEMENT_NAME: ndg.saml.common.xml.QName 990 @cvar TYPE_LOCAL_NAME: Local name of the XSI type. 991 @type TYPE_LOCAL_NAME: string 992 @cvar TYPE_NAME: QName of the XSI type. 993 @type TYPE_NAME: ndg.saml.common.xml.QName 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: 1003 ''' 907 1004 908 1005 # Element local name. … … 921 1018 TYPE_LOCAL_NAME, 922 1019 SAMLConstants.SAML20_PREFIX) 1020 923 1021 __slots__ = ( 924 1022 '__baseID', … … 949 1047 @rtype: dict 950 1048 ''' 951 952 1049 _dict = super(Subject, self).__getstate__() 953 1050 for attrName in Subject.__slots__:
Note: See TracChangeset
for help on using the changeset viewer.