-
Couldn't load subscription status.
- Fork 27
[DPE-7594] Add custom users to pg_hba filter #1072
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2497,15 +2497,21 @@ def relations_user_databases_map(self) -> dict: | |
| }) | ||
| return user_database_map | ||
| try: | ||
| for user in self.postgresql.list_users_from_relation( | ||
| current_host=self.is_connectivity_enabled | ||
| ): | ||
| databases = ",".join( | ||
| for user in self.postgresql.list_users(current_host=self.is_connectivity_enabled): | ||
| if user in ( | ||
| "backup", | ||
| "monitoring", | ||
| "operator", | ||
| "postgres", | ||
| "replication", | ||
| "rewind", | ||
| ): | ||
| continue | ||
|
Comment on lines
+2501
to
+2509
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copied from the trigger. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please create a dedicated Jira ticket on Mohamed to decide the behavior here, as we are adding here backward compatibility to the current behavior which is not the best way to do in modernly hardened charm. Thank you! |
||
| if databases := ",".join( | ||
| self.postgresql.list_accessible_databases_for_user( | ||
| user, current_host=self.is_connectivity_enabled | ||
| ) | ||
| ) | ||
| if databases: | ||
| ): | ||
| user_database_map[user] = databases | ||
| else: | ||
| logger.debug(f"User {user} has no databases to connect to") | ||
|
Comment on lines
2516
to
2517
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The structure of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done: #1075 |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lib change for PGB.