Skip to content

Commit 9af3252

Browse files
author
Roland Hedberg
committed
Moved s2repoze, xmkdsig and xmlenc under saml2.
Fixed bug in mdstore.MetadataStore in handling external metadata using the new config format.
1 parent 7888526 commit 9af3252

37 files changed

+161
-116
lines changed

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,23 @@ def run_tests(self):
5151

5252
setup(
5353
name='pysaml2',
54-
version='2.4.0',
54+
version='2.5.0',
5555
description='Python implementation of SAML Version 2',
5656
# long_description = read("README"),
5757
author='Roland Hedberg',
5858
author_email='[email protected]',
5959
license='Apache 2.0',
6060
url='https://github.com/rohe/pysaml2',
6161

62-
packages=['saml2', 'xmldsig', 'xmlenc', 's2repoze', 's2repoze.plugins',
63-
"saml2/profile", "saml2/schema", "saml2/extension",
64-
"saml2/attributemaps", "saml2/authn_context",
62+
packages=['saml2', 'saml2/xmldsig', 'saml2/xmlenc', 'saml2/s2repoze',
63+
'saml2/s2repoze.plugins', "saml2/profile", "saml2/schema",
64+
"saml2/extension", "saml2/attributemaps", "saml2/authn_context",
6565
"saml2/entity_category", "saml2/userinfo"],
6666

6767
package_dir={'': 'src'},
6868
package_data={'': ['xml/*.xml']},
69-
classifiers=["Development Status :: 4 - Beta",
69+
classifiers=[
70+
"Development Status :: 4 - Beta",
7071
"License :: OSI Approved :: Apache Software License",
7172
"Topic :: Software Development :: Libraries :: Python Modules",
7273
"Programming Language :: Python :: 2.6",

src/idp_test/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88

99
import logging
1010
import imp
11-
import xmldsig
12-
import xmlenc
11+
from saml2 import xmldsig
12+
from saml2 import xmlenc
1313

1414
from saml2.client import Saml2Client
1515
from saml2.config import SPConfig
16-
from saml2.mdstore import MetadataStore, ToOld
16+
from saml2.mdstore import MetadataStore
1717
from saml2.mdstore import MetaData
18+
from saml2.mdstore import ToOld
1819

19-
from saml2test import CheckError, FatalError
20+
from saml2test import CheckError
21+
from saml2test import FatalError
2022
from saml2test import exception_trace
2123
from saml2test import ContextFilter
2224

src/saml2/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
from saml2.extension import dri
3232
from saml2.extension import mdattr
3333
from saml2.extension import ui
34-
import xmldsig
35-
import xmlenc
34+
from saml2 import xmldsig
35+
from saml2 import xmlenc
3636

3737

3838
ONTS = {

src/saml2/extension/pefim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import saml2
44
from saml2 import SamlBase
5-
from xmldsig import X509Data
5+
from saml2.xmldsig import X509Data
66

77
NAMESPACE = 'urn:net:eustix:names:tc:PEFIM:0.0:assertion'
88

src/saml2/extension/shibmd.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
import saml2
88
from saml2 import SamlBase
9-
10-
import xmldsig as ds
9+
from saml2 import xmldsig as ds
1110

1211
NAMESPACE = 'urn:mace:shibboleth:metadata:1.0'
1312

src/saml2/md.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
#
66

77
import saml2
8-
from saml2 import SamlBase
9-
10-
import xmldsig as ds
11-
import xmlenc as xenc
128
from saml2 import saml
9+
from saml2 import SamlBase
10+
from saml2 import xmldsig as ds
11+
from saml2 import xmlenc as xenc
1312

1413
NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:metadata'
1514

src/saml2/mdstore.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def repack_cert(cert):
113113

114114

115115
class MetaData(object):
116-
def __init__(self, onts, attrc, metadata='', node_name=None, check_validity=True,
117-
security=None, **kwargs):
116+
def __init__(self, onts, attrc, metadata='', node_name=None,
117+
check_validity=True, security=None, **kwargs):
118118
self.onts = onts
119119
self.attrc = attrc
120120
self.metadata = metadata
@@ -616,7 +616,8 @@ class MetaDataExtern(InMemoryMetaData):
616616
Accessible but HTTP GET.
617617
"""
618618

619-
def __init__(self, onts, attrc, url=None, security=None, cert=None, http=None, **kwargs):
619+
def __init__(self, onts, attrc, url=None, security=None, cert=None,
620+
http=None, **kwargs):
620621
"""
621622
:params onts:
622623
:params attrc:
@@ -827,8 +828,12 @@ def imp(self, spec):
827828

828829
# Separately handle MDExtern
829830
if MDloader == MetaDataExtern:
830-
item['http'] = self.http
831-
item['security'] = self.security
831+
kwargs = {
832+
'http': self.http,
833+
'security': self.security
834+
}
835+
else:
836+
kwargs = {}
832837

833838
for key in item['metadata']:
834839
# Separately handle MetaDataFile and directory
@@ -840,7 +845,11 @@ def imp(self, spec):
840845
_md.load()
841846
self.metadata[_fil] = _md
842847
return
843-
_md = MDloader(self.onts, self.attrc, *key)
848+
849+
if len(key) == 2:
850+
kwargs["cert"] = key[1]
851+
852+
_md = MDloader(self.onts, self.attrc, key[0], **kwargs)
844853
_md.load()
845854
self.metadata[key[0]] = _md
846855

src/saml2/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from saml2 import samlp
2020
from saml2 import class_name
2121

22-
import xmldsig as ds
22+
from saml2 import xmldsig as ds
2323

2424
from saml2.sigver import pre_signature_part
2525

src/saml2/mongo_store.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
from saml2.extension import dri
2020
from saml2.extension import mdattr
2121
from saml2.extension import ui
22-
import xmldsig
23-
import xmlenc
22+
from saml2 import xmldsig
23+
from saml2 import xmlenc
2424

2525

2626
ONTS = {

src/saml2/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
from saml2.samlp import STATUS_UNSUPPORTED_BINDING
2727
from saml2.samlp import STATUS_RESPONDER
2828

29-
import xmldsig as ds
30-
import xmlenc as xenc
29+
from saml2 import xmldsig as ds
30+
from saml2 import xmlenc as xenc
3131

3232
from saml2 import samlp
3333
from saml2 import class_name

0 commit comments

Comments
 (0)