Browse Source

Merge "Allow to hide openrc and clouds.yaml download links"

tags/15.0.0.0b2
Zuul 5 months ago
parent
commit
a1ffa9620e

+ 19
- 0
doc/source/configuration/settings.rst View File

@@ -835,6 +835,25 @@ MEMOIZED_MAX_SIZE_DEFAULT allows setting a global default to help control
835 835
 memory usage when caching. It should at least be 2 x the number of threads
836 836
 with a little bit of extra buffer.
837 837
 
838
+SHOW_OPENRC_FILE
839
+----------------
840
+
841
+.. versionadded:: 15.0.0(Stein)
842
+
843
+Default:: ``True``
844
+
845
+Controls whether the keystone openrc file is accesible from the user
846
+menu and the api access panel.
847
+
848
+SHOW_OPENSTACK_CLOUDS_YAML
849
+--------------------------
850
+
851
+.. versionadded:: 15.0.0(Stein)
852
+
853
+Default:: ``True``
854
+
855
+Controls whether clouds.yaml is accesible from the user
856
+menu and the api access panel.
838 857
 
839 858
 SHOW_KEYSTONE_V2_RC
840 859
 --------------------

+ 5
- 1
openstack_dashboard/dashboards/project/api_access/tables.py View File

@@ -51,6 +51,9 @@ class DownloadCloudsYaml(tables.LinkAction):
51 51
     icon = "download"
52 52
     url = "horizon:project:api_access:clouds.yaml"
53 53
 
54
+    def allowed(self, request, datum=None):
55
+        return settings.SHOW_OPENSTACK_CLOUDS_YAML
56
+
54 57
 
55 58
 class DownloadOpenRC(tables.LinkAction):
56 59
     name = "download_openrc"
@@ -68,7 +71,8 @@ class DownloadOpenRC(tables.LinkAction):
68 71
             self.verbose_name = _("OpenStack RC File (Identity API v3)")
69 72
 
70 73
     def allowed(self, request, datum=None):
71
-        return utils.get_keystone_version() >= 3
74
+        return (settings.SHOW_OPENRC_FILE and
75
+                utils.get_keystone_version() >= 3)
72 76
 
73 77
 
74 78
 class DownloadOpenRCv2(tables.LinkAction):

+ 8
- 0
openstack_dashboard/local/local_settings.py.example View File

@@ -114,6 +114,14 @@ WEBROOT = '/'
114 114
 # and the API Access page
115 115
 #SHOW_KEYSTONE_V2_RC = False
116 116
 
117
+# Controls whether the keystone openrc file is accesible from the user
118
+# menu and the api access panel.
119
+SHOW_OPENRC_FILE = True
120
+
121
+# Controls whether clouds.yaml is accesible from the user
122
+# menu and the api access panel.
123
+SHOW_OPENSTACK_CLOUDS_YAML = True
124
+
117 125
 # If provided, a "Report Bug" link will be displayed in the site header
118 126
 # which links to the value of this setting (ideally a URL containing
119 127
 # information on how to report issues).

+ 9
- 6
openstack_dashboard/settings.py View File

@@ -348,6 +348,8 @@ CSRF_COOKIE_AGE = None
348 348
 COMPRESS_OFFLINE_CONTEXT = 'horizon.themes.offline_context'
349 349
 
350 350
 SHOW_KEYSTONE_V2_RC = False
351
+SHOW_OPENRC_FILE = True
352
+SHOW_OPENSTACK_CLOUDS_YAML = True
351 353
 
352 354
 # Dictionary of currently available angular features
353 355
 ANGULAR_FEATURES = {
@@ -429,12 +431,13 @@ if USER_MENU_LINKS is None:
429 431
             'icon_classes': ['fa-download', ],
430 432
             'url': 'horizon:project:api_access:openrcv2',
431 433
         })
432
-    USER_MENU_LINKS.append({
433
-        'name': (_('OpenStack RC File v3') if SHOW_KEYSTONE_V2_RC
434
-                 else _('OpenStack RC File')),
435
-        'icon_classes': ['fa-download', ],
436
-        'url': 'horizon:project:api_access:openrc',
437
-    })
434
+    if SHOW_OPENRC_FILE:
435
+        USER_MENU_LINKS.append({
436
+            'name': (_('OpenStack RC File v3') if SHOW_KEYSTONE_V2_RC
437
+                     else _('OpenStack RC File')),
438
+            'icon_classes': ['fa-download', ],
439
+            'url': 'horizon:project:api_access:openrc',
440
+        })
438 441
 
439 442
 if not WEBROOT.endswith('/'):
440 443
     WEBROOT += '/'

+ 10
- 0
releasenotes/notes/openrc-clouds-yaml-link-f1642b77e25f08ba.yaml View File

@@ -0,0 +1,10 @@
1
+---
2
+features:
3
+  - |
4
+    [:bug:`1795851`] Operators now can control whether the links of
5
+    "Download OpenRC" and "Download clouds.yaml" are displayed or not
6
+    via new settings ``SHOW_OPENRC_FILE`` and ``SHOW_OPENSTACK_CLOUDS_YAML``.
7
+    ``openrc`` and ``clouds.yaml`` files provided by horizon now assume
8
+    the basic simple deployment and do not cover keystone authentication
9
+    like saml2, openid and so on. The default ``openrc`` and ``clouds.yaml``
10
+    from horizon do not make sense for such environments.

Loading…
Cancel
Save