Skip to content

Commit 9f07623

Browse files
author
Hans Hörberg
committed
Merge branch 'master' into test_new_encrypt
2 parents 2648e32 + f77763d commit 9f07623

File tree

109 files changed

+930
-749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+930
-749
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.~
33
\#*
44
.*~
5+
.eggs
6+
*.egg
57
*.egg-info
68
example/*/*.log
79
example/*.db
@@ -192,3 +194,4 @@ example/sp-repoze/sp_conf_2.Pygmalion
192194
example/sp-repoze/sp_conf_2.py
193195

194196
sp.xml
197+
tests/pki/qwerty.*

doc/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# serve to show the default.
1313

1414
import sys, os
15+
import alabaster
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
@@ -22,6 +23,7 @@
2223

2324
# Add any Sphinx extension module names here, as strings. They can be extensions
2425
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
26+
2527
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage']
2628

2729
# Add any paths that contain templates here, relative to this directory.
@@ -91,6 +93,7 @@
9193

9294
# The theme to use for HTML and HTML Help pages. Major themes that come with
9395
# Sphinx are currently 'default' and 'sphinxdoc'.
96+
html_theme_path = [alabaster.get_path()]
9497
html_theme = 'alabaster'
9598
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
9699

example/idp2/idp.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ def verify_request(self, query, binding):
297297

298298
return resp_args, _resp
299299

300-
def do(self, query, binding_in, relay_state="", encrypt_cert=None):
300+
def do(self, query, binding_in, relay_state="", encrypt_cert=None,
301+
**kwargs):
301302
"""
302303
303304
:param query: The request
@@ -604,7 +605,7 @@ def not_found(environ, start_response):
604605
# return subject, sp_entity_id
605606

606607
class SLO(Service):
607-
def do(self, request, binding, relay_state="", encrypt_cert=None):
608+
def do(self, request, binding, relay_state="", encrypt_cert=None, **kwargs):
608609

609610
logger.info("--- Single Log Out Service ---")
610611
try:
@@ -1064,5 +1065,5 @@ def application(environ, start_response):
10641065
PORT = CONFIG.PORT
10651066

10661067
SRV = make_server(HOST, PORT, application)
1067-
print "IdP listening on %s:%s" % (HOST, PORT)
1068+
print("IdP listening on %s:%s" % (HOST, PORT))
10681069
SRV.serve_forever()

example/idp2/idp_uwsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ def application(environ, start_response):
10191019
PORT = CONFIG.PORT
10201020

10211021
SRV = make_server(HOST, PORT, application)
1022-
print "IdP listening on %s:%s" % (HOST, PORT)
1022+
print("IdP listening on %s:%s" % (HOST, PORT))
10231023
SRV.serve_forever()
10241024
else:
10251025
_rot = args.mako_root

example/idp2_repoze/idp.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ def verify_request(self, query, binding):
269269
try:
270270
resp_args = IDP.response_args(_authn_req)
271271
_resp = None
272-
except UnknownPrincipal, excp:
272+
except UnknownPrincipal as excp:
273273
_resp = IDP.create_error_response(_authn_req.id,
274274
self.destination, excp)
275-
except UnsupportedBinding, excp:
275+
except UnsupportedBinding as excp:
276276
_resp = IDP.create_error_response(_authn_req.id,
277277
self.destination, excp)
278278

@@ -281,11 +281,11 @@ def verify_request(self, query, binding):
281281
def do(self, query, binding_in, relay_state=""):
282282
try:
283283
resp_args, _resp = self.verify_request(query, binding_in)
284-
except UnknownPrincipal, excp:
284+
except UnknownPrincipal as excp:
285285
logger.error("UnknownPrincipal: %s" % (excp,))
286286
resp = ServiceError("UnknownPrincipal: %s" % (excp,))
287287
return resp(self.environ, self.start_response)
288-
except UnsupportedBinding, excp:
288+
except UnsupportedBinding as excp:
289289
logger.error("UnsupportedBinding: %s" % (excp,))
290290
resp = ServiceError("UnsupportedBinding: %s" % (excp,))
291291
return resp(self.environ, self.start_response)
@@ -305,7 +305,7 @@ def do(self, query, binding_in, relay_state=""):
305305
identity, userid=self.user,
306306
authn=AUTHN_BROKER[self.environ["idp.authn_ref"]], sign_assertion=sign_assertion,
307307
sign_response=False, **resp_args)
308-
except Exception, excp:
308+
except Exception as excp:
309309
logging.error(exception_trace(excp))
310310
resp = ServiceError("Exception: %s" % (excp,))
311311
return resp(self.environ, self.start_response)
@@ -548,7 +548,7 @@ def do(self, request, binding, relay_state=""):
548548
_, body = request.split("\n")
549549
logger.debug("req: '%s'" % body)
550550
req_info = IDP.parse_logout_request(body, binding)
551-
except Exception, exc:
551+
except Exception as exc:
552552
logger.error("Bad request: %s" % exc)
553553
resp = BadRequest("%s" % exc)
554554
return resp(self.environ, self.start_response)
@@ -565,7 +565,7 @@ def do(self, request, binding, relay_state=""):
565565
# remove the authentication
566566
try:
567567
IDP.session_db.remove_authn_statements(msg.name_id)
568-
except KeyError, exc:
568+
except KeyError as exc:
569569
logger.error("ServiceError: %s" % exc)
570570
resp = ServiceError("%s" % exc)
571571
return resp(self.environ, self.start_response)
@@ -574,7 +574,7 @@ def do(self, request, binding, relay_state=""):
574574

575575
try:
576576
hinfo = IDP.apply_binding(binding, "%s" % resp, "", relay_state)
577-
except Exception, exc:
577+
except Exception as exc:
578578
logger.error("ServiceError: %s" % exc)
579579
resp = ServiceError("%s" % exc)
580580
return resp(self.environ, self.start_response)
@@ -986,7 +986,7 @@ def application(environ, start_response):
986986
PORT = 8088
987987

988988
SRV = make_server(HOST, PORT, application)
989-
print "IdP listening on %s:%s" % (HOST, PORT)
989+
print("IdP listening on %s:%s" % (HOST, PORT))
990990
SRV.serve_forever()
991991
else:
992992
_rot = args.mako_root

example/sp-repoze/sp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,5 @@ def application(environ, start_response):
293293

294294
from wsgiref.simple_server import make_server
295295
srv = make_server(HOST, PORT, app_with_auth)
296-
print "SP listening on %s:%s" % (HOST, PORT)
296+
print("SP listening on %s:%s" % (HOST, PORT))
297297
srv.serve_forever()

example/sp-wsgi/sp.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
from __future__ import print_function
23
import logging
34
import re
45
import argparse
@@ -353,18 +354,18 @@ def do(self, response, binding, relay_state="", mtype="response"):
353354
try:
354355
self.response = self.sp.parse_authn_request_response(
355356
response, binding, self.outstanding_queries, self.cache.outstanding_certs)
356-
except UnknownPrincipal, excp:
357+
except UnknownPrincipal as excp:
357358
logger.error("UnknownPrincipal: %s" % (excp,))
358359
resp = ServiceError("UnknownPrincipal: %s" % (excp,))
359360
return resp(self.environ, self.start_response)
360-
except UnsupportedBinding, excp:
361+
except UnsupportedBinding as excp:
361362
logger.error("UnsupportedBinding: %s" % (excp,))
362363
resp = ServiceError("UnsupportedBinding: %s" % (excp,))
363364
return resp(self.environ, self.start_response)
364-
except VerificationError, err:
365+
except VerificationError as err:
365366
resp = ServiceError("Verification error: %s" % (err,))
366367
return resp(self.environ, self.start_response)
367-
except Exception, err:
368+
except Exception as err:
368369
resp = ServiceError("Other error: %s" % (err,))
369370
return resp(self.environ, self.start_response)
370371

@@ -580,7 +581,7 @@ def redirect_to_auth(self, _cli, entity_id, came_from):
580581
if cert is not None:
581582
self.cache.outstanding_certs[_sid] = cert
582583

583-
except Exception, exc:
584+
except Exception as exc:
584585
logger.exception(exc)
585586
resp = ServiceError(
586587
"Failed to construct the AuthnRequest: %s" % exc)
@@ -784,14 +785,14 @@ def application(environ, start_response):
784785
if re.match(".*static/.*", path):
785786
return handle_static(environ, start_response, path)
786787
return not_found(environ, start_response)
787-
except StatusError, err:
788+
except StatusError as err:
788789
logging.error("StatusError: %s" % err)
789790
resp = BadRequest("%s" % err)
790791
return resp(environ, start_response)
791-
except Exception, err:
792+
except Exception as err:
792793
#_err = exception_trace("RUN", err)
793794
#logging.error(exception_trace("RUN", _err))
794-
print >> sys.stderr, err
795+
print(err, file=sys.stderr)
795796
resp = ServiceError("%s" % err)
796797
return resp(environ, start_response)
797798

@@ -850,7 +851,7 @@ def application(environ, start_response):
850851
SERVER_KEY, CERT_CHAIN)
851852
_https = " using SSL/TLS"
852853
logger.info("Server starting")
853-
print "SP listening on %s:%s%s" % (HOST, PORT, _https)
854+
print("SP listening on %s:%s%s" % (HOST, PORT, _https))
854855
try:
855856
SRV.start()
856857
except KeyboardInterrupt:

script/filter_testcase_ids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
import json, sys
88
jdata = json.load(sys.stdin)
99
for k in jdata:
10-
print k["id"]
10+
print(k["id"])

script/utility/filter_testcase_ids.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
import json, sys
88
jdata = json.load(sys.stdin)
99
for k in jdata:
10-
print k["id"]
10+
print(k["id"])

script/utility/run_list_of_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
for line in fileinput.input():
77
cmd = "./run_oper.sh " + line.rstrip()
8-
print "executing " + cmd
8+
print("executing " + cmd)
99
call(cmd, shell=True)
1010

0 commit comments

Comments
 (0)