summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoland Hedberg <roland.hedberg@adm.umu.se>2014-09-09 08:28:49 +0200
committerRoland Hedberg <roland.hedberg@adm.umu.se>2014-09-09 08:28:49 +0200
commitf3917a46a728dcad6cf5045aec4ece91a8ccc73f (patch)
tree9c24893c0d3e1537d2929d627ec1b1b12e5f3015 /src
parent5127e7e5bbfeafd3a58c3d80d6214f469b511be9 (diff)
downloadpysaml2-f3917a46a728dcad6cf5045aec4ece91a8ccc73f.tar.gz
On Copyright statement in one place.
Diffstat (limited to 'src')
-rw-r--r--src/s2repoze/__init__.py1
-rw-r--r--src/s2repoze/plugins/__init__.py2
-rw-r--r--src/s2repoze/plugins/sp.py13
-rw-r--r--src/saml2/assertion.py14
-rw-r--r--src/saml2/attribute_converter.py13
-rw-r--r--src/saml2/attribute_resolver.py13
-rw-r--r--src/saml2/client.py45
-rw-r--r--src/saml2/client_base.py13
-rw-r--r--src/saml2/ecp.py13
-rw-r--r--src/saml2/ecp_client.py13
-rw-r--r--src/saml2/ident.py13
-rw-r--r--src/saml2/pack.py13
-rw-r--r--src/saml2/response.py13
-rw-r--r--src/saml2/server.py13
-rw-r--r--src/saml2/sigver.py13
-rw-r--r--src/saml2/soap.py13
-rw-r--r--src/saml2/time_util.py15
17 files changed, 31 insertions, 202 deletions
diff --git a/src/s2repoze/__init__.py b/src/s2repoze/__init__.py
index 94e6145b..e3620e55 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 a53880b5..40a96afc 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 5bd7897c..60a34e54 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 7a361aed..e7410672 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 49d00bf0..bc39ca54 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 dab809ce..e02fd8a6 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 4ae7f9e9..27afc2af 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 7825794c..d5283d6f 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 4a1a0c19..e99e174a 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 beb638a5..b9f4573c 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 0e51cc83..162f3fac 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 53c31ccd..a7b86857 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 f6a8d187..b7c8fa99 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 954b1ec3..198b8e11 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 d76579e2..bc5a4d59 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 75329895..e42e8f9e 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 34df69e7..40d7d062 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.
"""