Skip to content

Commit 45f355b

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Remove OSCGenericPassword plugin"
2 parents 51fcd7c + ccbb2dd commit 45f355b

5 files changed

Lines changed: 28 additions & 49 deletions

File tree

doc/source/backwards-incompatible.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,25 @@ deprecation warnings that indicate the new commands (or options) to use.
1313
Commands labeled as a beta according to :doc:`command-beta` are exempt from
1414
this backwards incompatible change handling.
1515

16-
List of Backwards Incompatible Changes
17-
======================================
16+
Backwards Incompatible Changes
17+
==============================
18+
19+
Release 3.0
20+
-----------
21+
22+
1. Remove the ``osc_password`` authentication plugin.
23+
24+
This was the 'last-resort' plugin default that worked around an old default
25+
Keystone configuration for the ``admin_endpoint`` and ``public_endpoint``.
26+
27+
* In favor of: ``password``
28+
* As of: 3.0
29+
* Removed in: n/a
30+
* Bug: n/a
31+
* Commit: https://review.openstack.org/332938
32+
33+
Releases Before 3.0
34+
-------------------
1835

1936
1. Rename command `openstack project usage list`
2037

openstackclient/api/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def select_auth_plugin(options):
8686
auth_plugin_name = 'v2password'
8787
else:
8888
# let keystoneclient figure it out itself
89-
auth_plugin_name = 'osc_password'
89+
auth_plugin_name = 'password'
9090
elif options.auth.get('token'):
9191
if options.identity_api_version == '3':
9292
auth_plugin_name = 'v3token'
@@ -98,7 +98,7 @@ def select_auth_plugin(options):
9898
else:
9999
# The ultimate default is similar to the original behaviour,
100100
# but this time with version discovery
101-
auth_plugin_name = 'osc_password'
101+
auth_plugin_name = 'password'
102102
LOG.debug("Auth plugin %s selected", auth_plugin_name)
103103
return auth_plugin_name
104104

openstackclient/api/auth_plugin.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
import logging
1717

1818
from keystoneauth1 import loading
19-
from keystoneauth1.loading._plugins.identity import generic as ksa_password
2019
from keystoneauth1 import token_endpoint
21-
from six.moves.urllib import parse as urlparse
2220

2321
from openstackclient.i18n import _
2422

@@ -65,45 +63,3 @@ def get_options(self):
6563
),
6664
]
6765
return options
68-
69-
70-
class OSCGenericPassword(ksa_password.Password):
71-
"""Auth plugin hack to work around broken Keystone configurations
72-
73-
The default Keystone configuration uses http://localhost:xxxx in
74-
admin_endpoint and public_endpoint and are returned in the links.href
75-
attribute by the version routes. Deployments that do not set these
76-
are unusable with newer keystoneclient version discovery.
77-
78-
"""
79-
80-
def create_plugin(self, session, version, url, raw_status=None):
81-
"""Handle default Keystone endpoint configuration
82-
83-
Build the actual API endpoint from the scheme, host and port of the
84-
original auth URL and the rest from the returned version URL.
85-
"""
86-
87-
ver_u = urlparse.urlparse(url)
88-
89-
# Only hack this if it is the default setting
90-
if ver_u.netloc.startswith('localhost'):
91-
auth_u = urlparse.urlparse(self.auth_url)
92-
# from original auth_url: scheme, netloc
93-
# from api_url: path, query (basically, the rest)
94-
url = urlparse.urlunparse((
95-
auth_u.scheme,
96-
auth_u.netloc,
97-
ver_u.path,
98-
ver_u.params,
99-
ver_u.query,
100-
ver_u.fragment,
101-
))
102-
LOG.debug('Version URL updated: %s', url)
103-
104-
return super(OSCGenericPassword, self).create_plugin(
105-
session=session,
106-
version=version,
107-
url=url,
108-
raw_status=raw_status,
109-
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
upgrade:
3+
- With the change to use keystoneauth plugins the OpenStackClient-specific
4+
``osc_password`` authentication plugin has been removed. The visible
5+
difference should only be in the behaviour with poorly configured clouds
6+
with old default Keystone values for admin_endpoint and public_endpoint
7+
as seen in the version details returned in a GET to the root ('/') route.

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ console_scripts =
2828

2929
keystoneauth1.plugin =
3030
token_endpoint = openstackclient.api.auth_plugin:TokenEndpoint
31-
osc_password = openstackclient.api.auth_plugin:OSCGenericPassword
3231

3332
openstack.cli =
3433
command_list = openstackclient.common.module:ListCommand

0 commit comments

Comments
 (0)