Ensure identity credentials are requested

Change-Id: Ib7c541865303204a52d352ef7a180d07db5b145b
Signed-off-by: Guillaume Boutry <guillaume.boutry@canonical.com>
This commit is contained in:
Guillaume Boutry 2025-03-12 11:57:02 +01:00
parent e632c03547
commit 66d0fd5c2e
No known key found for this signature in database
GPG Key ID: 0DD77DC1796E98CD

View File

@ -628,6 +628,13 @@ class IdentityServiceRequiresHandler(RelationHandler):
if self.mandatory:
self.status.set(BlockedStatus("integration missing"))
def update_relation_data(self):
"""Update relation outside of relation context."""
if self.model.get_relation(self.relation_name):
self.interface.register_services(
self.service_endpoints, self.region
)
def update_service_endpoints(self, service_endpoints: list[dict]) -> None:
"""Update service endpoints on the relation."""
self.service_endpoints = service_endpoints
@ -1397,6 +1404,11 @@ class IdentityCredentialsRequiresHandler(RelationHandler):
if self.mandatory:
self.status.set(BlockedStatus("integration missing"))
def update_relation_data(self):
"""Update relation outside of relation context."""
if self.model.get_relation(self.relation_name):
self.interface.request_credentials()
@property
def ready(self) -> bool:
"""Whether handler is ready for use."""