Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace getpass with ui.input(hidden=True) #429

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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