diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2014-07-02 14:12:44 -0700 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-07-04 01:56:18 +0000 |
| commit | b8f534df011fd3b16a182d25f627876aeecfee07 (patch) | |
| tree | 43872e1e2e5ba899cd237029bd4a279f779f914c /openstackclient/shell.py | |
| parent | 0ab179143943878d53ce37e8412734620d7b7583 (diff) | |
| download | python-openstackclient-b8f534df011fd3b16a182d25f627876aeecfee07.tar.gz | |
Remove keyring support from openstackclient
* The encryption it purports to offer is completely insecure.
* It also appears to be broken.
Closes-Bug: #1319381
Change-Id: Id15ecfbbfd15f142b14c125bfd85afd5032699ac
Diffstat (limited to 'openstackclient/shell.py')
| -rw-r--r-- | openstackclient/shell.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 6aae1a68..e4f3b92e 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -31,7 +31,6 @@ import openstackclient from openstackclient.common import clientmanager from openstackclient.common import commandmanager from openstackclient.common import exceptions as exc -from openstackclient.common import openstackkeyring from openstackclient.common import restapi from openstackclient.common import utils from openstackclient.identity import client as identity_client @@ -305,18 +304,6 @@ class OpenStackShell(app.App): default=env('OS_URL'), help='Defaults to env[OS_URL]') - env_os_keyring = env('OS_USE_KEYRING', default=False) - if type(env_os_keyring) == str: - if env_os_keyring.lower() in ['true', '1']: - env_os_keyring = True - else: - env_os_keyring = False - parser.add_argument('--os-use-keyring', - default=env_os_keyring, - action='store_true', - help='Use keyring to store password, ' - 'default=False (Env: OS_USE_KEYRING)') - parser.add_argument( '--os-identity-api-version', metavar='<identity-api-version>', @@ -352,14 +339,12 @@ class OpenStackShell(app.App): "You must provide a username via" " either --os-username or env[OS_USERNAME]") - self.get_password_from_keyring() if not self.options.os_password: # No password, if we've got a tty, try prompting for it if hasattr(sys.stdin, 'isatty') and sys.stdin.isatty(): # Check for Ctl-D try: self.options.os_password = getpass.getpass() - self.set_password_in_keyring() except EOFError: pass # No password because we did't have a tty or the @@ -406,34 +391,6 @@ class OpenStackShell(app.App): ) return - def init_keyring_backend(self): - """Initialize openstack backend to use for keyring""" - return openstackkeyring.os_keyring() - - def get_password_from_keyring(self): - """Get password from keyring, if it's set""" - if self.options.os_use_keyring: - service = KEYRING_SERVICE - backend = self.init_keyring_backend() - if not self.options.os_password: - password = backend.get_password(service, - self.options.os_username) - self.options.os_password = password - - def set_password_in_keyring(self): - """Set password in keyring for this user""" - if self.options.os_use_keyring: - service = KEYRING_SERVICE - backend = self.init_keyring_backend() - if self.options.os_password: - password = backend.get_password(service, - self.options.os_username) - # either password is not set in keyring, or it is different - if password != self.options.os_password: - backend.set_password(service, - self.options.os_username, - self.options.os_password) - def initialize_app(self, argv): """Global app init bits: |
