Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 16c01b2

Browse files
committed
SSO DB debug messages
1 parent 2a02313 commit 16c01b2

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/oidcendpoint/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ def rndstr(size=16):
3737
:param size: The length of the string
3838
:return: string
3939
"""
40-
_basech = string.ascii_letters + string.digits
41-
return "".join([rnd.choice(_basech) for _ in range(size)])
40+
chars = string.ascii_letters + string.digits
41+
return ''.join(rnd.choice(chars) for i in range(size))

src/oidcendpoint/sso_db.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import logging
12
from oidcendpoint.in_memory_db import InMemoryDataBase
23

34
KEY_FORMAT = "__{}__{}"
45

56

7+
logger = logging.getLogger(__name__)
8+
9+
610
class SSODb(object):
711
"""
812
Keeps the connection between an user, one or more sub claims and
@@ -19,6 +23,7 @@ def __init__(self, db=None):
1923
self._db = db or InMemoryDataBase()
2024

2125
def set(self, label, key, value):
26+
logger.debug("SSODb set {}: {}".format(key, value))
2227
_key = KEY_FORMAT.format(label, key)
2328
_values = self._db.get(_key)
2429
if not _values:
@@ -29,7 +34,9 @@ def set(self, label, key, value):
2934

3035
def get(self, label, key):
3136
_key = KEY_FORMAT.format(label, key)
32-
return self._db.get(_key)
37+
value = self._db.get(_key)
38+
logger.debug("SSODb get {} [{}]".format(key, value))
39+
return value
3340

3441
def delete(self, label, key):
3542
_key = KEY_FORMAT.format(label, key)

0 commit comments

Comments
 (0)