Skip to content

Commit

Permalink
Merge pull request #429 from jbgosselin/replace-getpass-ui-input
Browse files Browse the repository at this point in the history
Replace getpass with ui.input(hidden=True)
  • Loading branch information
epierce authored Sep 24, 2023
2 parents b5e87be + 4b8f442 commit 094a329
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions gimme_aws_creds/okta_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""
import base64
import copy
import getpass
import re
import socket
import time
Expand Down Expand Up @@ -914,7 +913,7 @@ def _get_username_password_creds(self):
# via OKTA_USERNAME env and user might not remember.
for x in range(0, 5):
passwd_prompt = "Okta Password for {}: ".format(username)
password = getpass.getpass(prompt=passwd_prompt)
password = self.ui.input(message=passwd_prompt, hidden=True)
if len(password) > 0:
break

Expand Down
6 changes: 2 additions & 4 deletions gimme_aws_creds/webauthn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from __future__ import print_function, absolute_import, unicode_literals

from getpass import getpass
from threading import Event, Thread

from ctap_keyring_device.ctap_keyring_device import CtapKeyringDevice
Expand Down Expand Up @@ -140,13 +139,12 @@ def _run_in_thread(self, method, *args, **kwargs):
self.ui.info('Operation timed out or no valid Security Key found !')
raise FIDODeviceTimeoutError

@staticmethod
def _get_pin_from_client(client):
def _get_pin_from_client(self, client):
if not client.info.options.get(CtapOptions.CLIENT_PIN):
return None

# Prompt for PIN if needed
pin = getpass("Please enter PIN: ")
pin = self.ui.input(message="Please enter PIN: ", hidden=True)
return pin

@staticmethod
Expand Down

0 comments on commit 094a329

Please sign in to comment.