From f3917a46a728dcad6cf5045aec4ece91a8ccc73f Mon Sep 17 00:00:00 2001 From: Roland Hedberg Date: Tue, 9 Sep 2014 08:28:49 +0200 Subject: [PATCH] On Copyright statement in one place. --- LICENSE.txt | 2 +- doc/conf.py | 2 +- example/idp2/idp.py | 3 ++ example/idp2/templates/root.mako | 2 +- example/idp2_repoze/templates/root.mako | 2 +- setup.py | 23 +++---------- src/s2repoze/__init__.py | 1 - src/s2repoze/plugins/__init__.py | 2 -- src/s2repoze/plugins/sp.py | 13 ------- src/saml2/assertion.py | 14 -------- src/saml2/attribute_converter.py | 13 ------- src/saml2/attribute_resolver.py | 13 ------- src/saml2/client.py | 45 ++++++++++--------------- src/saml2/client_base.py | 13 ------- src/saml2/ecp.py | 13 ------- src/saml2/ecp_client.py | 13 ------- src/saml2/ident.py | 13 +++++++ src/saml2/pack.py | 13 ------- src/saml2/response.py | 13 ------- src/saml2/server.py | 13 ------- src/saml2/sigver.py | 13 ------- src/saml2/soap.py | 13 ------- src/saml2/time_util.py | 15 +-------- tests/ds_data.py | 13 ------- tests/md_data.py | 13 ------- tests/saml2_data.py | 13 ------- tests/samlp_data.py | 13 ------- tests/server_conf_syslog.py | 40 +++++++++++----------- tests/sp_slo_redirect_conf.py | 41 +++++++++++----------- tests/test_00_xmldsig.py | 13 ------- tests/test_02_saml.py | 13 ------- tests/test_04_samlp.py | 13 ------- tests/test_05_md.py | 13 ------- 33 files changed, 84 insertions(+), 368 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4192d2c..70a5155 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright 2013 Roland Hedberg. All rights reserved. +Copyright 2014 Roland Hedberg. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/doc/conf.py b/doc/conf.py index a1340d2..1f7f2b5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -39,7 +39,7 @@ master_doc = 'index' # General information about the project. project = u'pysaml2' -copyright = u'2010-2011, Roland Hedberg' +copyright = u'2014, Roland Hedberg' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/example/idp2/idp.py b/example/idp2/idp.py index edae533..922ba13 100755 --- a/example/idp2/idp.py +++ b/example/idp2/idp.py @@ -51,6 +51,7 @@ from mako.lookup import TemplateLookup logger = logging.getLogger("saml2.idp") logger.setLevel(logging.WARNING) + class Cache(object): def __init__(self): self.user2uid = {} @@ -879,6 +880,7 @@ def metadata(environ, start_response): logger.error("An error occured while creating metadata:" + ex.message) return not_found(environ, start_response) + def staticfile(environ, start_response): try: path = args.path @@ -893,6 +895,7 @@ def staticfile(environ, start_response): logger.error("An error occured while creating metadata:" + ex.message) return not_found(environ, start_response) + def application(environ, start_response): """ The main WSGI application. Dispatch the current request to diff --git a/example/idp2/templates/root.mako b/example/idp2/templates/root.mako index c27e954..f6b70ce 100644 --- a/example/idp2/templates/root.mako +++ b/example/idp2/templates/root.mako @@ -16,7 +16,7 @@ <%def name="post()" filter="trim">
diff --git a/example/idp2_repoze/templates/root.mako b/example/idp2_repoze/templates/root.mako index c27e954..f6b70ce 100644 --- a/example/idp2_repoze/templates/root.mako +++ b/example/idp2_repoze/templates/root.mako @@ -16,7 +16,7 @@ <%def name="post()" filter="trim">
diff --git a/setup.py b/setup.py index 137354a..59b21af 100755 --- a/setup.py +++ b/setup.py @@ -1,27 +1,10 @@ #!/usr/bin/env python -# -# Copyright (C) 2007 SIOS Technology, Inc. -# Copyright (C) 2011 Umea Universitet, Sweden -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# + import sys from setuptools import setup from setuptools.command.test import test as TestCommand - class PyTest(TestCommand): def finalize_options(self): @@ -84,7 +67,9 @@ setup( package_data={'': ['xml/*.xml']}, classifiers=["Development Status :: 4 - Beta", "License :: OSI Approved :: Apache Software License", - "Topic :: Software Development :: Libraries :: Python Modules"], + "Topic :: Software Development :: Libraries :: Python Modules", + "Programming Language :: Python :: 2.6", + "Programming Language :: Python :: 2.7"], scripts=["tools/parse_xsd2.py", "tools/make_metadata.py", "tools/mdexport.py", "tools/merge_metadata.py"], diff --git a/src/s2repoze/__init__.py b/src/s2repoze/__init__.py index 94e6145..e3620e5 100644 --- a/src/s2repoze/__init__.py +++ b/src/s2repoze/__init__.py @@ -1,3 +1,2 @@ # -*- coding: utf-8 -*- # Created by Roland Hedberg -# Copyright (c) 2009 Umeå Universitet. All rights reserved. diff --git a/src/s2repoze/plugins/__init__.py b/src/s2repoze/plugins/__init__.py index a53880b..40a96af 100644 --- a/src/s2repoze/plugins/__init__.py +++ b/src/s2repoze/plugins/__init__.py @@ -1,3 +1 @@ # -*- coding: utf-8 -*- -# Created by Roland Hedberg -# Copyright (c) 2009 Umeå Universitet. All rights reserved. diff --git a/src/s2repoze/plugins/sp.py b/src/s2repoze/plugins/sp.py index 5bd7897..60a34e5 100644 --- a/src/s2repoze/plugins/sp.py +++ b/src/s2repoze/plugins/sp.py @@ -1,17 +1,4 @@ -# Copyright (C) 2009 Umea University # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - """ A plugin that allows you to use SAML2 SSO as authentication and SAML2 attribute aggregations as metadata collector in your diff --git a/src/saml2/assertion.py b/src/saml2/assertion.py index 7a361ae..e741067 100644 --- a/src/saml2/assertion.py +++ b/src/saml2/assertion.py @@ -1,19 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# -# Copyright (C) 2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import importlib import logging diff --git a/src/saml2/attribute_converter.py b/src/saml2/attribute_converter.py index 49d00bf..bc39ca5 100644 --- a/src/saml2/attribute_converter.py +++ b/src/saml2/attribute_converter.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) s2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import os import sys diff --git a/src/saml2/attribute_resolver.py b/src/saml2/attribute_resolver.py index dab809c..e02fd8a 100644 --- a/src/saml2/attribute_resolver.py +++ b/src/saml2/attribute_resolver.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Contains classes and functions that a SAML2.0 Service Provider (SP) may use diff --git a/src/saml2/client.py b/src/saml2/client.py index 4ae7f9e..27afc2a 100644 --- a/src/saml2/client.py +++ b/src/saml2/client.py @@ -1,19 +1,6 @@ -#!/usr/bin/env python +# !/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Contains classes and functions that a SAML2.0 Service Provider (SP) may use to conclude its tasks. @@ -26,7 +13,7 @@ from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST from saml2 import BINDING_SOAP -from saml2.ident import decode +from saml2.ident import decode, code from saml2.httpbase import HTTPError from saml2.s_utils import sid from saml2.s_utils import status_message_factory @@ -48,6 +35,7 @@ except ImportError: from cgi import parse_qs import logging + logger = logging.getLogger(__name__) @@ -118,7 +106,7 @@ class Saml2Client(Base): # find out which IdPs/AAs I should notify entity_ids = self.users.issuers_of_info(name_id) return self.do_logout(name_id, entity_ids, reason, expire, sign) - + def do_logout(self, name_id, entity_ids, reason, expire, sign=None, expected_binding=None): """ @@ -138,7 +126,7 @@ class Saml2Client(Base): # Do the local logout anyway self.local_logout(name_id) return 0, "504 Gateway Timeout", [], [] - + not_done = entity_ids[:] responses = {} @@ -165,7 +153,7 @@ class Saml2Client(Base): req_id, request = self.create_logout_request( destination, entity_id, name_id=name_id, reason=reason, expire=expire) - + #to_sign = [] if binding.startswith("http://"): sign = True @@ -197,12 +185,12 @@ class Saml2Client(Base): else: self.state[req_id] = {"entity_id": entity_id, - "operation": "SLO", - "entity_ids": entity_ids, - "name_id": name_id, - "reason": reason, - "not_on_of_after": expire, - "sign": sign} + "operation": "SLO", + "entity_ids": entity_ids, + "name_id": code(name_id), + "reason": reason, + "not_on_of_after": expire, + "sign": sign} responses[entity_id] = (binding, http_info) not_done.remove(entity_id) @@ -213,7 +201,7 @@ class Saml2Client(Base): if not_done: # upstream should try later raise LogoutError("%s" % (entity_ids,)) - + return responses def local_logout(self, name_id): @@ -231,7 +219,7 @@ class Saml2Client(Base): """ identity = self.users.get_identity(name_id)[0] return bool(identity) - + def handle_logout_response(self, response): """ handles a Logout response @@ -247,11 +235,12 @@ class Saml2Client(Base): logger.info("issuer: %s" % issuer) del self.state[response.in_response_to] if status["entity_ids"] == [issuer]: # done - self.local_logout(status["name_id"]) + self.local_logout(decode(status["name_id"])) return 0, "200 Ok", [("Content-type", "text/html")], [] else: status["entity_ids"].remove(issuer) - return self.do_logout(status["name_id"], status["entity_ids"], + return self.do_logout(decode(status["name_id"]), + status["entity_ids"], status["reason"], status["not_on_or_after"], status["sign"]) diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py index 7825794..d5283d6 100644 --- a/src/saml2/client_base.py +++ b/src/saml2/client_base.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Contains classes and functions that a SAML2.0 Service Provider (SP) may use to conclude its tasks. diff --git a/src/saml2/ecp.py b/src/saml2/ecp.py index 4a1a0c1..e99e174 100644 --- a/src/saml2/ecp.py +++ b/src/saml2/ecp.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Contains classes used in the SAML ECP profile diff --git a/src/saml2/ecp_client.py b/src/saml2/ecp_client.py index beb638a..b9f4573 100644 --- a/src/saml2/ecp_client.py +++ b/src/saml2/ecp_client.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Contains a class that can do SAML ECP Authentication for other python diff --git a/src/saml2/ident.py b/src/saml2/ident.py index 0e51cc8..162f3fa 100644 --- a/src/saml2/ident.py +++ b/src/saml2/ident.py @@ -26,6 +26,15 @@ class Unknown(SAMLError): def code(item): + """ + Turn a NameID class instance into a quoted string of comma separated + attribute,value pairs. The attribute name is replaced with a digits. + Depends on knowledge on the specific order of the attributes for that + class that is used. + + :param item: The class instance + :return: A quoted string + """ _res = [] i = 0 for attr in ATTR: @@ -37,6 +46,10 @@ def code(item): def decode(txt): + """Turns a coded string by code() into a NameID class instance. + + :param txt: The coded string + """ _nid = NameID() for part in txt.split(","): if part.find("=") != -1: diff --git a/src/saml2/pack.py b/src/saml2/pack.py index 53c31cc..a7b8685 100644 --- a/src/saml2/pack.py +++ b/src/saml2/pack.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Contains classes and functions that are necessary to implement different bindings. diff --git a/src/saml2/response.py b/src/saml2/response.py index f6a8d18..b7c8fa9 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2010-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import calendar import logging diff --git a/src/saml2/server.py b/src/saml2/server.py index 954b1ec..198b8e1 100644 --- a/src/saml2/server.py +++ b/src/saml2/server.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Contains classes and functions that a SAML2.0 Identity provider (IdP) or attribute authority (AA) may use to conclude its tasks. diff --git a/src/saml2/sigver.py b/src/saml2/sigver.py index d76579e..bc5a4d5 100644 --- a/src/saml2/sigver.py +++ b/src/saml2/sigver.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Functions connected to signing and verifying. Based on the use of xmlsec1 binaries and not the python xmlsec module. diff --git a/src/saml2/soap.py b/src/saml2/soap.py index 7532989..e42e8f9 100644 --- a/src/saml2/soap.py +++ b/src/saml2/soap.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """ Suppport for the client part of the SAML2.0 SOAP binding. diff --git a/src/saml2/time_util.py b/src/saml2/time_util.py index 34df69e..40d7d06 100644 --- a/src/saml2/time_util.py +++ b/src/saml2/time_util.py @@ -1,20 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Umeå University -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -""" +""" Implements some usefull functions when dealing with validity of different types of information. """ diff --git a/tests/ds_data.py b/tests/ds_data.py index 7174385..243d955 100644 --- a/tests/ds_data.py +++ b/tests/ds_data.py @@ -1,18 +1,5 @@ #!/usr/bin/env python # -# Copyright (C) 2007 SIOS Technology, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Test data for ds""" diff --git a/tests/md_data.py b/tests/md_data.py index d5176b5..1a18ce6 100644 --- a/tests/md_data.py +++ b/tests/md_data.py @@ -1,18 +1,5 @@ #!/usr/bin/env python # -# Copyright (C) 2007 SIOS Technology, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Test data for md""" diff --git a/tests/saml2_data.py b/tests/saml2_data.py index a5f9841..fe650e7 100644 --- a/tests/saml2_data.py +++ b/tests/saml2_data.py @@ -1,18 +1,5 @@ #!/usr/bin/env python # -# Copyright (C) 2007 SIOS Technology, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Test data for saml2""" diff --git a/tests/samlp_data.py b/tests/samlp_data.py index 22ce0a8..f458d15 100644 --- a/tests/samlp_data.py +++ b/tests/samlp_data.py @@ -1,18 +1,5 @@ #!/usr/bin/env python # -# Copyright (C) 2007 SIOS Technology, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Test data for saml2""" diff --git a/tests/server_conf_syslog.py b/tests/server_conf_syslog.py index 72e6a74..4dc6a85 100644 --- a/tests/server_conf_syslog.py +++ b/tests/server_conf_syslog.py @@ -3,48 +3,50 @@ __author__ = 'rolandh' from pathutils import full_path -CONFIG={ - "entityid" : "urn:mace:example.com:saml:roland:sp", - "name" : "urn:mace:example.com:saml:roland:sp", +CONFIG = { + "entityid": "urn:mace:example.com:saml:roland:sp", + "name": "urn:mace:example.com:saml:roland:sp", "description": "My own SP", "service": { "sp": { - "endpoints":{ - "assertion_consumer_service": ["http://lingon.catalogix.se:8087/"], + "endpoints": { + "assertion_consumer_service": [ + "http://lingon.catalogix.se:8087/"], }, "required_attributes": ["surName", "givenName", "mail"], "optional_attributes": ["title"], "idp": ["urn:mace:example.com:saml:roland:idp"], } }, - "debug" : 1, - "key_file" : full_path("test.key"), - "cert_file" : full_path("test.pem"), - #"xmlsec_binary" : None, + "debug": 1, + "key_file": full_path("test.key"), + "cert_file": full_path("test.pem"), + # "xmlsec_binary" : None, "metadata": { "local": [full_path("idp.xml"), full_path("vo_metadata.xml")], }, - "virtual_organization" : { - "urn:mace:example.com:it:tek":{ - "nameid_format" : "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID", + "virtual_organization": { + "urn:mace:example.com:it:tek": { + "nameid_format": "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID", "common_identifier": "umuselin", } }, "subject_data": full_path("subject_data.db"), "accepted_time_diff": 60, - "attribute_map_dir" : full_path("attributemaps"), + "attribute_map_dir": full_path("attributemaps"), "organization": { "name": ("AB Exempel", "se"), "display_name": ("AB Exempel", "se"), "url": "http://www.example.org", }, "contact_person": [{ - "given_name": "Roland", - "sur_name": "Hedberg", - "telephone_number": "+46 70 100 0000", - "email_address": ["tech@eample.com", "tech@example.org"], - "contact_type": "technical" - }, + "given_name": "Roland", + "sur_name": "Hedberg", + "telephone_number": "+46 70 100 0000", + "email_address": ["tech@eample.com", + "tech@example.org"], + "contact_type": "technical" + }, ], "logger": { "syslog": { diff --git a/tests/sp_slo_redirect_conf.py b/tests/sp_slo_redirect_conf.py index 7856c11..97751da 100644 --- a/tests/sp_slo_redirect_conf.py +++ b/tests/sp_slo_redirect_conf.py @@ -6,16 +6,16 @@ from pathutils import full_path HOME = "http://lingon.catalogix.se:8087/" CONFIG = { - "entityid" : "urn:mace:example.com:saml:roland:sp", - "name" : "urn:mace:example.com:saml:roland:sp", + "entityid": "urn:mace:example.com:saml:roland:sp", + "name": "urn:mace:example.com:saml:roland:sp", "description": "My own SP", "service": { "sp": { - "endpoints":{ + "endpoints": { "assertion_consumer_service": [ - (HOME, BINDING_HTTP_REDIRECT)], - "single_logout_service" : [ - (HOME+"slo",BINDING_HTTP_REDIRECT)], + (HOME, BINDING_HTTP_REDIRECT)], + "single_logout_service": [ + (HOME + "slo", BINDING_HTTP_REDIRECT)], }, "required_attributes": ["surName", "givenName", "mail"], "optional_attributes": ["title"], @@ -23,32 +23,33 @@ CONFIG = { "subject_data": full_path("subject_data.db"), } }, - "debug" : 1, - "key_file" : full_path("test.key"), - "cert_file" : full_path("test.pem"), - "xmlsec_binary" : None, + "debug": 1, + "key_file": full_path("test.key"), + "cert_file": full_path("test.pem"), + "xmlsec_binary": None, "metadata": { "local": [full_path("idp_slo_redirect.xml")], }, - "virtual_organization" : { - "urn:mace:example.com:it:tek":{ - "nameid_format" : "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID", + "virtual_organization": { + "urn:mace:example.com:it:tek": { + "nameid_format": "urn:oid:1.3.6.1.4.1.1466.115.121.1.15-NameID", "common_identifier": "umuselin", } }, "accepted_time_diff": 60, - "attribute_map_dir" : full_path("attributemaps"), + "attribute_map_dir": full_path("attributemaps"), "organization": { "name": ("AB Exempel", "se"), "display_name": ("AB Exempel", "se"), "url": "http://www.example.org", }, "contact_person": [{ - "given_name": "Roland", - "sur_name": "Hedberg", - "telephone_number": "+46 70 100 0000", - "email_address": ["tech@eample.com", "tech@example.org"], - "contact_type": "technical" - }, + "given_name": "Roland", + "sur_name": "Hedberg", + "telephone_number": "+46 70 100 0000", + "email_address": ["tech@eample.com", + "tech@example.org"], + "contact_type": "technical" + }, ] } diff --git a/tests/test_00_xmldsig.py b/tests/test_00_xmldsig.py index 8ebd6ef..8b40e9d 100644 --- a/tests/test_00_xmldsig.py +++ b/tests/test_00_xmldsig.py @@ -1,18 +1,5 @@ #!/usr/bin/env python # -# Copyright (C) 2007 SIOS Technology, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Tests for xmldsig""" diff --git a/tests/test_02_saml.py b/tests/test_02_saml.py index fdc362b..41beabe 100644 --- a/tests/test_02_saml.py +++ b/tests/test_02_saml.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2010 Umeå University. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Tests for saml2.saml""" diff --git a/tests/test_04_samlp.py b/tests/test_04_samlp.py index 2cfd59b..dae7653 100644 --- a/tests/test_04_samlp.py +++ b/tests/test_04_samlp.py @@ -1,19 +1,6 @@ #!/usr/bin/env pythony # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Umeå University. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Tests for saml2.samlp""" diff --git a/tests/test_05_md.py b/tests/test_05_md.py index f0a8ef0..c02d668 100644 --- a/tests/test_05_md.py +++ b/tests/test_05_md.py @@ -1,19 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -# Copyright (C) 2009 Umeå University. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. """Tests for saml2.md"""