Skip to content

Commit 25704a9

Browse files
author
Roland Hedberg
committed
Merge pull request #150 from tpazderka/MetadataStore
Metadata store
2 parents d89992c + 0f7768b commit 25704a9

21 files changed

+651
-212
lines changed

src/saml2/mdstore.py

Lines changed: 268 additions & 124 deletions
Large diffs are not rendered by default.

src/saml2/mongo_store.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import pymongo.uri_parser
77
import pymongo.errors
88
from saml2.eptid import Eptid
9-
from saml2.mdstore import MetaData
9+
from saml2.mdstore import InMemoryMetaData
1010
from saml2.s_utils import PolicyError
1111

1212
from saml2.ident import code, IdentDB, Unknown
@@ -377,9 +377,9 @@ def export_mdstore_to_mongo_db(mds, database, collection, sub_collection=""):
377377
mdb.store(key, **kwargs)
378378

379379

380-
class MetadataMDB(MetaData):
380+
class MetadataMDB(InMemoryMetaData):
381381
def __init__(self, onts, attrc, database="", collection=""):
382-
MetaData.__init__(self, onts, attrc)
382+
super(MetadataMDB, self).__init__(onts, attrc)
383383
self.mdb = MDB(database, collection)
384384
self.mdb.primary_key = "entity_id"
385385

tests/disco_conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
},
2020
"debug": 1,
2121
"xmlsec_binary": xmlsec_path,
22-
"metadata": {
23-
"local": [full_path("servera.xml")],
24-
},
22+
"metadata": [{
23+
"class": "saml2.mdstore.MetaDataFile",
24+
"metadata": [(full_path("servera.xml"), )],
25+
}],
2526
}

tests/idp_all_conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,11 @@
8787
"key_file": full_path("test.key"),
8888
"cert_file": full_path("test.pem"),
8989
"xmlsec_path": ["/usr/local/bin", "/opt/local/bin"],
90-
"metadata": {
91-
"local": [full_path("servera.xml"),
92-
full_path("vo_metadata.xml")],
93-
},
90+
"metadata": [{
91+
"class": "saml2.mdstore.MetaDataFile",
92+
"metadata": [(full_path("servera.xml"), ),
93+
(full_path("vo_metadata.xml"), )],
94+
}],
9495
"attribute_map_dir": full_path("attributemaps"),
9596
"organization": {
9697
"name": "Exempel AB",

tests/idp_conf.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@
4545
"key_file": full_path("test.key"),
4646
"cert_file": full_path("test.pem"),
4747
"xmlsec_binary": xmlsec_path,
48-
"metadata": {
49-
"local": [full_path("metadata_sp_1.xml"),
50-
full_path("vo_metadata.xml")],
51-
},
48+
"metadata": [{
49+
"class": "saml2.mdstore.MetaDataFile",
50+
"metadata": [(full_path("metadata_sp_1.xml"), ),
51+
(full_path("vo_metadata.xml"), )],
52+
}],
5253
"attribute_map_dir": full_path("attributemaps"),
5354
"organization": {
5455
"name": "Exempel AB",

tests/idp_conf_ec.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
"key_file": full_path("test.key"),
3939
"cert_file": full_path("test.pem"),
4040
"xmlsec_binary": xmlsec_path,
41-
"metadata": {
42-
"local": [full_path("metadata_sp_1.xml"),
43-
full_path("vo_metadata.xml")],
44-
},
41+
"metadata": [{
42+
"class": "saml2.mdstore.MetaDataFile",
43+
"metadata": [(full_path("metadata_sp_1.xml"), ),
44+
(full_path("vo_metadata.xml"), )],
45+
}],
4546
"attribute_map_dir": full_path("attributemaps"),
4647
"organization": {
4748
"name": "Exempel AB",

tests/idp_conf_mdb.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@
8888
"cert_file": full_path("test.pem"),
8989
#"xmlsec_binary": None,
9090
"xmlsec_path": ["/opt/local/bin", "usr/local/bin"],
91-
"metadata": {
92-
"local": [full_path("servera.xml"),
93-
full_path("vo_metadata.xml")],
94-
},
91+
"metadata": [{
92+
"class": "saml2.mdstore.MetaDataFile",
93+
"metadata": [(full_path("servera.xml"), ),
94+
(full_path("vo_metadata.xml"), )],
95+
}],
9596
"attribute_map_dir": full_path("attributemaps"),
9697
"organization": {
9798
"name": "Exempel AB",

tests/idp_slo_redirect_conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
"key_file" : full_path("test.key"),
3434
"cert_file" : full_path("test.pem"),
3535
"xmlsec_binary" : None,
36-
"metadata": {
37-
"local": [full_path("sp_slo_redirect.xml")],
38-
},
36+
"metadata": [{
37+
"class": "saml2.mdstore.MetaDataFile",
38+
"metadata": [(full_path("sp_slo_redirect.xml"), )],
39+
}],
3940
"attribute_map_dir" : full_path("attributemaps"),
4041
"organization": {
4142
"name": "Exempel AB",

tests/idp_soap_conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
"key_file" : full_path("test.key"),
3838
"cert_file" : full_path("test.pem"),
3939
#"xmlsec_binary" : None,
40-
"metadata": {
41-
"local": [full_path("metadata.xml"), full_path("vo_metadata.xml")],
42-
},
40+
"metadata": [{
41+
"class": "saml2.mdstore.MetaDataFile",
42+
"metadata": [(full_path("metadata.xml"), ), (full_path("vo_metadata.xml"), )],
43+
}],
4344
"attribute_map_dir" : full_path("attributemaps"),
4445
"organization": {
4546
"name": "Exempel AB",

tests/idp_sp_conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@
5050
"key_file" : full_path("test.key"),
5151
"cert_file" : full_path("test.pem"),
5252
"xmlsec_binary" : None,
53-
"metadata": {
54-
"local": [full_path("metadata.xml"), full_path("vo_metadata.xml")],
55-
},
53+
"metadata": [{
54+
"class": "saml2.mdstore.MetaDataFile",
55+
"metadata": [(full_path("metadata.xml"), ), (full_path("vo_metadata.xml"), )],
56+
}],
5657
"attribute_map_dir" : full_path("attributemaps"),
5758
"organization": {
5859
"name": "Exempel AB",

0 commit comments

Comments
 (0)