summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/saml2/discovery.py4
-rw-r--r--src/saml2/ecp_client.py2
-rw-r--r--src/saml2/httputil.py5
-rw-r--r--src/saml2/pack.py9
-rw-r--r--src/saml2/s2repoze/plugins/sp.py8
5 files changed, 12 insertions, 16 deletions
diff --git a/src/saml2/discovery.py b/src/saml2/discovery.py
index 5d89f6b7..cef8ff34 100644
--- a/src/saml2/discovery.py
+++ b/src/saml2/discovery.py
@@ -1,6 +1,4 @@
-from urllib import urlencode
-from urlparse import parse_qs
-from urlparse import urlparse
+from six.moves.urllib.parse import urlencode, parse_qs, urlparse
from saml2.entity import Entity
from saml2.response import VerificationError
diff --git a/src/saml2/ecp_client.py b/src/saml2/ecp_client.py
index d3dd757d..c41a046a 100644
--- a/src/saml2/ecp_client.py
+++ b/src/saml2/ecp_client.py
@@ -7,7 +7,7 @@ Contains a class that can do SAML ECP Authentication for other python
programs.
"""
-import cookielib
+from six.moves import http_cookiejar as cookielib
import logging
from saml2 import soap
diff --git a/src/saml2/httputil.py b/src/saml2/httputil.py
index 88c8f391..360982d5 100644
--- a/src/saml2/httputil.py
+++ b/src/saml2/httputil.py
@@ -5,9 +5,8 @@ import time
import cgi
import six
-from urllib import quote
-from urlparse import parse_qs
-from Cookie import SimpleCookie
+from six.moves.urllib.parse import quote, parse_qs
+from six.moves.http_cookies import SimpleCookie
from saml2 import BINDING_HTTP_ARTIFACT, SAMLError
from saml2 import BINDING_HTTP_REDIRECT
diff --git a/src/saml2/pack.py b/src/saml2/pack.py
index 43cfadc6..b2c9c45f 100644
--- a/src/saml2/pack.py
+++ b/src/saml2/pack.py
@@ -10,10 +10,9 @@ Bindings normally consists of three parts:
- how to package the information
- which protocol to use
"""
-from six.moves.urllib.parse import urlparse
+from six.moves.urllib.parse import urlparse, urlencode
import saml2
import base64
-import urllib
from saml2.s_utils import deflate_and_base64_encode
from saml2.s_utils import Unsupported
import logging
@@ -126,12 +125,12 @@ def http_redirect_message(message, location, relay_state="", typ="SAMLRequest",
except:
raise Unsupported("Signing algorithm")
else:
- string = "&".join([urllib.urlencode({k: args[k]})
+ string = "&".join([urlencode({k: args[k]})
for k in _order if k in args])
args["Signature"] = base64.b64encode(signer.sign(string, key))
- string = urllib.urlencode(args)
+ string = urlencode(args)
else:
- string = urllib.urlencode(args)
+ string = urlencode(args)
glue_char = "&" if urlparse(location).query else "?"
login_url = glue_char.join([location, string])
diff --git a/src/saml2/s2repoze/plugins/sp.py b/src/saml2/s2repoze/plugins/sp.py
index 63d4f663..190caab2 100644
--- a/src/saml2/s2repoze/plugins/sp.py
+++ b/src/saml2/s2repoze/plugins/sp.py
@@ -13,11 +13,11 @@ import shelve
import traceback
import saml2
import six
-from urlparse import parse_qs, urlparse
+from six.moves.urllib.parse import parse_qs, urlparse
from saml2.samlp import Extensions
from saml2 import xmldsig as ds
-from StringIO import StringIO
+from six import StringIO
from paste.httpexceptions import HTTPSeeOther, HTTPRedirection
from paste.httpexceptions import HTTPNotImplemented
@@ -27,7 +27,7 @@ from paste.request import construct_url
from saml2.extension.pefim import SPCertEnc
from saml2.httputil import SeeOther
from saml2.client_base import ECP_SERVICE
-from zope.interface import implements
+from zope.interface import implementer
from repoze.who.interfaces import IChallenger, IIdentifier, IAuthenticator
from repoze.who.interfaces import IMetadataProvider
@@ -80,8 +80,8 @@ class ECP_response(object):
return [self.content]
+@implementer(IChallenger, IIdentifier, IAuthenticator, IMetadataProvider)
class SAML2Plugin(object):
- implements(IChallenger, IIdentifier, IAuthenticator, IMetadataProvider)
def __init__(self, rememberer_name, config, saml_client, wayf, cache,
sid_store=None, discovery="", idp_query_param="",