Use generated passwords for admin and charm users
Hard coded defaults are not good; switch to using generated passwords for core admin and charm users. Change-Id: Ic2933966ab81d68e320556df2bcac5329ccc9c8d
This commit is contained in:
parent
8db5069062
commit
c91175597f
@ -1,3 +1,5 @@
|
|||||||
# Copyright 2021 Canonical Ltd.
|
# Copyright 2021 Canonical Ltd.
|
||||||
# See LICENSE file for licensing details.
|
# See LICENSE file for licensing details.
|
||||||
{ }
|
|
||||||
|
get-admin-password:
|
||||||
|
description: Get the password for the Keystone Admin user
|
||||||
|
@ -293,6 +293,14 @@ class KeystoneOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm):
|
|||||||
self.framework.observe(self.on.heartbeat, self._on_heartbeat)
|
self.framework.observe(self.on.heartbeat, self._on_heartbeat)
|
||||||
self._launch_heartbeat()
|
self._launch_heartbeat()
|
||||||
|
|
||||||
|
self.framework.observe(
|
||||||
|
self.on.get_admin_password_action,
|
||||||
|
self._get_admin_password_action
|
||||||
|
)
|
||||||
|
|
||||||
|
def _get_admin_password_action(self, event):
|
||||||
|
event.set_results({"password": self.admin_password})
|
||||||
|
|
||||||
def _launch_heartbeat(self):
|
def _launch_heartbeat(self):
|
||||||
"""
|
"""
|
||||||
Launch another process that will wake up the charm every 5 minutes.
|
Launch another process that will wake up the charm every 5 minutes.
|
||||||
@ -584,9 +592,9 @@ class KeystoneOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm):
|
|||||||
return self._state.admin_domain_id
|
return self._state.admin_domain_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def admin_password(self):
|
def admin_password(self) -> str:
|
||||||
# TODO(wolsen) password stuff
|
"""Retrieve the password for the Admin user."""
|
||||||
return 'abc123'
|
return self._retrieve_or_set_password(self.admin_user)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def admin_user(self):
|
def admin_user(self):
|
||||||
@ -606,9 +614,9 @@ class KeystoneOperatorCharm(sunbeam_charm.OSBaseOperatorAPICharm):
|
|||||||
return '_charm-keystone-admin'
|
return '_charm-keystone-admin'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def charm_password(self):
|
def charm_password(self) -> str:
|
||||||
# TODO
|
"""The password for the charm admin user."""
|
||||||
return 'abc123'
|
return self._retrieve_or_set_password(self.charm_user)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def service_project(self):
|
def service_project(self):
|
||||||
|
@ -9,6 +9,6 @@ mock
|
|||||||
flake8
|
flake8
|
||||||
stestr
|
stestr
|
||||||
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
|
git+https://github.com/openstack-charmers/zaza.git#egg=zaza
|
||||||
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
|
git+https://github.com/javacruft/zaza-openstack-tests.git@get-admin-passwords-k8s#egg=zaza.openstack
|
||||||
git+https://opendev.org/openstack/tempest.git#egg=tempest
|
git+https://opendev.org/openstack/tempest.git#egg=tempest
|
||||||
ops
|
ops
|
||||||
|
1
charms/keystone-k8s/tests/actions.yaml
Symbolic link
1
charms/keystone-k8s/tests/actions.yaml
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../actions.yaml
|
Loading…
Reference in New Issue
Block a user