Skip to content

Commit b8f534d

Browse files
alexSteve Martinelli
authored andcommitted
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
1 parent 0ab1791 commit b8f534d

5 files changed

Lines changed: 1 addition & 116 deletions

File tree

README.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,16 @@ The 'password flow' variation is most commonly used::
7979
export OS_PROJECT_NAME=<project-name>
8080
export OS_USERNAME=<user-name>
8181
export OS_PASSWORD=<password> # (optional)
82-
export OS_USE_KEYRING=true # (optional)
8382

8483
The corresponding command-line options look very similar::
8584

8685
--os-auth-url <url>
8786
--os-project-name <project-name>
8887
--os-username <user-name>
8988
[--os-password <password>]
90-
[--os-use-keyring]
9189

9290
If a password is not provided above (in plaintext), you will be interactively
93-
prompted to provide one securely. If keyring is enabled, the password entered
94-
in the prompt is stored in keyring. From next time, the password is read from
95-
keyring, if it is not provided above (in plaintext).
91+
prompted to provide one securely.
9692

9793
The token flow variation for authentication uses an already-acquired token
9894
and a URL pointing directly to the service API that presumably was acquired

doc/source/man/openstack.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ OPTIONS
6868
:option:`--os-default-domain` <auth-domain>
6969
Default domain ID (Default: 'default')
7070

71-
:option:`--os-use-keyring`
72-
Use keyring to store password (default: False)
73-
7471
:option:`--os-cacert` <ca-bundle-file>
7572
CA certificate bundle file
7673

@@ -175,9 +172,6 @@ The following environment variables can be set to alter the behaviour of :progra
175172
:envvar:`OS_DEFAULT_DOMAIN`
176173
Default domain ID (Default: ‘default’)
177174

178-
:envvar:`OS_USE_KEYRING`
179-
Use keyring to store password (default: False)
180-
181175
:envvar:`OS_CACERT`
182176
CA certificate bundle file
183177

openstackclient/common/openstackkeyring.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

openstackclient/shell.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from openstackclient.common import clientmanager
3232
from openstackclient.common import commandmanager
3333
from openstackclient.common import exceptions as exc
34-
from openstackclient.common import openstackkeyring
3534
from openstackclient.common import restapi
3635
from openstackclient.common import utils
3736
from openstackclient.identity import client as identity_client
@@ -305,18 +304,6 @@ def build_option_parser(self, description, version):
305304
default=env('OS_URL'),
306305
help='Defaults to env[OS_URL]')
307306

308-
env_os_keyring = env('OS_USE_KEYRING', default=False)
309-
if type(env_os_keyring) == str:
310-
if env_os_keyring.lower() in ['true', '1']:
311-
env_os_keyring = True
312-
else:
313-
env_os_keyring = False
314-
parser.add_argument('--os-use-keyring',
315-
default=env_os_keyring,
316-
action='store_true',
317-
help='Use keyring to store password, '
318-
'default=False (Env: OS_USE_KEYRING)')
319-
320307
parser.add_argument(
321308
'--os-identity-api-version',
322309
metavar='<identity-api-version>',
@@ -352,14 +339,12 @@ def authenticate_user(self):
352339
"You must provide a username via"
353340
" either --os-username or env[OS_USERNAME]")
354341

355-
self.get_password_from_keyring()
356342
if not self.options.os_password:
357343
# No password, if we've got a tty, try prompting for it
358344
if hasattr(sys.stdin, 'isatty') and sys.stdin.isatty():
359345
# Check for Ctl-D
360346
try:
361347
self.options.os_password = getpass.getpass()
362-
self.set_password_in_keyring()
363348
except EOFError:
364349
pass
365350
# No password because we did't have a tty or the
@@ -406,34 +391,6 @@ def authenticate_user(self):
406391
)
407392
return
408393

409-
def init_keyring_backend(self):
410-
"""Initialize openstack backend to use for keyring"""
411-
return openstackkeyring.os_keyring()
412-
413-
def get_password_from_keyring(self):
414-
"""Get password from keyring, if it's set"""
415-
if self.options.os_use_keyring:
416-
service = KEYRING_SERVICE
417-
backend = self.init_keyring_backend()
418-
if not self.options.os_password:
419-
password = backend.get_password(service,
420-
self.options.os_username)
421-
self.options.os_password = password
422-
423-
def set_password_in_keyring(self):
424-
"""Set password in keyring for this user"""
425-
if self.options.os_use_keyring:
426-
service = KEYRING_SERVICE
427-
backend = self.init_keyring_backend()
428-
if self.options.os_password:
429-
password = backend.get_password(service,
430-
self.options.os_username)
431-
# either password is not set in keyring, or it is different
432-
if password != self.options.os_password:
433-
backend.set_password(service,
434-
self.options.os_username,
435-
self.options.os_password)
436-
437394
def initialize_app(self, argv):
438395
"""Global app init bits:
439396

requirements.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
pbr>=0.6,!=0.7,<1.0
22
cliff>=1.6.0
3-
keyring>=2.1
4-
pycrypto>=2.6
53
python-glanceclient>=0.13.1
64
python-keystoneclient>=0.9.0
75
python-novaclient>=2.17.0

0 commit comments

Comments
 (0)