Skip to content

Commit c657c77

Browse files
TEST: switch md5 2 scram-sha-256 by default
1 parent 574cbd5 commit c657c77

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/charms/postgresql_k8s/v1/postgresql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Increment this PATCH version before using `charmcraft publish-lib` or reset
3636
# to 0 if you are raising the major API version
37-
LIBPATCH = 0
37+
LIBPATCH = 1
3838

3939
# Groups to distinguish HBA access
4040
ACCESS_GROUP_IDENTITY = "identity_access"
@@ -849,7 +849,7 @@ def set_up_database(self, temp_location: Optional[str] = None) -> None:
849849
-- Add the new users to the pg_hba file.
850850
FOR rec IN SELECT * FROM relation_users
851851
LOOP
852-
insert_value := connection_type || ' ' || rec.databases || ' ' || rec.user || ' 0.0.0.0/0 md5';
852+
insert_value := connection_type || ' ' || rec.databases || ' ' || rec.user || ' 0.0.0.0/0 scram-sha-256';
853853
IF (SELECT COUNT(lines) FROM pg_hba WHERE lines = insert_value) = 0 THEN
854854
INSERT INTO pg_hba (lines) VALUES (insert_value);
855855
changes := changes + 1;

templates/patroni.yml.j2

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,27 +166,27 @@ postgresql:
166166
- local all monitoring password
167167
- {{ 'hostssl' if enable_tls else 'host' }} all +charmed_dba 0.0.0.0/0 scram-sha-256
168168
{%- if not connectivity %}
169-
- {{ 'hostssl' if enable_tls else 'host' }} all all {{ self_ip }} md5
169+
- {{ 'hostssl' if enable_tls else 'host' }} all all {{ self_ip }} scram-sha-256
170170
- {{ 'hostssl' if enable_tls else 'host' }} all all 0.0.0.0/0 reject
171171
{%- elif enable_ldap %}
172172
- {{ 'hostssl' if enable_tls else 'host' }} all +identity_access 0.0.0.0/0 ldap {{ ldap_parameters }}
173-
- {{ 'hostssl' if enable_tls else 'host' }} all +internal_access 0.0.0.0/0 md5
173+
- {{ 'hostssl' if enable_tls else 'host' }} all +internal_access 0.0.0.0/0 scram-sha-256
174174
{%- for user, databases in user_databases_map.items() %}
175-
- {{ 'hostssl' if enable_tls else 'host' }} {{ databases }} {{ user }} 0.0.0.0/0 md5
175+
- {{ 'hostssl' if enable_tls else 'host' }} {{ databases }} {{ user }} 0.0.0.0/0 scram-sha-256
176176
{%- endfor %}
177177
{%- else %}
178-
- {{ 'hostssl' if enable_tls else 'host' }} all +internal_access 0.0.0.0/0 md5
178+
- {{ 'hostssl' if enable_tls else 'host' }} all +internal_access 0.0.0.0/0 scram-sha-256
179179
{%- for user, databases in user_databases_map.items() %}
180-
- {{ 'hostssl' if enable_tls else 'host' }} {{ databases }} {{ user }} 0.0.0.0/0 md5
180+
- {{ 'hostssl' if enable_tls else 'host' }} {{ databases }} {{ user }} 0.0.0.0/0 scram-sha-256
181181
{%- endfor %}
182182
{%- endif %}
183-
- {{ 'hostssl' if enable_tls else 'host' }} replication replication 127.0.0.1/32 md5
183+
- {{ 'hostssl' if enable_tls else 'host' }} replication replication 127.0.0.1/32 scram-sha-256
184184
# Allow replications connections from other cluster members.
185185
{%- for endpoint in extra_replication_endpoints %}
186-
- {{ 'hostssl' if enable_tls else 'host' }} replication replication {{ endpoint }}/32 md5
186+
- {{ 'hostssl' if enable_tls else 'host' }} replication replication {{ endpoint }}/32 scram-sha-256
187187
{%- endfor %}
188188
{%- for peer_ip in peers_ips %}
189-
- {{ 'hostssl' if enable_tls else 'host' }} replication replication {{ peer_ip }}/0 md5
189+
- {{ 'hostssl' if enable_tls else 'host' }} replication replication {{ peer_ip }}/0 scram-sha-256
190190
{% endfor %}
191191
pg_ident:
192192
- operator snap_daemon backup

0 commit comments

Comments
 (0)