Browse Source

Deprecate pki related options

check_revocations_for_cached and hash_algorithms are deprecated for
removel because of PKI token format is no longer supported.
Update warning message and add a release note.

Change-Id: I541df1b901024376e91b90012c3ddbe3296b6374
Closes-Bug: #1804562
Closes-Bug: #1804720
tags/14.2.0
ZhongShengping 6 months ago
parent
commit
17e2cf230e

+ 27
- 21
manifests/keystone/authtoken.pp View File

@@ -63,12 +63,6 @@
63 63
 #   (Optional) Required if identity server requires client certificate
64 64
 #   Defaults to $::os_service_default.
65 65
 #
66
-# [*check_revocations_for_cached*]
67
-#   (Optional) If true, the revocation list will be checked for cached tokens.
68
-#   This requires that PKI tokens are configured on the identity server.
69
-#   boolean value.
70
-#   Defaults to $::os_service_default.
71
-#
72 66
 # [*delay_auth_decision*]
73 67
 #   (Optional) Do not handle authorization requests within the middleware, but
74 68
 #   delegate the authorization decision to downstream WSGI components. Boolean
@@ -85,17 +79,6 @@
85 79
 #   must be present in tokens. String value.
86 80
 #   Defaults to $::os_service_default.
87 81
 #
88
-# [*hash_algorithms*]
89
-#   (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
90
-#   single algorithm or multiple. The algorithms are those supported by Python
91
-#   standard hashlib.new(). The hashes will be tried in the order given, so put
92
-#   the preferred one first for performance. The result of the first hash will
93
-#   be stored in the cache. This will typically be set to multiple values only
94
-#   while migrating from a less secure algorithm to a more secure one. Once all
95
-#   the old tokens are expired this option should be set to a single value for
96
-#   better performance. List value.
97
-#   Defaults to $::os_service_default.
98
-#
99 82
 # [*http_connect_timeout*]
100 83
 #   (Optional) Request timeout value for communicating with Identity API
101 84
 #   server.
@@ -186,6 +169,23 @@
186 169
 #   (Optional) Complete public Identity API endpoint.
187 170
 #   Defaults to undef
188 171
 #
172
+# [*check_revocations_for_cached*]
173
+#   (Optional) If true, the revocation list will be checked for cached tokens.
174
+#   This requires that PKI tokens are configured on the identity server.
175
+#   boolean value.
176
+#   Defaults to undef.
177
+#
178
+# [*hash_algorithms*]
179
+#   (Optional) Hash algorithms to use for hashing PKI tokens. This may be a
180
+#   single algorithm or multiple. The algorithms are those supported by Python
181
+#   standard hashlib.new(). The hashes will be tried in the order given, so put
182
+#   the preferred one first for performance. The result of the first hash will
183
+#   be stored in the cache. This will typically be set to multiple values only
184
+#   while migrating from a less secure algorithm to a more secure one. Once all
185
+#   the old tokens are expired this option should be set to a single value for
186
+#   better performance. List value.
187
+#   Defaults to undef.
188
+#
189 189
 class watcher::keystone::authtoken (
190 190
   $password                       = $::os_service_default,
191 191
   $username                       = 'watcher',
@@ -201,10 +201,8 @@ class watcher::keystone::authtoken (
201 201
   $cache                          = $::os_service_default,
202 202
   $cafile                         = $::os_service_default,
203 203
   $certfile                       = $::os_service_default,
204
-  $check_revocations_for_cached   = $::os_service_default,
205 204
   $delay_auth_decision            = $::os_service_default,
206 205
   $enforce_token_bind             = $::os_service_default,
207
-  $hash_algorithms                = $::os_service_default,
208 206
   $http_connect_timeout           = $::os_service_default,
209 207
   $http_request_max_retries       = $::os_service_default,
210 208
   $include_service_catalog        = $::os_service_default,
@@ -223,6 +221,8 @@ class watcher::keystone::authtoken (
223 221
   $token_cache_time               = $::os_service_default,
224 222
   # DEPRECATED PARAMETERS
225 223
   $auth_uri                       = undef,
224
+  $check_revocations_for_cached   = undef,
225
+  $hash_algorithms                = undef,
226 226
 ) {
227 227
 
228 228
   include ::watcher::deps
@@ -238,6 +238,14 @@ class watcher::keystone::authtoken (
238 238
   }
239 239
   $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri)
240 240
 
241
+  if $check_revocations_for_cached {
242
+    warning('check_revocations_for_cached parameter is deprecated, has no effect and will be removed in the future.')
243
+  }
244
+
245
+  if $hash_algorithms {
246
+    warning('hash_algorithms parameter is deprecated, has no effect and will be removed in the future.')
247
+  }
248
+
241 249
   keystone::resource::authtoken { 'watcher_config':
242 250
     password                       => $password,
243 251
     username                       => $username,
@@ -253,10 +261,8 @@ class watcher::keystone::authtoken (
253 261
     cache                          => $cache,
254 262
     cafile                         => $cafile,
255 263
     certfile                       => $certfile,
256
-    check_revocations_for_cached   => $check_revocations_for_cached,
257 264
     delay_auth_decision            => $delay_auth_decision,
258 265
     enforce_token_bind             => $enforce_token_bind,
259
-    hash_algorithms                => $hash_algorithms,
260 266
     http_connect_timeout           => $http_connect_timeout,
261 267
     http_request_max_retries       => $http_request_max_retries,
262 268
     include_service_catalog        => $include_service_catalog,

+ 6
- 0
releasenotes/notes/deprecate_pki_related_parameters-bc2f6013b96eaeeb.yaml View File

@@ -0,0 +1,6 @@
1
+---
2
+deprecations:
3
+  - check_revocations_for_cached option is now deprecated for removal, the
4
+    parameter has no effect.
5
+  - hash_algorithms option is now deprecated for removal, the parameter
6
+    has no effect.

+ 0
- 6
spec/classes/watcher_keystone_authtoken_spec.rb View File

@@ -29,10 +29,8 @@ describe 'watcher::keystone::authtoken' do
29 29
         is_expected.to contain_watcher_config('keystone_authtoken/cache').with_value('<SERVICE DEFAULT>')
30 30
         is_expected.to contain_watcher_config('keystone_authtoken/cafile').with_value('<SERVICE DEFAULT>')
31 31
         is_expected.to contain_watcher_config('keystone_authtoken/certfile').with_value('<SERVICE DEFAULT>')
32
-        is_expected.to contain_watcher_config('keystone_authtoken/check_revocations_for_cached').with_value('<SERVICE DEFAULT>')
33 32
         is_expected.to contain_watcher_config('keystone_authtoken/delay_auth_decision').with_value('<SERVICE DEFAULT>')
34 33
         is_expected.to contain_watcher_config('keystone_authtoken/enforce_token_bind').with_value('<SERVICE DEFAULT>')
35
-        is_expected.to contain_watcher_config('keystone_authtoken/hash_algorithms').with_value('<SERVICE DEFAULT>')
36 34
         is_expected.to contain_watcher_config('keystone_authtoken/http_connect_timeout').with_value('<SERVICE DEFAULT>')
37 35
         is_expected.to contain_watcher_config('keystone_authtoken/http_request_max_retries').with_value('<SERVICE DEFAULT>')
38 36
         is_expected.to contain_watcher_config('keystone_authtoken/include_service_catalog').with_value('<SERVICE DEFAULT>')
@@ -68,10 +66,8 @@ describe 'watcher::keystone::authtoken' do
68 66
           :cache                                => 'somevalue',
69 67
           :cafile                               => '/opt/stack/data/cafile.pem',
70 68
           :certfile                             => 'certfile.crt',
71
-          :check_revocations_for_cached         => false,
72 69
           :delay_auth_decision                  => false,
73 70
           :enforce_token_bind                   => 'permissive',
74
-          :hash_algorithms                      => 'md5',
75 71
           :http_connect_timeout                 => '300',
76 72
           :http_request_max_retries             => '3',
77 73
           :include_service_catalog              => true,
@@ -106,10 +102,8 @@ describe 'watcher::keystone::authtoken' do
106 102
         is_expected.to contain_watcher_config('keystone_authtoken/cache').with_value(params[:cache])
107 103
         is_expected.to contain_watcher_config('keystone_authtoken/cafile').with_value(params[:cafile])
108 104
         is_expected.to contain_watcher_config('keystone_authtoken/certfile').with_value(params[:certfile])
109
-        is_expected.to contain_watcher_config('keystone_authtoken/check_revocations_for_cached').with_value(params[:check_revocations_for_cached])
110 105
         is_expected.to contain_watcher_config('keystone_authtoken/delay_auth_decision').with_value(params[:delay_auth_decision])
111 106
         is_expected.to contain_watcher_config('keystone_authtoken/enforce_token_bind').with_value(params[:enforce_token_bind])
112
-        is_expected.to contain_watcher_config('keystone_authtoken/hash_algorithms').with_value(params[:hash_algorithms])
113 107
         is_expected.to contain_watcher_config('keystone_authtoken/http_connect_timeout').with_value(params[:http_connect_timeout])
114 108
         is_expected.to contain_watcher_config('keystone_authtoken/http_request_max_retries').with_value(params[:http_request_max_retries])
115 109
         is_expected.to contain_watcher_config('keystone_authtoken/include_service_catalog').with_value(params[:include_service_catalog])

Loading…
Cancel
Save