Skip to content

Commit 8441294

Browse files
author
Roland Hedberg
committed
Merge pull request #125 from tpazderka/identity_database_as_instance
Allow usage of external IdentDB instance
2 parents 652e49e + 563ce90 commit 8441294

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/saml2/server.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import logging
2222
import os
2323

24+
import importlib
2425
import shelve
2526
import threading
2627

@@ -144,7 +145,12 @@ def init_config(self, stype="idp"):
144145

145146
self.ident = IdentMDB(database=addr, collection="ident")
146147

147-
if typ == "mongodb":
148+
elif typ == "identdb":
149+
mod, clas = addr.rsplit('.', 1)
150+
mod = importlib.import_module(mod)
151+
self.ident = getattr(mod, clas)()
152+
153+
if typ == "mongodb" or typ == "identdb":
148154
pass
149155
elif idb is not None:
150156
self.ident = IdentDB(idb)

0 commit comments

Comments
 (0)