Hide credentials with the issuer "_hidden:".

This commit is contained in:
Dain Nilsson 2016-06-08 11:51:53 +02:00
parent dd2953b192
commit cdfc77e0f3
2 changed files with 6 additions and 2 deletions

View File

@ -104,10 +104,10 @@ def show(ctx, query, slot1, slot2, timestamp):
if creds is None:
ctx.fail('No YubiKey found!')
matched = []
if query:
query = ' '.join(query)
# Filter based on query. If exact match, show only that result.
matched = []
for cred, code in creds:
if cred.name == query:
matched = [(cred, code)]
@ -127,6 +127,9 @@ def show(ctx, query, slot1, slot2, timestamp):
else:
creds = matched
if not query or len(matched) > 1: # Unless exact match, filter out hidden.
creds = [c for c in creds if not c[0].name.startswith('_hidden:')]
print_creds(creds)

View File

@ -251,7 +251,8 @@ class CodesWidget(QtGui.QWidget):
def refresh(self):
self._scroll_area.takeWidget().deleteLater()
creds = self._controller.credentials
creds = [c for c in self._controller.credentials
if not c.cred.name.startswith('_hidden:')]
self._scroll_area.setWidget(
CodesList(self._controller.timer, creds or [], self.refresh_timer))
w = self._scroll_area.widget().minimumSizeHint().width()