Skip to content

Commit c307b6d

Browse files
Merge pull request #898 from canonical/sync-main-16
[DPE-6112] Sync main 16 We are merging branches to avoid rebasing/squashing commits here for long lasting huge branch.
2 parents bd6e7a9 + 9faaf2c commit c307b6d

31 files changed

+2021
-163
lines changed

config.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ options:
3232
crashes and there are replicas.
3333
type: string
3434
default: "on"
35+
durability_wal_keep_size:
36+
description: |
37+
Sets the minimum size of the WAL file to be kept for the replication.
38+
Allowed values are: from 0 to 2147483647.
39+
type: int
40+
default: 4096
3541
experimental_max_connections:
3642
type: int
3743
description: |
@@ -63,6 +69,12 @@ options:
6369
Enable synchronized sequential scans.
6470
type: boolean
6571
default: true
72+
ldap_search_filter:
73+
description: |
74+
The LDAP search filter to match users with.
75+
Example: (|(uid=$username)(email=$username))
76+
type: string
77+
default: "(uid=$username)"
6678
logging_client_min_messages:
6779
description: |
6880
Sets the message levels that are sent to the client.
@@ -883,4 +895,4 @@ options:
883895
Multixact age at which VACUUM should scan whole table to freeze tuples.
884896
Allowed values are: from 0 to 2000000000.
885897
type: int
886-
default: 150000000
898+
default: 150000000

lib/charms/certificate_transfer_interface/v0/certificate_transfer.py

Lines changed: 432 additions & 0 deletions
Large diffs are not rendered by default.

lib/charms/data_platform_libs/v0/data_interfaces.py

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent):
331331

332332
# Increment this PATCH version before using `charmcraft publish-lib` or reset
333333
# to 0 if you are raising the major API version
334-
LIBPATCH = 41
334+
LIBPATCH = 42
335335

336336
PYDEPS = ["ops>=2.0.0"]
337337

@@ -960,6 +960,7 @@ class Data(ABC):
960960
"username": SECRET_GROUPS.USER,
961961
"password": SECRET_GROUPS.USER,
962962
"uris": SECRET_GROUPS.USER,
963+
"read-only-uris": SECRET_GROUPS.USER,
963964
"tls": SECRET_GROUPS.TLS,
964965
"tls-ca": SECRET_GROUPS.TLS,
965966
}
@@ -1700,7 +1701,7 @@ def set_tls_ca(self, relation_id: int, tls_ca: str) -> None:
17001701
class RequirerData(Data):
17011702
"""Requirer-side of the relation."""
17021703

1703-
SECRET_FIELDS = ["username", "password", "tls", "tls-ca", "uris"]
1704+
SECRET_FIELDS = ["username", "password", "tls", "tls-ca", "uris", "read-only-uris"]
17041705

17051706
def __init__(
17061707
self,
@@ -2368,7 +2369,7 @@ def _delete_relation_data(self, relation: Relation, fields: List[str]) -> None:
23682369
self.secret_fields,
23692370
fields,
23702371
self._update_relation_secret,
2371-
data={field: self.deleted_label for field in fields},
2372+
data=dict.fromkeys(fields, self.deleted_label),
23722373
)
23732374
else:
23742375
_, normal_fields = self._process_secret_fields(
@@ -2749,6 +2750,19 @@ def uris(self) -> Optional[str]:
27492750

27502751
return self.relation.data[self.relation.app].get("uris")
27512752

2753+
@property
2754+
def read_only_uris(self) -> Optional[str]:
2755+
"""Returns the readonly connection URIs."""
2756+
if not self.relation.app:
2757+
return None
2758+
2759+
if self.secrets_enabled:
2760+
secret = self._get_secret("user")
2761+
if secret:
2762+
return secret.get("read-only-uris")
2763+
2764+
return self.relation.data[self.relation.app].get("read-only-uris")
2765+
27522766
@property
27532767
def version(self) -> Optional[str]:
27542768
"""Returns the version of the database.
@@ -2855,6 +2869,15 @@ def set_uris(self, relation_id: int, uris: str) -> None:
28552869
"""
28562870
self.update_relation_data(relation_id, {"uris": uris})
28572871

2872+
def set_read_only_uris(self, relation_id: int, uris: str) -> None:
2873+
"""Set the database readonly connection URIs in the application relation databag.
2874+
2875+
Args:
2876+
relation_id: the identifier for a particular relation.
2877+
uris: connection URIs.
2878+
"""
2879+
self.update_relation_data(relation_id, {"read-only-uris": uris})
2880+
28582881
def set_version(self, relation_id: int, version: str) -> None:
28592882
"""Set the database version in the application relation databag.
28602883

0 commit comments

Comments
 (0)