Skip to content

Commit

Permalink
packaging: setup: Filter from logs secrets from otopi answer files
Browse files Browse the repository at this point in the history
For details, see oVirt/ovirt-engine#585 .
  • Loading branch information
didib committed Aug 24, 2022
1 parent 015cadc commit 7fa971b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ovirt-engine-keycloak.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ BuildRequires: python3
BuildRequires: python3-devel

Requires: %{name} >= 15.0.2
Requires: ovirt-engine-setup-plugin-ovirt-engine >= 4.5.0
Requires: ovirt-engine-setup-plugin-ovirt-engine >= 4.5.3
Requires: python%{python3_pkgversion}-ovirt-setup-lib

%description setup
Expand Down
16 changes: 7 additions & 9 deletions packaging/setup/ovirt_engine_setup/keycloak/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def KEYCLOAK_DB_ENV_KEYS(self):
DEK.DUMPER: DBEnv.DUMPER,
DEK.FILTER: DBEnv.FILTER,
DEK.RESTORE_JOBS: DBEnv.RESTORE_JOBS,
DEK.CREDS_Q_NAME_FUNC: keycloak_question_name,
}

@classproperty
Expand Down Expand Up @@ -151,6 +152,11 @@ def OVIRT_ADMIN_USER(self):
KEYCLOAK_WRAPPER_SCRIPT = 'OVESETUP_KEYCLOAK_CONFIG/kkWrapperScript'
KEYCLOAK_ADMIN_CONSOLE_URL= 'OVESETUP_KEYCLOAK_CONFIG/keycloakAdminConsoleUrl'


def keycloak_question_name(what):
return f'OVESETUP_KEYCLOAK_DB_{what.upper()}'


@util.export
@util.codegen
@osetupattrsclass
Expand All @@ -162,6 +168,7 @@ class DBEnv(object):
ProvisioningEnv.POSTGRES_PROVISIONING_ENABLED
),
is_secret=True,
asked_on=(keycloak_question_name(DEK.PASSWORD),),
)
def PASSWORD(self):
return 'OVESETUP_KEYCLOAK_DB/password'
Expand Down Expand Up @@ -214,15 +221,6 @@ def DATABASE(self):
def USER(self):
return 'OVESETUP_KEYCLOAK_DB/user'

@osetupattrs(
answerfile=True,
answerfile_condition=lambda env: not env.get(
ProvisioningEnv.POSTGRES_PROVISIONING_ENABLED
),
)
def PASSWORD(self):
return 'OVESETUP_KEYCLOAK_DB/password'

@osetupattrs(
answerfile=True,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def _customization(self):
dbenvkeys=okkcons.Const.KEYCLOAK_DB_ENV_KEYS,
).getCredentials(
name='Keycloak',
queryprefix='OVESETUP_KEYCLOAK_DB_',
defaultdbenvkeys=okkcons.Const.DEFAULT_KEYCLOAK_DB_ENV_KEYS,
show_create_msg=True,
)
Expand Down

0 comments on commit 7fa971b

Please sign in to comment.