Skip to content

Commit 89e2967

Browse files
committed
Allow function references deep in _supports structure.
1 parent 543cd8f commit 89e2967

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/idpyoidc/claims.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,21 @@ def set(self, key, val):
206206
def construct_uris(self, *args):
207207
pass
208208

209-
def supports(self):
209+
def _expand(self, dictionary):
210210
res = {}
211-
for key, val in self._supports.items():
211+
for key, val in dictionary.items():
212212
if isinstance(val, Callable):
213213
res[key] = val()
214214
else:
215-
res[key] = val
215+
if isinstance(val, dict):
216+
res[key] = self._expand(val)
217+
else:
218+
res[key] = val
216219
return res
217220

221+
def supports(self):
222+
return self._expand(self._supports)
223+
218224
def supported(self, claim):
219225
return claim in self._supports
220226

0 commit comments

Comments
 (0)