Skip to content

Commit

Permalink
fixed fatal bug and fixed bug where spamming the admin page would loc…
Browse files Browse the repository at this point in the history
…k you out of hsm
  • Loading branch information
lzuba committed Sep 12, 2023
1 parent 0d9e2f6 commit 9ebf7e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,12 @@ def handleDetailedMachine(self, mid: str):
posDuplicates=dupTable, passwords=pwTable, checkins=checkTable)

"""
"""
@orm.db_session
def handleAdmin(self):
db = self.__mysqlConx.dbClient.exists("SELECT * FROM auth_secret")
self.checkHSMTokenValidity(uses=0)
self.checkHSMTokenValidity(uses=2)
vaultResult = self.__hsmClient.checkConnection()
log = self.logger.tail.contents()
return "Ok" if db else "Failed to fetch ", "Ok" if vaultResult is True else vaultResult, log
Expand Down
2 changes: 1 addition & 1 deletion app/dbClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def updateHsmSecret(self, entry):
@orm.db_session
def readMachine(self, uid):
try:
return self.Machine.get(uid)
return self.Machine.get(id=uid)
except orm.ObjectNotFound as e:
logging.getLogger('mlaps').error(e)
return False
Expand Down

0 comments on commit 9ebf7e4

Please sign in to comment.