Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DPE-1766] Juju 3 peer secrets #121

Merged
merged 48 commits into from
Sep 7, 2023
Merged

[DPE-1766] Juju 3 peer secrets #121

merged 48 commits into from
Sep 7, 2023

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Aug 2, 2023

Issue

Charm doesn't use secrets for internal sensitive values

Solution

  • Use Juju secrets instead of peer data if available

Comment on lines +423 to +427
def _normalize_secret_key(self, key: str) -> str:
new_key = key.replace("_", "-")
new_key = new_key.strip("-")

return new_key
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PGB is storing relation based secrets with generated names, so we cannot simply use an override mapping.

Comment on lines -127 to -131
- name: Dump logs
uses: canonical/charm-logdump-action@main
if: failure()
with:
app: pgbouncer-k8s
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to be doing anything useful.

Comment on lines +240 to +242
if not (password := self.charm.get_secret(APP_SCOPE, user)):
password = pgb.generate_password()
self.charm.peers.add_user(user, password)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If password is already generated and set, don't regenerate it. This was causing the consistent mattermost failures.

@dragomirp dragomirp marked this pull request as ready for review September 4, 2023 14:14
@dragomirp dragomirp merged commit 299e122 into main Sep 7, 2023
18 checks passed
@dragomirp dragomirp deleted the dpe-1766-peer-secrets branch September 7, 2023 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants