Allow specifying of a global --password option

This fixes bz#1108742 by providing a new global parameter
"--default-password", that will be the default for all other password
parameters if set. Each individual password parameter can override the
default global, and if none are set, a random password will be used as
before.

As part of the change, process_param_value() has been updated, to avoid
leaking passwords when they are modified by a processor function.

Change-Id: Ic5947567599c8b221b7a9e60acb4708429507741
This commit is contained in:
Javier Pena
2014-09-17 16:15:03 +02:00
parent a45eaf6128
commit 512bdce979
18 changed files with 181 additions and 62 deletions

View File

@@ -9,6 +9,7 @@ import uuid
import os
from packstack.installer import validators
from packstack.installer import processors
from packstack.installer import basedefs
from packstack.installer import utils
@@ -95,12 +96,13 @@ def initConfig(controller):
"PROMPT": "Enter the password for NSS certificate database",
"OPTION_LIST": [],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": uuid.uuid4().hex[:32],
"MASK_INPUT": False,
"DEFAULT_VALUE": "PW_PLACEHOLDER",
"PROCESSORS": [processors.process_password],
"MASK_INPUT": True,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_AMQP_NSS_CERTDB_PW",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"NEED_CONFIRM": True,
"CONDITION": False},
{"CMD_OPTION": "amqp-ssl-port",
@@ -186,12 +188,13 @@ def initConfig(controller):
"PROMPT": "Enter the password for user authentication",
"OPTION_LIST": ["y", "n"],
"VALIDATORS": [validators.validate_not_empty],
"DEFAULT_VALUE": uuid.uuid4().hex[:16],
"MASK_INPUT": False,
"PROCESSORS": [processors.process_password],
"DEFAULT_VALUE": "PW_PLACEHOLDER",
"MASK_INPUT": True,
"LOOSE_VALIDATION": True,
"CONF_NAME": "CONFIG_AMQP_AUTH_PASSWORD",
"USE_DEFAULT": False,
"NEED_CONFIRM": False,
"NEED_CONFIRM": True,
"CONDITION": False},
]
group = {"GROUP_NAME": "AMQPAUTH",