Skip to content

Commit

Permalink
Merge pull request #1431 from dmach/fix-keyring-keyutils-callable-pas…
Browse files Browse the repository at this point in the history
…sword

Fix retrieving a password in case a function returns another callable
  • Loading branch information
dmach authored Oct 13, 2023
2 parents 225fea0 + 53968bf commit 2aa7c17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ def data(self):
# we use the password only from time to time to make a session cookie
# and there's no need to keep the password in program memory longer than necessary
result = self._data()

# the function can also return a function, let's evaluate them recursively
while callable(result):
result = result()

if result is None:
raise oscerr.OscIOError(None, "Unable to retrieve password")
return result
Expand Down

0 comments on commit 2aa7c17

Please sign in to comment.