Browse code

Merge "Configurable token hashing algorithm"

Jenkins authored on 2014/09/23 04:05:08
Showing 2 changed files
... ...
@@ -112,6 +112,9 @@ function init_horizon {
112 112
 
113 113
     _horizon_config_set $local_settings "" OPENSTACK_HOST \"${KEYSTONE_SERVICE_HOST}\"
114 114
     _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v2.0\""
115
+    if [[ -n "$KEYSTONE_TOKEN_HASH_ALGORITHM" ]]; then
116
+        _horizon_config_set $local_settings "" OPENSTACK_TOKEN_HASH_ALGORITHM \""$KEYSTONE_TOKEN_HASH_ALGORITHM"\"
117
+    fi
115 118
 
116 119
     if [ -f $SSL_BUNDLE_FILE ]; then
117 120
         _horizon_config_set $local_settings "" OPENSTACK_SSL_CACERT \"${SSL_BUNDLE_FILE}\"
... ...
@@ -296,6 +296,10 @@ function configure_keystone {
296 296
 
297 297
     iniset $KEYSTONE_CONF DEFAULT admin_workers "$API_WORKERS"
298 298
     # Public workers will use the server default, typically number of CPU.
299
+
300
+    if [[ -n "$KEYSTONE_TOKEN_HASH_ALGORITHM" ]]; then
301
+        iniset $KEYSTONE_CONF token hash_algorithm "$KEYSTONE_TOKEN_HASH_ALGORITHM"
302
+    fi
299 303
 }
300 304
 
301 305
 function configure_keystone_extensions {
... ...
@@ -417,6 +421,9 @@ function configure_auth_token_middleware {
417 417
     iniset $conf_file $section admin_user $admin_user
418 418
     iniset $conf_file $section admin_password $SERVICE_PASSWORD
419 419
     iniset $conf_file $section signing_dir $signing_dir
420
+    if [[ -n "$KEYSTONE_TOKEN_HASH_ALGORITHM" ]]; then
421
+        iniset $conf_file keystone_authtoken hash_algorithms "$KEYSTONE_TOKEN_HASH_ALGORITHM"
422
+    fi
420 423
 }
421 424
 
422 425
 # init_keystone() - Initialize databases, etc.