@@ -33,13 +33,13 @@ def __init__(self, settings, response=None):
3333 * (string) response. An UUEncoded SAML Logout
3434 response from the IdP.
3535 """
36- self .__settings = settings
37- self .__error = None
36+ self ._settings = settings
37+ self ._error = None
3838 self .id = None
3939
4040 if response is not None :
41- self .__logout_response = compat .to_string (OneLogin_Saml2_Utils .decode_base64_and_inflate (response , ignore_zip = True ))
42- self .document = OneLogin_Saml2_XML .to_etree (self .__logout_response )
41+ self ._logout_response = compat .to_string (OneLogin_Saml2_Utils .decode_base64_and_inflate (response , ignore_zip = True ))
42+ self .document = OneLogin_Saml2_XML .to_etree (self ._logout_response )
4343 self .id = self .document .get ('ID' , None )
4444
4545 def get_issuer (self ):
@@ -49,7 +49,7 @@ def get_issuer(self):
4949 :rtype: string
5050 """
5151 issuer = None
52- issuer_nodes = self .__query ('/samlp:LogoutResponse/saml:Issuer' )
52+ issuer_nodes = self ._query ('/samlp:LogoutResponse/saml:Issuer' )
5353 if len (issuer_nodes ) == 1 :
5454 issuer = OneLogin_Saml2_XML .element_text (issuer_nodes [0 ])
5555 return issuer
@@ -60,7 +60,7 @@ def get_status(self):
6060 :return: The Status
6161 :rtype: string
6262 """
63- entries = self .__query ('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode' )
63+ entries = self ._query ('/samlp:LogoutResponse/samlp:Status/samlp:StatusCode' )
6464 if len (entries ) == 0 :
6565 return None
6666 status = entries [0 ].attrib ['Value' ]
@@ -78,21 +78,21 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False):
7878 :return: Returns if the SAML LogoutResponse is or not valid
7979 :rtype: boolean
8080 """
81- self .__error = None
81+ self ._error = None
8282 try :
83- idp_data = self .__settings .get_idp_data ()
83+ idp_data = self ._settings .get_idp_data ()
8484 idp_entity_id = idp_data ['entityId' ]
8585 get_data = request_data ['get_data' ]
8686
87- if self .__settings .is_strict ():
88- res = OneLogin_Saml2_XML .validate_xml (self .document , 'saml-schema-protocol-2.0.xsd' , self .__settings .is_debug_active ())
87+ if self ._settings .is_strict ():
88+ res = OneLogin_Saml2_XML .validate_xml (self .document , 'saml-schema-protocol-2.0.xsd' , self ._settings .is_debug_active ())
8989 if isinstance (res , str ):
9090 raise OneLogin_Saml2_ValidationError (
9191 'Invalid SAML Logout Request. Not match the saml-schema-protocol-2.0.xsd' ,
9292 OneLogin_Saml2_ValidationError .INVALID_XML_FORMAT
9393 )
9494
95- security = self .__settings .get_security_data ()
95+ security = self ._settings .get_security_data ()
9696
9797 # Check if the InResponseTo of the Logout Response matches the ID of the Logout Request (requestId) if provided
9898 in_response_to = self .get_in_response_to ()
@@ -134,15 +134,15 @@ def is_valid(self, request_data, request_id=None, raise_exceptions=False):
134134 return True
135135 # pylint: disable=R0801
136136 except Exception as err :
137- self .__error = str (err )
138- debug = self .__settings .is_debug_active ()
137+ self ._error = str (err )
138+ debug = self ._settings .is_debug_active ()
139139 if debug :
140140 print (err )
141141 if raise_exceptions :
142142 raise
143143 return False
144144
145- def __query (self , query ):
145+ def _query (self , query ):
146146 """
147147 Extracts a node from the Etree (Logout Response Message)
148148 :param query: Xpath Expression
@@ -158,7 +158,7 @@ def build(self, in_response_to):
158158 :param in_response_to: InResponseTo value for the Logout Response.
159159 :type in_response_to: string
160160 """
161- sp_data = self .__settings .get_sp_data ()
161+ sp_data = self ._settings .get_sp_data ()
162162
163163 self .id = self ._generate_request_id ()
164164
@@ -168,13 +168,13 @@ def build(self, in_response_to):
168168 {
169169 'id' : self .id ,
170170 'issue_instant' : issue_instant ,
171- 'destination' : self .__settings .get_idp_slo_response_url (),
171+ 'destination' : self ._settings .get_idp_slo_response_url (),
172172 'in_response_to' : in_response_to ,
173173 'entity_id' : sp_data ['entityId' ],
174174 'status' : "urn:oasis:names:tc:SAML:2.0:status:Success"
175175 }
176176
177- self .__logout_response = logout_response
177+ self ._logout_response = logout_response
178178
179179 def get_in_response_to (self ):
180180 """
@@ -193,16 +193,16 @@ def get_response(self, deflate=True):
193193 :rtype: string
194194 """
195195 if deflate :
196- response = OneLogin_Saml2_Utils .deflate_and_base64_encode (self .__logout_response )
196+ response = OneLogin_Saml2_Utils .deflate_and_base64_encode (self ._logout_response )
197197 else :
198- response = OneLogin_Saml2_Utils .b64encode (self .__logout_response )
198+ response = OneLogin_Saml2_Utils .b64encode (self ._logout_response )
199199 return response
200200
201201 def get_error (self ):
202202 """
203203 After executing a validation process, if it fails this method returns the cause
204204 """
205- return self .__error
205+ return self ._error
206206
207207 def get_xml (self ):
208208 """
@@ -211,7 +211,7 @@ def get_xml(self):
211211 :return: XML response body
212212 :rtype: string
213213 """
214- return self .__logout_response
214+ return self ._logout_response
215215
216216 def _generate_request_id (self ):
217217 """
0 commit comments