Skip to content

Commit

Permalink
chore: Update charm libraries (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
telcobot authored Mar 26, 2024
1 parent 066c6ff commit d685dd5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/charms/tls_certificates_interface/v3/tls_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def _on_all_certificates_invalidated(self, event: AllCertificatesInvalidatedEven

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 5
LIBPATCH = 6

PYDEPS = ["cryptography", "jsonschema"]

Expand Down Expand Up @@ -450,6 +450,10 @@ class ProviderCertificate:
chain: List[str]
revoked: bool

def chain_as_pem(self) -> str:
"""Return full certificate chain as a PEM string."""
return "\n\n".join(reversed(self.chain))


class CertificateAvailableEvent(EventBase):
"""Charm Event triggered when a TLS certificate is available."""
Expand Down Expand Up @@ -484,6 +488,10 @@ def restore(self, snapshot: dict):
self.ca = snapshot["ca"]
self.chain = snapshot["chain"]

def chain_as_pem(self) -> str:
"""Return full certificate chain as a PEM string."""
return "\n\n".join(reversed(self.chain))


class CertificateExpiringEvent(EventBase):
"""Charm Event triggered when a TLS certificate is almost expired."""
Expand Down

0 comments on commit d685dd5

Please sign in to comment.