summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2020-11-18 23:49:14 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2020-11-23 14:58:13 +0200
commite30702acafd36849c534e52c4238e1f20ffbfe3e (patch)
tree25a7accff7d76049f450bdafe09b138b5ba5384b
parentbb7669369ac6c4412a580863b7e86ee7166c7c81 (diff)
downloadpysaml2-e30702acafd36849c534e52c4238e1f20ffbfe3e.tar.gz
Remove unneeded intermediate static methods
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r--src/saml2/entity.py10
-rw-r--r--src/saml2/httpbase.py37
2 files changed, 3 insertions, 44 deletions
diff --git a/src/saml2/entity.py b/src/saml2/entity.py
index f9f2eec1..8b472dec 100644
--- a/src/saml2/entity.py
+++ b/src/saml2/entity.py
@@ -72,6 +72,7 @@ from saml2.sigver import pre_encrypt_assertion
from saml2.sigver import signed_instance_factory
from saml2.virtual_org import VirtualOrg
from saml2.pack import http_redirect_message
+from saml2.pack import http_form_post_message
import saml2.xmldsig as ds
@@ -241,13 +242,8 @@ class Entity(HTTPBase):
if binding == BINDING_HTTP_POST:
logger.info("HTTP POST")
- # if self.entity_type == 'sp':
- # info = self.use_http_post(msg_str, destination, relay_state,
- # typ)
- # info["url"] = destination
- # info["method"] = "POST"
- # else:
- info = self.use_http_form_post(msg_str, destination, relay_state, typ)
+ info = http_form_post_message(msg_str, destination, relay_state, typ)
+ (msg_str, destination, relay_state, typ)
info["url"] = destination
info["method"] = "POST"
elif binding == BINDING_HTTP_REDIRECT:
diff --git a/src/saml2/httpbase.py b/src/saml2/httpbase.py
index 6a0d1ce7..5860992d 100644
--- a/src/saml2/httpbase.py
+++ b/src/saml2/httpbase.py
@@ -10,10 +10,8 @@ import time
from six.moves.http_cookies import SimpleCookie
from saml2.time_util import utc_now
from saml2 import class_name, SAMLError
-from saml2.pack import http_form_post_message
from saml2.pack import http_post_message
from saml2.pack import make_soap_enveloped_saml_thingy
-from saml2.pack import http_redirect_message
import logging
@@ -255,41 +253,6 @@ class HTTPBase(object):
return r
@staticmethod
- def use_http_post(message, destination, relay_state,
- typ="SAMLRequest"):
- """
- Return a urlencoded message that should be POSTed to the recipient.
-
- :param message: The response
- :param destination: Where the response should be sent
- :param relay_state: The relay_state received in the request
- :param typ: Whether a Request, Response or Artifact
- :return: dictionary
- """
- if not isinstance(message, six.string_types):
- message = "%s" % (message,)
-
- return http_post_message(message, relay_state, typ)
-
- @staticmethod
- def use_http_form_post(message, destination, relay_state,
- typ="SAMLRequest"):
- """
- Return a form that will automagically execute and POST the message
- to the recipient.
-
- :param message:
- :param destination:
- :param relay_state:
- :param typ: Whether a Request, Response or Artifact
- :return: dictionary
- """
- if not isinstance(message, six.string_types):
- message = "%s" % (message,)
-
- return http_form_post_message(message, destination, relay_state, typ)
-
- @staticmethod
def use_http_artifact(message, destination="", relay_state=""):
if relay_state:
query = urlencode({"SAMLart": message,