Skip to content

Commit e30702a

Browse files
committed
Remove unneeded intermediate static methods
Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent bb76693 commit e30702a

File tree

2 files changed

+3
-44
lines changed

2 files changed

+3
-44
lines changed

src/saml2/entity.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
from saml2.sigver import signed_instance_factory
7373
from saml2.virtual_org import VirtualOrg
7474
from saml2.pack import http_redirect_message
75+
from saml2.pack import http_form_post_message
7576

7677
import saml2.xmldsig as ds
7778

@@ -241,13 +242,8 @@ def apply_binding(
241242

242243
if binding == BINDING_HTTP_POST:
243244
logger.info("HTTP POST")
244-
# if self.entity_type == 'sp':
245-
# info = self.use_http_post(msg_str, destination, relay_state,
246-
# typ)
247-
# info["url"] = destination
248-
# info["method"] = "POST"
249-
# else:
250-
info = self.use_http_form_post(msg_str, destination, relay_state, typ)
245+
info = http_form_post_message(msg_str, destination, relay_state, typ)
246+
(msg_str, destination, relay_state, typ)
251247
info["url"] = destination
252248
info["method"] = "POST"
253249
elif binding == BINDING_HTTP_REDIRECT:

src/saml2/httpbase.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
from six.moves.http_cookies import SimpleCookie
1111
from saml2.time_util import utc_now
1212
from saml2 import class_name, SAMLError
13-
from saml2.pack import http_form_post_message
1413
from saml2.pack import http_post_message
1514
from saml2.pack import make_soap_enveloped_saml_thingy
16-
from saml2.pack import http_redirect_message
1715

1816
import logging
1917

@@ -254,41 +252,6 @@ def send(self, url, method="GET", **kwargs):
254252

255253
return r
256254

257-
@staticmethod
258-
def use_http_post(message, destination, relay_state,
259-
typ="SAMLRequest"):
260-
"""
261-
Return a urlencoded message that should be POSTed to the recipient.
262-
263-
:param message: The response
264-
:param destination: Where the response should be sent
265-
:param relay_state: The relay_state received in the request
266-
:param typ: Whether a Request, Response or Artifact
267-
:return: dictionary
268-
"""
269-
if not isinstance(message, six.string_types):
270-
message = "%s" % (message,)
271-
272-
return http_post_message(message, relay_state, typ)
273-
274-
@staticmethod
275-
def use_http_form_post(message, destination, relay_state,
276-
typ="SAMLRequest"):
277-
"""
278-
Return a form that will automagically execute and POST the message
279-
to the recipient.
280-
281-
:param message:
282-
:param destination:
283-
:param relay_state:
284-
:param typ: Whether a Request, Response or Artifact
285-
:return: dictionary
286-
"""
287-
if not isinstance(message, six.string_types):
288-
message = "%s" % (message,)
289-
290-
return http_form_post_message(message, destination, relay_state, typ)
291-
292255
@staticmethod
293256
def use_http_artifact(message, destination="", relay_state=""):
294257
if relay_state:

0 commit comments

Comments
 (0)