Allow to hide openrc and clouds.yaml download links
Operators now can control whether the links of "Download OpenRC" and "Download clouds.yaml" are displayed or not via new settings SHOW_OPENRC_FILE and SHOW_OPENSTACK_CLOUDS_YAML. openrc and clouds.yaml files provided by horizon now assume the basic simple deployment and do not cover keystone authentication like saml2, openid and so on. The default openrc and clouds.yaml from horizon do not make sense for such environments. Change-Id: I1407a24387c7d7bd2c20c995cebf1350f8090e72 Partial-Bug: #1795851
This commit is contained in:
parent
d32359e011
commit
c6baf00734
|
@ -820,6 +820,25 @@ MEMOIZED_MAX_SIZE_DEFAULT allows setting a global default to help control
|
|||
memory usage when caching. It should at least be 2 x the number of threads
|
||||
with a little bit of extra buffer.
|
||||
|
||||
SHOW_OPENRC_FILE
|
||||
----------------
|
||||
|
||||
.. versionadded:: 15.0.0(Stein)
|
||||
|
||||
Default:: ``True``
|
||||
|
||||
Controls whether the keystone openrc file is accesible from the user
|
||||
menu and the api access panel.
|
||||
|
||||
SHOW_OPENSTACK_CLOUDS_YAML
|
||||
--------------------------
|
||||
|
||||
.. versionadded:: 15.0.0(Stein)
|
||||
|
||||
Default:: ``True``
|
||||
|
||||
Controls whether clouds.yaml is accesible from the user
|
||||
menu and the api access panel.
|
||||
|
||||
SHOW_KEYSTONE_V2_RC
|
||||
--------------------
|
||||
|
|
|
@ -51,6 +51,9 @@ class DownloadCloudsYaml(tables.LinkAction):
|
|||
icon = "download"
|
||||
url = "horizon:project:api_access:clouds.yaml"
|
||||
|
||||
def allowed(self, request, datum=None):
|
||||
return settings.SHOW_OPENSTACK_CLOUDS_YAML
|
||||
|
||||
|
||||
class DownloadOpenRC(tables.LinkAction):
|
||||
name = "download_openrc"
|
||||
|
@ -68,7 +71,8 @@ class DownloadOpenRC(tables.LinkAction):
|
|||
self.verbose_name = _("OpenStack RC File (Identity API v3)")
|
||||
|
||||
def allowed(self, request, datum=None):
|
||||
return utils.get_keystone_version() >= 3
|
||||
return (settings.SHOW_OPENRC_FILE and
|
||||
utils.get_keystone_version() >= 3)
|
||||
|
||||
|
||||
class DownloadOpenRCv2(tables.LinkAction):
|
||||
|
|
|
@ -114,6 +114,14 @@ WEBROOT = '/'
|
|||
# and the API Access page
|
||||
#SHOW_KEYSTONE_V2_RC = False
|
||||
|
||||
# Controls whether the keystone openrc file is accesible from the user
|
||||
# menu and the api access panel.
|
||||
SHOW_OPENRC_FILE = True
|
||||
|
||||
# Controls whether clouds.yaml is accesible from the user
|
||||
# menu and the api access panel.
|
||||
SHOW_OPENSTACK_CLOUDS_YAML = True
|
||||
|
||||
# If provided, a "Report Bug" link will be displayed in the site header
|
||||
# which links to the value of this setting (ideally a URL containing
|
||||
# information on how to report issues).
|
||||
|
|
|
@ -340,6 +340,8 @@ CSRF_COOKIE_AGE = None
|
|||
COMPRESS_OFFLINE_CONTEXT = 'horizon.themes.offline_context'
|
||||
|
||||
SHOW_KEYSTONE_V2_RC = False
|
||||
SHOW_OPENRC_FILE = True
|
||||
SHOW_OPENSTACK_CLOUDS_YAML = True
|
||||
|
||||
# Dictionary of currently available angular features
|
||||
ANGULAR_FEATURES = {
|
||||
|
@ -421,12 +423,13 @@ if USER_MENU_LINKS is None:
|
|||
'icon_classes': ['fa-download', ],
|
||||
'url': 'horizon:project:api_access:openrcv2',
|
||||
})
|
||||
USER_MENU_LINKS.append({
|
||||
'name': (_('OpenStack RC File v3') if SHOW_KEYSTONE_V2_RC
|
||||
else _('OpenStack RC File')),
|
||||
'icon_classes': ['fa-download', ],
|
||||
'url': 'horizon:project:api_access:openrc',
|
||||
})
|
||||
if SHOW_OPENRC_FILE:
|
||||
USER_MENU_LINKS.append({
|
||||
'name': (_('OpenStack RC File v3') if SHOW_KEYSTONE_V2_RC
|
||||
else _('OpenStack RC File')),
|
||||
'icon_classes': ['fa-download', ],
|
||||
'url': 'horizon:project:api_access:openrc',
|
||||
})
|
||||
|
||||
if not WEBROOT.endswith('/'):
|
||||
WEBROOT += '/'
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
[:bug:`1795851`] Operators now can control whether the links of
|
||||
"Download OpenRC" and "Download clouds.yaml" are displayed or not
|
||||
via new settings ``SHOW_OPENRC_FILE`` and ``SHOW_OPENSTACK_CLOUDS_YAML``.
|
||||
``openrc`` and ``clouds.yaml`` files provided by horizon now assume
|
||||
the basic simple deployment and do not cover keystone authentication
|
||||
like saml2, openid and so on. The default ``openrc`` and ``clouds.yaml``
|
||||
from horizon do not make sense for such environments.
|
Loading…
Reference in New Issue