1 """SAML 2.0 bindings module implements SOAP binding for Authorisation Decision
2 query
3
4 NERC DataGrid Project
5 """
6 __author__ = "P J Kershaw"
7 __date__ = "12/02/10"
8 __copyright__ = "(C) 2009 Science and Technology Facilities Council"
9 __license__ = "http://www.apache.org/licenses/LICENSE-2.0"
10 __contact__ = "Philip.Kershaw@stfc.ac.uk"
11 __revision__ = '$Id: authzdecisionquery.py 8047 2012-03-28 09:46:29Z rwilkinson $'
12 import logging
13 log = logging.getLogger(__name__)
14
15 from M2Crypto.m2urllib2 import HTTPSHandler
16
17 from ndg.saml.saml2.core import AuthzDecisionQuery
18
19 from ndg.saml.saml2.binding.soap.client.subjectquery import (
20 SubjectQuerySOAPBinding,
21 SubjectQueryResponseError)
22
23
24
25 try:
26 from ndg.saml.utils.m2crypto import SSLContextProxy
27 _sslContextProxySupport = True
28
29 except ImportError:
30 _sslContextProxySupport = False
34 """SAML Response error from Attribute Query"""
35
38 """SAML Attribute Query SOAP Binding
39
40 Nb. Assumes X.509 subject type for query issuer
41 """
42 SERIALISE_KW = 'serialise'
43 DESERIALISE_KW = 'deserialise'
44 QUERY_TYPE = AuthzDecisionQuery
45 __slots__ = ()
46
61
64 """Specialisation of AuthzDecisionQuerySOAPbinding taking in the setting of
65 SSL parameters for mutual authentication
66 """
67 SSL_CONTEXT_PROXY_SUPPORT = _sslContextProxySupport
68 __slots__ = ('__sslCtxProxy',)
69
83
84 - def send(self, query, **kw):
90
91 @property
93 """SSL Context Proxy object used for setting up an SSL Context for
94 queries
95 """
96 return self.__sslCtxProxy
97
99 """Enable setting of SSLContextProxy attributes as if they were
100 attributes of this class. This is intended as a convenience for
101 making settings parameters read from a config file
102 """
103 try:
104 super(AuthzDecisionQuerySslSOAPBinding, self).__setattr__(name,
105 value)
106
107 except AttributeError, e:
108
109 try:
110 setattr(self.sslCtxProxy, name, value)
111 except:
112 raise e
113