Skip to content

Commit f3917a4

Browse files
author
Roland Hedberg
committed
On Copyright statement in one place.
1 parent 5127e7e commit f3917a4

33 files changed

+84
-368
lines changed

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2013 Roland Hedberg. All rights reserved.
1+
Copyright 2014 Roland Hedberg. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification, are
44
permitted provided that the following conditions are met:

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# General information about the project.
4141
project = u'pysaml2'
42-
copyright = u'2010-2011, Roland Hedberg'
42+
copyright = u'2014, Roland Hedberg'
4343

4444
# The version info for the project you're documenting, acts as replacement for
4545
# |version| and |release|, also used in various other places throughout the

example/idp2/idp.py

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
logger = logging.getLogger("saml2.idp")
5252
logger.setLevel(logging.WARNING)
5353

54+
5455
class Cache(object):
5556
def __init__(self):
5657
self.user2uid = {}
@@ -879,6 +880,7 @@ def metadata(environ, start_response):
879880
logger.error("An error occured while creating metadata:" + ex.message)
880881
return not_found(environ, start_response)
881882

883+
882884
def staticfile(environ, start_response):
883885
try:
884886
path = args.path
@@ -893,6 +895,7 @@ def staticfile(environ, start_response):
893895
logger.error("An error occured while creating metadata:" + ex.message)
894896
return not_found(environ, start_response)
895897

898+
896899
def application(environ, start_response):
897900
"""
898901
The main WSGI application. Dispatch the current request to

example/idp2/templates/root.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%def name="post()" filter="trim">
1717
<div>
1818
<div class="footer">
19-
<p>&#169; Copyright 2011 Ume&#229; Universitet &nbsp;</p>
19+
<p>&#169; Copyright 2014 Ume&#229; Universitet &nbsp;</p>
2020
</div>
2121
</div>
2222
</%def>

example/idp2_repoze/templates/root.mako

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%def name="post()" filter="trim">
1717
<div>
1818
<div class="footer">
19-
<p>&#169; Copyright 2011 Ume&#229; Universitet &nbsp;</p>
19+
<p>&#169; Copyright 2014 Ume&#229; Universitet &nbsp;</p>
2020
</div>
2121
</div>
2222
</%def>

setup.py

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
11
#!/usr/bin/env python
2-
#
3-
# Copyright (C) 2007 SIOS Technology, Inc.
4-
# Copyright (C) 2011 Umea Universitet, Sweden
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
17-
#
18-
#
2+
193
import sys
204

215
from setuptools import setup
226
from setuptools.command.test import test as TestCommand
237

24-
258
class PyTest(TestCommand):
269

2710
def finalize_options(self):
@@ -84,7 +67,9 @@ def run_tests(self):
8467
package_data={'': ['xml/*.xml']},
8568
classifiers=["Development Status :: 4 - Beta",
8669
"License :: OSI Approved :: Apache Software License",
87-
"Topic :: Software Development :: Libraries :: Python Modules"],
70+
"Topic :: Software Development :: Libraries :: Python Modules",
71+
"Programming Language :: Python :: 2.6",
72+
"Programming Language :: Python :: 2.7"],
8873

8974
scripts=["tools/parse_xsd2.py", "tools/make_metadata.py",
9075
"tools/mdexport.py", "tools/merge_metadata.py"],

src/s2repoze/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# -*- coding: utf-8 -*-
22
# Created by Roland Hedberg
3-
# Copyright (c) 2009 Umeå Universitet. All rights reserved.

src/s2repoze/plugins/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
# -*- coding: utf-8 -*-
2-
# Created by Roland Hedberg
3-
# Copyright (c) 2009 Umeå Universitet. All rights reserved.

src/s2repoze/plugins/sp.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
1-
# Copyright (C) 2009 Umea University
21
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
152
"""
163
A plugin that allows you to use SAML2 SSO as authentication
174
and SAML2 attribute aggregations as metadata collector in your

src/saml2/assertion.py

-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
3-
#
4-
# Copyright (C) 2010-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
173
import importlib
184
import logging
195

src/saml2/attribute_converter.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) s2010-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
import os
196
import sys

src/saml2/attribute_resolver.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2009-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
"""
196
Contains classes and functions that a SAML2.0 Service Provider (SP) may use

src/saml2/client.py

+17-28
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
#!/usr/bin/env python
1+
# !/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2009-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
"""Contains classes and functions that a SAML2.0 Service Provider (SP) may use
196
to conclude its tasks.
@@ -26,7 +13,7 @@
2613
from saml2 import BINDING_HTTP_POST
2714
from saml2 import BINDING_SOAP
2815

29-
from saml2.ident import decode
16+
from saml2.ident import decode, code
3017
from saml2.httpbase import HTTPError
3118
from saml2.s_utils import sid
3219
from saml2.s_utils import status_message_factory
@@ -48,6 +35,7 @@
4835
from cgi import parse_qs
4936

5037
import logging
38+
5139
logger = logging.getLogger(__name__)
5240

5341

@@ -118,7 +106,7 @@ def global_logout(self, name_id, reason="", expire=None, sign=None):
118106
# find out which IdPs/AAs I should notify
119107
entity_ids = self.users.issuers_of_info(name_id)
120108
return self.do_logout(name_id, entity_ids, reason, expire, sign)
121-
109+
122110
def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
123111
expected_binding=None):
124112
"""
@@ -138,7 +126,7 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
138126
# Do the local logout anyway
139127
self.local_logout(name_id)
140128
return 0, "504 Gateway Timeout", [], []
141-
129+
142130
not_done = entity_ids[:]
143131
responses = {}
144132

@@ -165,7 +153,7 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
165153
req_id, request = self.create_logout_request(
166154
destination, entity_id, name_id=name_id, reason=reason,
167155
expire=expire)
168-
156+
169157
#to_sign = []
170158
if binding.startswith("http://"):
171159
sign = True
@@ -197,12 +185,12 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
197185

198186
else:
199187
self.state[req_id] = {"entity_id": entity_id,
200-
"operation": "SLO",
201-
"entity_ids": entity_ids,
202-
"name_id": name_id,
203-
"reason": reason,
204-
"not_on_of_after": expire,
205-
"sign": sign}
188+
"operation": "SLO",
189+
"entity_ids": entity_ids,
190+
"name_id": code(name_id),
191+
"reason": reason,
192+
"not_on_of_after": expire,
193+
"sign": sign}
206194

207195
responses[entity_id] = (binding, http_info)
208196
not_done.remove(entity_id)
@@ -213,7 +201,7 @@ def do_logout(self, name_id, entity_ids, reason, expire, sign=None,
213201
if not_done:
214202
# upstream should try later
215203
raise LogoutError("%s" % (entity_ids,))
216-
204+
217205
return responses
218206

219207
def local_logout(self, name_id):
@@ -231,7 +219,7 @@ def is_logged_in(self, name_id):
231219
"""
232220
identity = self.users.get_identity(name_id)[0]
233221
return bool(identity)
234-
222+
235223
def handle_logout_response(self, response):
236224
""" handles a Logout response
237225
@@ -247,11 +235,12 @@ def handle_logout_response(self, response):
247235
logger.info("issuer: %s" % issuer)
248236
del self.state[response.in_response_to]
249237
if status["entity_ids"] == [issuer]: # done
250-
self.local_logout(status["name_id"])
238+
self.local_logout(decode(status["name_id"]))
251239
return 0, "200 Ok", [("Content-type", "text/html")], []
252240
else:
253241
status["entity_ids"].remove(issuer)
254-
return self.do_logout(status["name_id"], status["entity_ids"],
242+
return self.do_logout(decode(status["name_id"]),
243+
status["entity_ids"],
255244
status["reason"], status["not_on_or_after"],
256245
status["sign"])
257246

src/saml2/client_base.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2009-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
"""Contains classes and functions that a SAML2.0 Service Provider (SP) may use
196
to conclude its tasks.

src/saml2/ecp.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2010-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
"""
196
Contains classes used in the SAML ECP profile

src/saml2/ecp_client.py

-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (C) 2010-2011 Umeå University
5-
#
6-
# Licensed under the Apache License, Version 2.0 (the "License");
7-
# you may not use this file except in compliance with the License.
8-
# You may obtain a copy of the License at
9-
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
11-
#
12-
# Unless required by applicable law or agreed to in writing, software
13-
# distributed under the License is distributed on an "AS IS" BASIS,
14-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
# See the License for the specific language governing permissions and
16-
# limitations under the License.
174

185
"""
196
Contains a class that can do SAML ECP Authentication for other python

src/saml2/ident.py

+13
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ class Unknown(SAMLError):
2626

2727

2828
def code(item):
29+
"""
30+
Turn a NameID class instance into a quoted string of comma separated
31+
attribute,value pairs. The attribute name is replaced with a digits.
32+
Depends on knowledge on the specific order of the attributes for that
33+
class that is used.
34+
35+
:param item: The class instance
36+
:return: A quoted string
37+
"""
2938
_res = []
3039
i = 0
3140
for attr in ATTR:
@@ -37,6 +46,10 @@ def code(item):
3746

3847

3948
def decode(txt):
49+
"""Turns a coded string by code() into a NameID class instance.
50+
51+
:param txt: The coded string
52+
"""
4053
_nid = NameID()
4154
for part in txt.split(","):
4255
if part.find("=") != -1:

0 commit comments

Comments
 (0)