Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed May 16, 2024
1 parent 77820ad commit 723cef9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/ssh_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ def delete_ssh_key(self, userid, keyid):
def check_ssh_key(key):
try:
paramiko.PublicBlob.from_string(key)
except Exception as ex:
except Exception:
return False
return True
16 changes: 9 additions & 7 deletions app/tests/test_ssh_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ def test_check_ssh_key(self):
res = SSHKey.check_ssh_key(key)
self.assertTrue(res)

key = ("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBC4bNaGHkWJW6xoQUmbpJaNzsVz22xsBYwAEBQkaL2A micafer@DESKTOP-6VOC4C3")
key = ("ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBC4bNaGHkWJW6xoQUmbpJaNzsVz22xsBYwAEBQkaL2A"
" micafer@DESKTOP-6VOC4C3")
res = SSHKey.check_ssh_key(key)
self.assertTrue(res)

key = ("ssh-dss AAAAB3NzaC1kc3MAAACBAIUsxgWjdFpzAG8QJtg1ogDrWgkLXRNA+eXeB5Xq/9Z/NaJ2ZZFGpkgtyvJRInc0E+4RcetAk5zRYN"
"pefw2WRaxXtdyprpcch8O3InpatpSH9L3sIF8FnJLmX+s4V2PlanGFDBA8IvNfrV4IQvD3PoTi4OqlwJTuSMtOXTJ3NrRFAAAAFQDh/v0J"
"ma1BSBFTi4+wKfa7nhh06QAAAIAxcPrc+PomR9u+P9hIOoz8vpsqZ+V5V1Caev+Oiq/JyI4iRg0Hig5br47c6Ckb1DupqgQAD9cJGQ8Fo7"
"RCmNpdvcOmUxTCN3GDWrceCjv/d+ce1hDVPKlleQ5RNAbJr0/MULswhJb5wHq1aoHm/fnXgtAwwBMgZe+Z3ruggLt7YgAAAIAfPpAYiobe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